HOW TO: Automatically turn on amplifier when music is playing (Sonos Connect / Port)

I’m just documenting this because I had a hard time figuring it out :slight_smile:

The problem: I have a classic hifi system with a sonos connect (now port) connected to it. Because the system isn’t smart, I always have to search for and press the IR remote to turn the amplifier on.

Home Assistants automatically logs the Sonos’ status as a media_player entity that is either “playing” or “paused”.

Using this status you can make a simple automation that turns on the amp whenever the Media Player is “playing”. I’ve used node red and have another automation that turns the amp off after two minutes of “paused”.

Turning on is done with the Broadlink RM Mini 3 IR blaster which costs around 20 or so bucks. Home assistant has a Broadlink integration and setting it up is more or less straight forward. Some hints if you are stuck: The remote.learn_command service has successfully learned the command once the notification disappears. The commands will be stored in .storage, if you want to check if it has worked.

Well that’s it already.

Some other ways that I’ve not followed through:

a) Getting something that reads the audio signal and then turns on the amp. I thought I could just split the cable from the Connect to the Amp in two and put one end into an Arudino or something and the other into the Amp. That however seems (?) to lead to quality loss and figuring out how to prevent that with resistors and whatever turned out to be too complicated.

b) There’s a guide on instructables ( where someone solved that by connecting an Arduino to the Sonos’ Ethernet Port. It seems you can read the Sonos’ status through UPnP and there’s a Github library, but that hasn’t been updated for two years. The HA approach seemed much safer with no soldering.

1 Like