Anyone using Node-Red, and is roon-nod-red crashing for you?

All my automations are built in node-red, and I’d like to find a way toi access trhe Roon API from that environment (simple play / paused zone).

I downloaded the jac459/roon-node-red api wrapper that looked like it might be what I needed, but this crashes node-red every time I deploy anything. (NR v2.1.4)

Anyone know of a way to stabilise this, or an alternative means of issuing commands to Roon? Can the API be accessed over http, for example?

The only official api is the node one.

I maintain a Python api that calls the undocumented layer that is used by the node code. You can find it here GitHub - pavoni/pyroon: python library to interface with the Roon API

@Ronald_Record has a command line interface that uses the python api which is here

Don’t know how easy these are to use from node red.

1 Like

Thanks for the quick response.

I’ll look into both of those, your own library might do the trick, though I’d need to find somewhere to host it. Have you ever considered creating a docker for it?

It’s just a library at this point (not a server / process) so not sure a docker container would work.

In any case I’m afraid I have no docker knowledge.

It may be overkill - but you could run a Home Assistant instance. I believe it has very good Node Red integration - and I maintain the roon integration. They do have docker containers! https://www.home-assistant.io/

Indeed, but I’ve never really got on with HomeAssistant, despite trying a few times, and there’s nothing (so far) that I haven’t been able to do in in Node Red, so not keen to be adding bloat to my set-up.

@Meep2020 I have not used Node-Red so I can only speculate but it appears one can execute system commands using the exec node with Node-Red. If so then perhaps a Node-Red flow could be constructed using the exec node to execute a RoonCommandLine command. All of the commands in my RoonCommandLine package are just wrappers for the Python Roon API. A Node-Red flow could execute the roon command directly with the exec node or access the Python Roon API via alternate methods, circumventing the need for RoonCommandLine. There is also an HTTP API for Roon.

My limited knowledge of Node-Red prohibits me from being of much assistance but I am curious to learn more and perhaps implement something of my own that demonstrates the integration of RoonCommandLine in a Node-Red flow. Please keep us informed of your progress.

Here’s a video on how to use the exec node in Node-Red to execute a system command.

Thanks @Ronald_Record

The challenge is that my Node-Red runs in a separate docker to my Roon, so command line access from one to the other would require ssh access etc. as they are esentially different systems.

I will report back for sure if and when I find a workable solution.

@Meep2020 The RoonCommandLine and Roon Python API don’t require SSH to communicate with the Roon Core. In my setup here I am have RoonCommandLine installed on several systems, none of which use SSH to the Roon Core which is a separate NUC on my local network. I believe the Roon Python API, with or without RoonCommandLine, would function properly when installed on a different system than the Roon Core as long as they are both on the same local area network. I defer to @GregD for issues regarding the Python Roon API but I am not aware of any need for SSH between it and the Roon Core.

If SSH is required, it is supported in RoonCommandLine so the roon command can reside on one system while the Python Roon API is on another system and the Roon Core on another system. And there is an SSH addon for Node-Red (i think). But, I do not believe you need SSH for Python Roon API integration with Node-Red to access and issue commands to a Roon Core. Greg may correct me.

Quite right - no need for any SSH, the roon API is socket based, security is just through the roon extension token.

OK, good news @Ronald_Record and @GregD

Hopefully I can find some time at the weekend to have a play around.

The way I am doing it is with the MQTT extension for Roon. Then you can simply listen to the MQTT messages to see what is being played, and send MQTT messages to pause, play, next etc. Very easy in node red. I notice that there is a node red node called roon-core which is installable, but I haven’t used that at all.