How do I pass the value of a payload to a variable in Node-Red?
I am trying to pass the value of a payload into a variable using a Node-Red function. I isolated one bite from the payload which will be either a 0 or a 1 by using the code “var newMsg = { payload: msg.payload.sensor_data.input_1 };” . I then passed the newMsg to a debut node as seen by the screen shot below:
Now I am trying to read value of the payload.
FYI, I am using an IoT Long Range Wireless Push Notification Dry Contact Transmitter. I have already wrote a Python script to evaluate the payload byte above which is byte 25, I am using this byte to communicate if the equipment is or is not in production. The other byte, byte 26, is used to calculate cycle times and indicate machine stoppage while in production.