Before you read any further: Sorry. This is not entirely thought through on how to describe it.
But I am trying to get my head around how to do this little thing:
Machine comes online. Tick. Got that. Done with PING every x seconds.
NR loads up and becomes active. Tick. Got that. But it may take a while.
Prior to all that the PING is dead, and the other signal from NR is (obviously) dead.
Here's the "problem":
Say I give it 2 minutes to get all sorted and NR up and running. (Way enough time)
If - in the 2 minutes from when the machine initially started to respond to PING - nothing is heard beyond that, a notification/event happens.
But if NR does get itself up, the notification is not done.
So the PING and the other timed reading from NR are getting through.
NR will then continue to notify me at regular intervals.
I am thinking the TRIGGER node, but I am still not exactly sure on how to (a) word it, and (b) make it a flow.
Any offers?
Thanks in advance.
And again sorry I haven't thought it through too much.
Here is a NEARLY GOT IT flow. No UI widgets.
It NEARLY works.
[{"id":"7ebbba69.89153c","type":"inject","z":"9fb43887.43d798","name":"Online","topic":"","payload":"On-line","payloadType":"str","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":110,"wires":[["a3c9d966.1feed"]]},{"id":"a76ef8cf.bd10b","type":"random","z":"9fb43887.43d798","name":"Temp","low":"1","high":"10","inte":"true","property":"payload","x":330,"y":430,"wires":[["b3a8c499.e0c9b8","94413e96.e3aed","223e59a5.7285ae","25eba889.3b45c8"]]},{"id":"5c06244f.ed94dc","type":"trigger","z":"9fb43887.43d798","op1":"","op2":"Off-line","op1type":"nul","op2type":"str","duration":"8","extend":true,"units":"s","reset":"","bytopic":"all","name":"","x":240,"y":270,"wires":[["2dcbcc96.39b53c"]]},{"id":"a3c9d966.1feed","type":"traffic","z":"9fb43887.43d798","name":"","property_allow":"payload","filter_allow":"go","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"stop","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":120,"y":320,"wires":[["5c06244f.ed94dc","2dcbcc96.39b53c","9c86ceff.64f18"]]},{"id":"5f54b55d.0f23d4","type":"inject","z":"9fb43887.43d798","name":"","topic":"","payload":"go","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":230,"wires":[["a3c9d966.1feed"]]},{"id":"a5999ef4.be1f8","type":"inject","z":"9fb43887.43d798","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":190,"wires":[["a3c9d966.1feed"]]},{"id":"223e59a5.7285ae","type":"function","z":"9fb43887.43d798","name":"Status","func":"var x = context.get('x') || 0;\n//node.warn(x);\n\nif (msg.payload == \"Off-line\")\n{\n //\n msg = {payload: '<i class=\"fa fa-bullseye fa-2x nr-dashboard-error\"></i>'};\n node.status({fill:\"red\",shape:\"dot\",text:\"Off-line\"});\n context.set('x',0);\n var msg2 = {payload: \"Off-line\", background:\"brown\" };\n return [msg,msg2];\n}\nif (x == 0)\n{\n if (msg.payload == \"On-line\")\n {\n msg = {payload: '<font color = \"yellow\" i class=\"fa fa-bullseye fa-2x\"></i>'};\n node.status({fill:\"yellow\",shape:\"dot\",text:\"Ping-line\"});\n //node.warn(\"Ping ok\");\n var msg2 = {payload: \"On-line\", background:\"yellow\" };\n context.set('x',1);\n return [msg,msg2];\n }\n}\nif (x == 1)\n{\n if (msg.payload > 0)\n {\n msg = {payload: '<i class=\"fa fa-bullseye fa-2x nr-dashboard-ok\"></i>'};\n node.status({fill:\"green\",shape:\"dot\",text:\"Temperature\"});\n //node.warn(\"Temperature packet received\");\n var msg2 = {payload: \"On-line\", background:\"green\" };\n context.set('x',1);\n return [msg,msg2];\n }\n}\n","outputs":2,"noerr":0,"x":1000,"y":300,"wires":[["8386e3e6.7a8c7","f8b9db62.0e56a"],[]]},{"id":"b3a8c499.e0c9b8","type":"function","z":"9fb43887.43d798","name":"MusicPi temp","func":"// WORKING!\n// 2018 08 11\nvar count = context.get('count') || 0;\nvar mtopic = msg.topic;\nvar mpayload = msg.payload;\nvar device = 'MusicPi'; /////// NAME OF COMPUTER HERE!\nvar save_this_message = \"TEMP/\"+device\nvar save_this_message = \"TEMP/\"+device\nif (msg.topic == 'RESET')\n{\n //node.warn(device + \" RESET message RX\");\n msg.payload = 'Off-line';\n count = 1;\n context.set('count',count);\n msg.payload = 'N/C';\n var msg2 = { payload:\"0\"};\n return [msg, msg2]; \n}\nif (mtopic == save_this_message)\n{\n //node.warn(device + \" Temperature received\");\n context.set('message',msg.payload); // save the payload as this is the temperature.\n node.status({fill:\"yellow\",shape:\"dot\",text:\"message received\"});\n}\n\nif (mpayload === 'On-line')\n{\n msg.topic = device;\n node.status({fill:\"green\",shape:\"dot\",text:\"On-line\"});\n //node.warm(\"On-line message received\");\n context.set('count',0);\n msg.payload = context.get('message'); // get stored value back.\n return [msg, msg];\n}\nelse\nif (mpayload === 'Off-line')\n{\n //node.warn(device + \" Is Off-line\");\n msg.topic = device;\n count = count + 1;\n context.set('count',count);\n msg.topic = count;\n\n if (count === 1)\n {\n node.status({fill:\"blue\",shape:\"dot\",text:\"Off-line\"});\n var msg2 = { payload:\"0\", topic: device};\n \tmsg.payload = \"0\";\n \treturn [msg, msg2];\n }\n if (count === 2)\n {\n node.status({fill:\"red\",shape:\"dot\",text:\"Off-line\"});\n msg.payload = [];\n var msg2 = { payload:\"N/C\" };\n return [msg2, msg];\n }\n// else\n// {\n \t//msg.payload = null;\n //return msg;\n// }\n}\n","outputs":2,"noerr":0,"x":1030,"y":210,"wires":[[],[]]},{"id":"91a61852.eccf48","type":"change","z":"9fb43887.43d798","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"TEMP/MusicPi","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":390,"wires":[["a76ef8cf.bd10b"]]},{"id":"8386e3e6.7a8c7","type":"debug","z":"9fb43887.43d798","name":"Status","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1150,"y":270,"wires":[]},{"id":"51c2fee4.7bedd","type":"debug","z":"9fb43887.43d798","name":"Pings","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":460,"y":280,"wires":[]},{"id":"94413e96.e3aed","type":"debug","z":"9fb43887.43d798","name":"Temp","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":450,"y":480,"wires":[]},{"id":"2dcbcc96.39b53c","type":"function","z":"9fb43887.43d798","name":"Dummy","func":"\nreturn msg;","outputs":1,"noerr":0,"x":340,"y":320,"wires":[["b3a8c499.e0c9b8","51c2fee4.7bedd","223e59a5.7285ae","25eba889.3b45c8"]]},{"id":"25eba889.3b45c8","type":"traffic","z":"9fb43887.43d798","name":"","property_allow":"payload","filter_allow":"On-line","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"Off-line","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":820,"y":400,"wires":[["cbd9a7c.4599d58"]]},{"id":"cbd9a7c.4599d58","type":"trigger","z":"9fb43887.43d798","op1":"","op2":"Error","op1type":"nul","op2type":"str","duration":"12","extend":true,"units":"s","reset":"","bytopic":"all","name":"Wait for life","x":990,"y":400,"wires":[["3101ee4f.8d83ca"]]},{"id":"9c86ceff.64f18","type":"traffic","z":"9fb43887.43d798","name":"","property_allow":"payload","filter_allow":"go","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"stop","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":false,"differ":false,"x":120,"y":390,"wires":[["91a61852.eccf48"]]},{"id":"4d458781.fb6b9","type":"inject","z":"9fb43887.43d798","name":"","topic":"","payload":"go","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":520,"wires":[["9c86ceff.64f18"]]},{"id":"2e530069.a339c8","type":"inject","z":"9fb43887.43d798","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":480,"wires":[["9c86ceff.64f18"]]},{"id":"3101ee4f.8d83ca","type":"debug","z":"9fb43887.43d798","name":"Death","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1130,"y":400,"wires":[]},{"id":"bf20c62d.d43e4","type":"comment","z":"9fb43887.43d798","name":"Remote device control","info":"","x":130,"y":150,"wires":[]},{"id":"d07edf33.4f0e7","type":"comment","z":"9fb43887.43d798","name":"Machine failure simulation","info":"","x":150,"y":560,"wires":[]},{"id":"fc71aab3.6f2c58","type":"comment","z":"9fb43887.43d798","name":"Working part","info":"","x":1030,"y":160,"wires":[]},{"id":"b190814c.41559","type":"comment","z":"9fb43887.43d798","name":"To Guages and Charts","info":"","x":1230,"y":210,"wires":[]},{"id":"2e7c574.024f128","type":"comment","z":"9fb43887.43d798","name":"Nearly got it here","info":"","x":880,"y":360,"wires":[]}]
It nearly works.
How to use it:
Press the LOWER GO BUTTON FIRST!
Then press the Go button up the top (remote device control)
You will see the STATUS go from RED, to YELLOW then to LIME.
That is good.
Press the upper STOP button and wait about 10 seconds to allow things to clear.
Then press the lower STOP button (machine failure simulation)
Then press the upper GO button.
Alas nothing happens and this is where I am stuck.
I am wanting the DEATH node to become active if you have pressed the lower STOP button before pressing the upper GO button.
Is that helpful?