@Colin
Thanks for the pointers... I eventually opted for this:
[
{
"id": "ac5b0135792eb85b",
"type": "inject",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "abc",
"payloadType": "str",
"x": 780,
"y": 4310,
"wires": [
[
"cecac7e7e0f1f28d"
]
]
},
{
"id": "cecac7e7e0f1f28d",
"type": "function",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "WhateverSensor",
"func": "msg.payload = {\"WhateverSensor\":msg.payload};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 790,
"y": 4270,
"wires": [
[
"eddfe5b443bda757"
]
]
},
{
"id": "77fdb2d2ea549fcd",
"type": "inject",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 780,
"y": 4230,
"wires": [
[
"cecac7e7e0f1f28d"
]
]
},
{
"id": "eddfe5b443bda757",
"type": "function",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "Filter NaN",
"func": "if ( isNaN(msg.payload[Object.keys(msg.payload)[0]]) ) {\n return [null, msg ];//is NaN - Send to 2nd Output\n} else {\n return [ msg, null];// not NaN - Send to 1st Output\n}",
"outputs": 2,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 960,
"y": 4270,
"wires": [
[
"974a2fa3b87ec1a4"
],
[
"b440126ed98a9843"
]
],
"outputLabels": [
"Valid",
"Invalid"
]
},
{
"id": "974a2fa3b87ec1a4",
"type": "debug",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1055,
"y": 4250,
"wires": [],
"l": false
},
{
"id": "b440126ed98a9843",
"type": "debug",
"z": "357c3c56.dcf1d4",
"g": "31f8eab0.d7a7be",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1055,
"y": 4290,
"wires": [],
"l": false
}
]
They originate from about 100+++ Sonoff switches, a couple of inverters and other misc kit... As they get replaced/upgraded/updated/changed/played with, the payloads (Objects) might change as needed... This is a final check and filter before the data gets packed away for graphical analyses... So, no... earlier is not really a requirement as, as such, it is a final check before filing...
Incidentally, the check for non NaN allows boolean through too... A little bonus I didn't expect, but suits my requirements fine!!
Sorry for hijacking the thread, but hopefully it is of use!!
Thanks again for the help and pointers, Colin!!
Cheerz
Ed