Node Red(Edit)

More Interactions with APIs(Edit)

As we can call ptyhon scripts using the node-red-contrib-pythonshell module, let's save us some time.

Audio Station is one of the thing that can save time, assuming the hole Synology DSM is already in place. The exposed API, despite being documented, has revealed some tricks and already proves to be useful. A script has been published here, and allows for nodes to inject data, as well as reading it from output. In this situation, a node injects a msg.payload with a text string representing the JSON Object expected as input, such as:


A JSON Nodes parses the string to make it an object. The whole process can be replaced with a function node, forging the payload directly.

The message is then sent to the python script using the dedicated node. Payload transmitted as argument selected. Quick and efficient. The output of the same process can be gathered to be processed and display the title somewhere, etc:

msg.payload = "Title: " + msg.payload;
return msg;

Audio Station can be used as a DLNA server and client, which proves useful to deploy a connected amplifier such as a Raspberry Pi with dedicated DAC

Happy orchestration!