From stream back to broadcast

Thursday, March 21st, 2024 at 07:55pm

This tangle of wires is my new morning alarm:

The parts in this picure are:

  • Cheap set of computer speakers (that run from 5V)
  • An unbranded Si4703 FM Tuner Breakout Board
  • D1 mini arduino board (runs from 5V and has built in wifi)
  • Relay (to control power to the speaker amplifier)
  • Momentary switch (to give it local commands)

It has been a bit more than five years since I switched to using a Chromecast speaker playing the internet stream for a radio station as my alarm clock. It has mostly been fine, except when not…

The first major issue was not that long after I set this up, the radio station I had chosen decided to change their main stream over to HLS which it turns out my speaker does not support. I tried to work out if there was a proxy I could use (or make) to covert HLS back to the older style, but then managed to locate an alternate stream for the same radio station.

An intermittent issue, but happening more in recent weeks, is that sometimes the stream doesn’t start, or the stream will start but then after a time will stop. I can see from the Home Assistant logs that it does start but then falls back to “buffering” and then off. I’m thinking that this is a network timeout or other issue.

I have also been looking out for a new speaker for the kitchen, but here it is not for streaming the radio, but for playing podcasts from my phone via bluetooth. The cheap speaker I have now doesn’t always connect to my phone and I want something mains powered so I don’t have to remember to turn it off to make the battery last as long as possible between recharges.

As I was struggling to find a non-portable bluetooth speaker for the kitchen I started thinking about a cheap mini hifi that had bluetooth. That thought evolved into what able using that for my alarm because I now have an IR blaster to control my AC unit, that could also send commands to a mini hifi.

Looking though parts I have picked up over the years I came across the Si4703 FM tuner board, what if I revisited that idea? It would better integrate into Home Assistant as it could give current status that an IR blaster cannot do. These thoughts felt familiar, so I looked back at my post from five years ago. Huh. These are all options I looked into back then…

Instead of spending money on a mini hifi I realised that already had the parts I needed. The FM tuner board and a spare set of computer speakers could be the alarm, then the current chromecast speaker could be moved to the kitchen and used directly with bluetooth. What really made this come together is this video from two months ago:


Old-School Radio: Integrating an FM Receiver into Home Assistant

It is looking like the example code from the video will do almost what I want. I might go through and strip out the serial control and OTA update functionality that I’m not going to use, but apart from tweaking some of the defaults and adding in control of a relay I think the software side might be sorted, including a panel within Home Assistant that I have updated with local station presets.

I have been using this for around two weeks now, it is working quite well so I should get around to tidying it up into a project box.

Tagged with: