I run Tellstick Duos, and sometimes they give crazy values on my Oregon THGR222 sensors. So I have been experimenting for a few hours now without understanding the filter node. I'm experimenting with only two sensors, so I can see that it works before I try with more. In I have the ID in the topic, like Tellstick-Z-Wave-Tellstick/12/humidity/state
, with the payload array, where payload[0].temperature
is what I'm interested in. First I use an exec node to make the ID's (10 & 12) into the topic of the message and the temperature into the only payload, as a number. Then I send that into the Filter node, set to filter out anything that's more than 10 percent different from the previous node. The weird thing is that it works for one node, but not for the other. 12 has a weird value every ten minutes or so, and that is filtered. But not 10. I have set it to "Apply mode separately for each topic".
Another thing is if I restart NR and it gets the outlier value first. I have no idea how to recover from that. I know that the correct values are at least five times as often as the wrong value. But I can't use the outlier node, since I can't make one flow for each sensor. Suggestions would be appreciated. Here's the part of the flow that is relevant:
[
{
"id": "0e9896deee4b0f81",
"type": "switch",
"z": "b61f4f80.052e5",
"name": "Pass on sensor 10 & 12",
"property": "topic",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "12",
"vt": "str"
},
{
"t": "cont",
"v": "10",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 530,
"y": 240,
"wires": [
[
"b8b69540deb8c1ae"
],
[
"b8b69540deb8c1ae"
],
[]
]
},
{
"id": "b8b69540deb8c1ae",
"type": "function",
"z": "b61f4f80.052e5",
"name": "Temp to payload",
"func": "var id = msg.topic.split('/')[1];\nvar tmp = msg.payload[0].temperature;\nmsg.topic = id;\nmsg.payload = Number(tmp);\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 220,
"y": 320,
"wires": [
[
"d3723f5d70cd0a9c",
"ed99bdd73a146ccb"
]
]
},
{
"id": "d3723f5d70cd0a9c",
"type": "debug",
"z": "b61f4f80.052e5",
"name": "Before filter node",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 490,
"y": 320,
"wires": []
},
{
"id": "ed99bdd73a146ccb",
"type": "rbe",
"z": "b61f4f80.052e5",
"name": "Remove outliers",
"func": "narrowband",
"gap": "10",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 480,
"y": 360,
"wires": [
[
"51cdc257669c334b"
]
]
},
{
"id": "51cdc257669c334b",
"type": "debug",
"z": "b61f4f80.052e5",
"name": "After filter node",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 700,
"y": 360,
"wires": []
}
]