Execute a script when roon bridge starts/stops playing

I’m new to the world of roon and have just purchased a couple of Raspberry Pis to use as endpoints. I’ve got them up and running on raspberry pi os using roon bridge and they work nicely. My only problem is that my amp does not have a power switch. Previously I used an apple airport express and I was able to automatically turn my amp on and off with the music by using a Meross smart plug and Homebridge.

I’m also running shairport-sync on the raspberry pi’s for use with Airplay 2 which works quite well. I’m able to run a script with shairport-sync every time the music is played that sends a curl command to turn the amp on and off.

Is there any simple way of doing this with roon?
After a lot of digging the only method I can seem to find is to run roon-extension-mqtt, a mqtt broker and node-red. This method seems like overkill and quite resource intensive for something that should be quite simple. I’m using alsa for audio and I can’t seem to find any way to monitor alsa for audio output (I know this is doable with pulseaudio).

Any input on how to run a simple script when a certain endpoint/bridge is started and another one when it is stopped would be GREATLY appreciated.

What amp are you using?

Not sure it’s that much simper than roon-extension-mqtt / mqtt broker / node-red, But if you want it all encapsulated under one interface and have a spare RPi lying around, then as long as your amp is supported by Home Assistant then you could use the Roon HA integration to listen for stop/start events and setup an automation to trigger your amp to power on and off.

I guess the simplest solution would be to periodically poll Roon to see if it’s still playing something on a particular zone and then send whatever command you need to your amp to turn it on/off. But you’d need to code that yourself.

There are also several extensions for controlling amps and AVR’s in the Roon Extension manager, see the list at the bottom of this page to see if your amp is included.

1 Like