[{"id":"1f8556f4.45be19","type":"trigger","z":"e6ae5fc7.bdd91","op1":"","op2":"No comms for 30 minutes","op1type":"nul","op2type":"str","duration":"30","extend":true,"units":"min","reset":"","name":"","x":280,"y":100,"wires":[["c64818f5.197178","153e716d.56473f","976afb91.a60e48"]]},{"id":"c64818f5.197178","type":"throttle","z":"e6ae5fc7.bdd91","name":"","throttleType":"reset","timeLimit":0,"timeLimitType":"seconds","countLimit":0,"locked":true,"x":780,"y":100,"wires":[["4af5515.30763b"]]},{"id":"24cac15f.185f4e","type":"change","z":"e6ae5fc7.bdd91","name":"clear","rules":[{"t":"set","p":"reset","pt":"msg","to":"false","tot":"bool"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":80,"wires":[["c64818f5.197178"]]},{"id":"153e716d.56473f","type":"change","z":"e6ae5fc7.bdd91","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"I'm talking again","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":120,"wires":[["c64818f5.197178"]]},{"id":"976afb91.a60e48","type":"delay","z":"e6ae5fc7.bdd91","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":80,"wires":[["24cac15f.185f4e"]]}]
[{"id":"20bae410.fa05ac","type":"inject","z":"7321d8f7.a6e0b8","name":"input","topic":"","payload":"13","payloadType":"str","repeat":"","crontab":"","once":false,"x":630,"y":140,"wires":[["90bb46b6.21e7b8","a1a0217d.fc6a1","543b4f92.eb909"]]},{"id":"90bb46b6.21e7b8","type":"trigger","z":"7321d8f7.a6e0b8","op1":"","op2":"Comms Out","op1type":"nul","op2type":"str","duration":"20","extend":true,"units":"s","reset":"","name":"20 S trigger","x":830,"y":160,"wires":[["3b6de6d6.e6ce6a","ef3b73e4.7b2d3"]]},{"id":"a1a0217d.fc6a1","type":"throttle","z":"7321d8f7.a6e0b8","name":"","throttleType":"reset","timeLimit":0,"timeLimitType":"seconds","countLimit":0,"locked":true,"x":1160,"y":140,"wires":[["8db3701d.20b41"]]},{"id":"8db3701d.20b41","type":"debug","z":"7321d8f7.a6e0b8","name":"","active":true,"console":"false","complete":"false","x":1350,"y":140,"wires":[]},{"id":"4033c1e3.74c82","type":"change","z":"7321d8f7.a6e0b8","name":"clear","rules":[{"t":"set","p":"reset","pt":"msg","to":"false","tot":"bool"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":120,"wires":[["a1a0217d.fc6a1"]]},{"id":"ef3b73e4.7b2d3","type":"change","z":"7321d8f7.a6e0b8","name":"reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"payload","pt":"msg","to":"I'm talking again","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":160,"wires":[["a1a0217d.fc6a1"]]},{"id":"543b4f92.eb909","type":"delay","z":"7321d8f7.a6e0b8","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":120,"wires":[["4033c1e3.74c82"]]}]
Sensor Reading -> Sensor data to MQTT
-> "Online" msg to another MQTT topic with LWT that issues an "Offline" msg if not updated every 1min
[{"id":"89712f6d.73932","type":"inject","z":"24dc18bd.1a2ff8","name":"input","topic":"","payload":"13","payloadType":"str","repeat":"","crontab":"","once":false,"x":150,"y":240,"wires":[["ae434266.cd3fb","a4405907.b30458","aadff81e.458958"]]},{"id":"ae434266.cd3fb","type":"trigger","z":"24dc18bd.1a2ff8","op1":"","op2":"Sensor not communicating for 30 mins","op1type":"nul","op2type":"str","duration":"20","extend":true,"units":"s","reset":"","name":"20s trigger","x":330,"y":280,"wires":[["acb46072.8787c","bd87d73e.f8f068"]]},{"id":"ca5f3b0.1e8f6c8","type":"throttle","z":"24dc18bd.1a2ff8","name":"door","throttleType":"reset","timeLimit":0,"timeLimitType":"seconds","countLimit":0,"locked":true,"x":630,"y":240,"wires":[["bd87d73e.f8f068"]]},{"id":"bd87d73e.f8f068","type":"debug","z":"24dc18bd.1a2ff8","name":"","active":true,"console":"false","complete":"false","x":790,"y":280,"wires":[]},{"id":"16b79b33.e93855","type":"change","z":"24dc18bd.1a2ff8","name":"close","rules":[{"t":"set","p":"reset","pt":"msg","to":"false","tot":"bool"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":220,"wires":[["ca5f3b0.1e8f6c8"]]},{"id":"acb46072.8787c","type":"change","z":"24dc18bd.1a2ff8","name":"open","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":260,"wires":[["ca5f3b0.1e8f6c8"]]},{"id":"aadff81e.458958","type":"delay","z":"24dc18bd.1a2ff8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":340,"y":200,"wires":[["16b79b33.e93855"]]},{"id":"a4405907.b30458","type":"change","z":"24dc18bd.1a2ff8","name":"Comms Up","rules":[{"t":"set","p":"payload","pt":"msg","to":"Comms are back up!","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":240,"wires":[["ca5f3b0.1e8f6c8"]]}]