Thanks for the documentation link. I can see how the JSON works but think I need a practical example of what it looks like when placed inside a Node Red function node. I just need an example of how the JSON string payload is formatted and fits INside a Node Red function block. Just a single channel nominal temp deg c message ready to send to an MQTT Out Node.
I can manually make fixed numeric things things happen by inserting the numbers in one place and the txt for the payload (units, type, channel) in several ways now. I am missing the complete JSON and msg handling code, format and correct syntax. I need to see how a Variable number ( the value in my case is PID processed sensor data) is bought into the function node and then inserted into the JSON other bits of string and then sent out ready for the the MQTT Out node.
This will really help ‘join the dots’ on what I think is one of the most powerful features of Cayenne… the Auto Add + Widget setup functionality. (Green ‘+’ ) etc.
Here is a kind of commented sand box screen grab of what I am trying to do / figure out.
I am after the code that would go inside the middle function node to make it happen
Hope this helps.
Thanks