Noob looking for help...
I have a JSON stream of data which looks like this..
{
"header" : {
"content" : "telegram",
"gateway" : "EN-GW",
"timestamp" : "2016-08-08T13:45:47.032+0100"
},
"telegram" : {
"deviceId" : "01864892",
"friendlyId" : "Boardroom-CO2-Sensor",
"timestamp" : "2016-08-08T13:45:47.032+0100",
"direction" : "from",
"functions" : [ {
"key" : "humidity",
"value" : 39.00,
"unit" : "%"
}, {
"key" : "concentration",
"value" : 830.00,
"unit" : "ppm"
} ],
"telegramInfo" : {
"data" : "4E53820E",
"status" : "0",
"dbm" : -67,
"rorg" : "A5"
}
}
}
From this in Node-RED i have a function node which looks like this...
return [msg.payload.telegram.functions];
Which returns these
{ "key": "concentration", "value": 830, "unit": "ppm", "_msgid": "ff5b0f47.00a4f" }
{ "key": "humidity", "value": 39, "unit": "%", "_msgid": "ff5b0f47.00a4f" }
{ "key": "temperature", "value": 26.6, "unit": "°C", "_msgid": "ef2d6de7.10d29" }
From these i would like to get a single value from each e.g. 830 for concentration. Then have it check against thresholds set by me in a node with two outputs. For example if more than 1000 output 1, less than 1000 output 2.
Is what i'm trying to achieve even possible in Node-RED??
Sorry for the possible NOOB question any help would be appreciated.