Issuing Flex Radio API Commands from Streamdeck and Node Red
Use Case
As a Flex Radio user I want to issue Flex Radio API commands from my Streamdeck console. I also want the same functions available on the Node Red console.
Solution Overview
I am doing direct API calls to the Flex Radio from Node Red. Pressing the Streamdeck buttons initiates the NodeRed fucntion. We look at some simple examples below.
In Node Red, node-red-contrib-streamdeck-ws needs to be installed from the pallette and a web socket needs to be set up to 'listen' for the Streamdeck. The Node Red screenshot below:
The constituent functions in the above flow are set up as follows:
Web Socket - the Path name will be used when configuring Streamdeck.
Streamdeck Input Node
Check if Key has been pressed
Check the ID of the Streamdeck Key being pressed. This is important when setting up the Streamdeck button (see below).
The Link Out nodes in the above flow go to the relevant function per the key press. Lets look at some examples. In these examples I have three Streamdeck buttons (we'll come onto those later). One to listen to Slice A but mute Slice B, one to listen to Slice B but mute Slice A and one to listen to both slices. I found I had to put some delays in the work-flow, you can experiment with this.
The input nodes are dashboard buttons in Node-Red.
The Flex Radio Request Nodes just provide a means to connect to the Flex Radio.
Each of the functions contains the API command. An example is below:
Flex API command
The full set of Flex Radio API commands can be found here:
In Streamdeck, to initiate the function a Web Socket needs to be put in place. Note the IP address is where Node Red is running. The suffix on the URL MUST match the path name in the Node Red web socket node. Note the 'id' must be the same as in the NodeRed SWITCH node.
It is also possible to send messages from NodeRed back to Streamdeck, for example you may wish to change the colour of a button when it has been pressed. I found I could get this working but it introduced unacceptable delays to the workflow i.e. I pressed the button and then had to wait for it to change colour. Anyway, to send an image back to the Streamdeck button - info will be here soon.