Hi,
This flow does work and i can get the temperature [0], but in the debug node it shows ALL msg.payload messages, I just want the temperature [0] value to be in debug ?
I have tried variations of Switch node at the start of the flow with 'has key', but still i get all or nothing.
I prefer using gui nodes if possible, easier for me to understand
Thanks
Sent from Arduino to Node-RED
{
"Sensors": [
{
"id": "DS1820_Sensor_01",
"temperature": 24.25,
"humidity": 0,
"location": "PC room",
"information": "Humidity is dummy data"
},
{
"id": "DS1820_Sensor_02",
"temperature": 25,
"humidity": 0,
"location": "PC room"
}
]
}
My flow
[{"id":"d2663d6de10ed7c6","type":"group","z":"37097d1320355ac2","name":"Get part of data from an array","style":{"label":true,"fill":"#ffffbf","fill-opacity":"0.24"},"nodes":["87e6621391303f27","f87a2d4bfac63f54","939a0737a85ab770"],"x":794,"y":869,"w":502,"h":82},{"id":"87e6621391303f27","type":"link in","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"> JSON Data","links":["b770b07d30a4f9b0"],"x":835,"y":910,"wires":[["f87a2d4bfac63f54"]]},{"id":"f87a2d4bfac63f54","type":"change","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"Set only temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.Sensors[0].temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":910,"wires":[["939a0737a85ab770"]]},{"id":"939a0737a85ab770","type":"debug","z":"37097d1320355ac2","g":"d2663d6de10ed7c6","name":"debug 224","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":910,"wires":[]}]