Roon Extension: Publish to MQTT broker


(Floris Jan) #1

Today I created my first Roon extension with NodeJS. Also my first NodeJS experience BTW :slight_smile:.

The extension pushes all zone information from the RoonApiTransport subscription to the MQTT broker. That way you can use all the status information in Domotica systems like OpenHAB.

I published the extension on my github account: https://github.com/fjgalesloot/roon-extension-mqtt so you can have a go with it.

The next step is to listen to incoming MQTT methods to allow zone/output player controls.

Screenshots

Extension settings page:

As you can see, you can set the Hostname or IP address of the MQTT broker in the extension setting page. Also the status of the MQTT broker connection is displayed.

I think it all works, but you could encounter issues :wink: as this is version 0.1. I would like to know what you think.


Roon Extension Manager v0.10.0
(Jan Koudijs) #2

I like the idea of providing a systemd service to start the extension.


#3

Just to understand what this is;
Could it be used to publish something like now playing to your FB account?

Or how is it intended to be used ?


(Rene Bouwmeester) #4

Iā€™d imagine future releases will have some kind of mechanism for sharing / storing / activating extensions from within Roon ā€“ but for now a systemd service and dumping the output straight to /dev/null works fine.


(Floris Jan) #5

You can use it with anything supporting receiving/interpreting MQTT messages.Personally I use it with OpenHAB, but I can imagine lots of other domotica systems able to connect to a MQTT broker to receive (and send) messages.

For example, my OpenHAB system now knows if and what is playing in the different zones I configured. I can setup automation rules to do things in certain conditions. For example, let OpenHAB turn off my power amps (with a smart swtich) when the zone in my living room is stopped.


(Floris Jan) #6

Yesterday I tried to connect my domoticz home automation system (I used OpenHAB before) to Roon with the extension. For this to work I needed to use Node-RED to connect it to the right topics available. While debugging I noticed the extension was publishing all topics for a zone when this zone was updated. While playing, the zone gets updated all the time with the new position in the track, so that means a lot of unneeded messages on the MQTT broker.
I changed the code so it only sends the changed topics to the MQTT broker. So, when only the position changes, only the MQTT topic for the position gets an update. This works much better in event-driven systems.


(Jason Engman) #7

Just wanted to say thanks for this extension, works great. I disabled some of the online publishing cause it seemed to get really wordy.


(Floris Jan) #8

Great to know the code is actually useful for people other than myself. So thanks for sharing!


#9

Thanks for creating this extension! I am new to Roon, new to MQTT, new to NodeRed, and new to Home Assistant, but will be giving this a shot and putting those puzzle pieces together!!