-
Notifications
You must be signed in to change notification settings - Fork 18
Garage Door Monitor
Northern Man edited this page Aug 22, 2019
·
2 revisions
I got tired of the kids and family leaving the garage door open, and not knowing that it was left open so I created this flow, to toggle a contact sensor every minute after the door had been left open for 30 minutes. This combines my node with HomeKit-bridged to create the flow.
[{"id":"6055bb99.2149a4","type":"hb-event","z":"23cc6bbf.d2bb64","name":"Garage Door","Homebridge":"Leonard-Amazon","Manufacturer":"WSSENSOR","Service":"Garage Door Opener","device":"Leonard-AmazonAC:22:3D:E3:CE:31WSSENSORGarage Door00000041","conf":"b87b79b0.81ad7","x":110,"y":200,"wires":[["8ddfb0df.96c1d8"]]},{"id":"c324cc0b.443938","type":"debug","z":"23cc6bbf.d2bb64","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","x":630,"y":300,"wires":[]},{"id":"a5a7619.aac08a","type":"homekit-service","z":"23cc6bbf.d2bb64","isParent":true,"bridge":"15040030.2e772","parentService":"","name":"Garage Open","serviceName":"ContactSensor","topic":"","filter":false,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","characteristicProperties":"{}","x":640,"y":360,"wires":[[]]},{"id":"57b7936d.8316d4","type":"trigger","z":"23cc6bbf.d2bb64","op1":"{\"ContactSensorState\": 1}","op2":"{\"ContactSensorState\": 1}","op1type":"json","op2type":"json","duration":"-2","extend":false,"units":"min","reset":"","bytopic":"all","name":"Resend","x":120,"y":360,"wires":[["a5a7619.aac08a","ea27ad1e.7740a8","c324cc0b.443938"]]},{"id":"ea27ad1e.7740a8","type":"trigger","z":"23cc6bbf.d2bb64","op1":"","op2":"{\"ContactSensorState\": 0}","op1type":"nul","op2type":"json","duration":"1","extend":true,"units":"min","reset":"","bytopic":"all","name":"Off","x":370,"y":320,"wires":[["a5a7619.aac08a","c324cc0b.443938"]]},{"id":"8ddfb0df.96c1d8","type":"function","z":"23cc6bbf.d2bb64","name":"Format and Route","func":"if ( msg.payload.CurrentDoorState === 0 ) {\n msg.payload.ContactSensorState = 1;\n return [msg, null];\n} else { \n msg.reset=\"1\";\n return [null, msg];\n}\n","outputs":2,"noerr":0,"x":350,"y":200,"wires":[["e1f1bf5f.d47098"],["e1f1bf5f.d47098","57b7936d.8316d4"]]},{"id":"e1f1bf5f.d47098","type":"trigger","z":"23cc6bbf.d2bb64","op1":"","op2":"{\"ContactSensorState\": 1}","op1type":"nul","op2type":"json","duration":"30","extend":false,"units":"min","reset":"","bytopic":"all","name":"How Long Open","x":620,"y":200,"wires":[["57b7936d.8316d4"]]},{"id":"b87b79b0.81ad7","type":"hb-conf","z":"","username":"031-45-154"},{"id":"15040030.2e772","type":"homekit-bridge","z":"","bridgeName":"Leonard-NodeRed","pinCode":"031-45-154","port":"51831","allowInsecureRequest":true,"manufacturer":"Default Manufacturer","model":"Default Model","serialNo":"Default Serial Number","customMdnsConfig":false,"mdnsMulticast":true,"mdnsInterface":"","mdnsPort":"","mdnsIp":"","mdnsTtl":"","mdnsLoopback":true,"mdnsReuseAddr":true}]