Greetings all.
Still new to NR and having some trouble with something which is probably very basic. I have done the requisite search and study (hours not minutes) but to my shame, I can't seem to find the key.
The code below is intended to periodically ping an ip address and if the number of failed attempts rises above some number in some minutes time, trigger an output (power cycle router). The trouble is that the threshold node never produces an output. Debug node 1 gives me:
Blockquote
{"payload":false,"topic":"192.168.2.3","_msgid":"326f9f28.7032","checkValue":11}
Values configured in threshold less than checkValue (even 0) do not result in any output from threshold node appearing in debug node 2. Info for threshold node says:
Blockquote
...The node takes a single input. If that input value is higher than the threshold then the payload is delivered but only when the threshold is exceeded...
...add an attribute to that payload: payload.checkValue. The checkValue will be compared to the Threshold defined in the node editor each time a new payload arrives....
What am I not understanding?
Flow is below.
Hope you can help.
Q
[
{
"id": "dceb6fb1.f4efc",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "606bf72e.c70588",
"type": "switch",
"z": "dceb6fb1.f4efc",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "else"
},
{
"t": "false"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 310,
"y": 100,
"wires": [
[],
[
"88aed5ce.230858"
]
]
},
{
"id": "d060335f.b011a",
"type": "ping",
"z": "dceb6fb1.f4efc",
"name": "",
"host": "192.168.2.3",
"timer": "1",
"x": 130,
"y": 100,
"wires": [
[
"606bf72e.c70588"
]
]
},
{
"id": "be1b0a1c.6311a8",
"type": "debug",
"z": "dceb6fb1.f4efc",
"name": "1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 490,
"y": 220,
"wires": []
},
{
"id": "88aed5ce.230858",
"type": "timed-counter",
"z": "dceb6fb1.f4efc",
"name": "",
"timelimit": "10",
"timeunit": "1000",
"withhold": true,
"fixedtimeout": true,
"pertopic": false,
"x": 500,
"y": 100,
"wires": [
[
"f25dc855.8b1048"
]
]
},
{
"id": "f68c3980.7d6e18",
"type": "debug",
"z": "dceb6fb1.f4efc",
"name": "2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"x": 490,
"y": 340,
"wires": []
},
{
"id": "2e6f2aa1.6d8456",
"type": "threshold",
"z": "dceb6fb1.f4efc",
"name": "checkValue",
"thresholdValue": "2",
"x": 170,
"y": 340,
"wires": [
[
"f68c3980.7d6e18"
]
]
},
{
"id": "f25dc855.8b1048",
"type": "change",
"z": "dceb6fb1.f4efc",
"name": "",
"rules": [
{
"t": "move",
"p": "count",
"pt": "msg",
"to": "checkValue",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 180,
"y": 220,
"wires": [
[
"2e6f2aa1.6d8456",
"be1b0a1c.6311a8"
]
]
}
]