I have this incoming json data from sensors, most of the sensors provide values as double, but some of them provide as string, what would be the best way to split the payload based on condition if the value is string send it different node and if numeric send it to another node then process it down stream.
here is my sample message.
{
"tag": "Wind/7865",
"value": 24.82145623328888
},
{
"tag": "AC 3 Phase/7995",
"value": true
},
{
"tag": "AC 3 Phase/7847",
"value": "OFF"
},
{
"tag": "AC Generator/7849",
"value": "STARTING"
}
here the tags with value OFF and STARTING need to be processed a separate flow as I can't store that on a tsdb.
Assuming that the example you have posted is a section of an array, then I would do the following:
msg.payload.value
and the is of type
test to output the msg's with number
, string
or boolean
to 3 different outputs