2020 Dec 29, 02:56 AM
Oh, cool! Thanks for the /jp link!
I think node-red can make an http request any time and I'll see about parsing the JSON in there.
I should be able to do some parsing in node-red to make sense of the program data, once I learn how.
Since the simplest way for node-red to retrieve the program data is an HTTP request to SIP, it probably makes sense for SIP to make an HTTP connection to node-red when the program changes are submitted in SIP. This will be the trigger for node-red to request the new /jp doc.
The other option is to make a similar plugin to the get_values MQTT, which sends the new program JSON to node-red when there's an update.
I'm leaning to this MQTT option since I have plugins to copy. I'm not sure if adding a CURL HTTP request to the code is as elegant.
A couple small things to let you know:
- Line 77 of mqtt_get_values.py kills the plugin function, I think there's a deprecated gv property in there. Commenting it out, it works fine.
- I don't think the SIP restart is working for me. When I do certain things like update active plugins, the system says it's restarting, but I have to do my own kill and restart before the menu updates, for example. Python 2.7 on Raspbian in a VirtualBox VM.
I think node-red can make an http request any time and I'll see about parsing the JSON in there.
I should be able to do some parsing in node-red to make sense of the program data, once I learn how.
Since the simplest way for node-red to retrieve the program data is an HTTP request to SIP, it probably makes sense for SIP to make an HTTP connection to node-red when the program changes are submitted in SIP. This will be the trigger for node-red to request the new /jp doc.
The other option is to make a similar plugin to the get_values MQTT, which sends the new program JSON to node-red when there's an update.
I'm leaning to this MQTT option since I have plugins to copy. I'm not sure if adding a CURL HTTP request to the code is as elegant.
A couple small things to let you know:
- Line 77 of mqtt_get_values.py kills the plugin function, I think there's a deprecated gv property in there. Commenting it out, it works fine.
- I don't think the SIP restart is working for me. When I do certain things like update active plugins, the system says it's restarting, but I have to do my own kill and restart before the menu updates, for example. Python 2.7 on Raspbian in a VirtualBox VM.