Hands free access for existing bell/buzzer and intercom systems. Using bluetooth, monitor.sh, and a modified home presense app in node red

I wanted to add hands free access my existing old school bell/buzzer system. I also wanted something that didn’t require additional apps or access to HA in general. Andrew J Frey’s monitor app only requires adding a users bluetooth mac. Access generally takes 7-8 seconds.

I mirrored Odianosen25 home presence app except the device tracker as this application is a little different. I am using 2 nodes, each ~50’/15m one beyond and one off to the side and above the entry point. The idea is to locate them where they overlap the access point but not each other.

Each node scans when motion is detected with a slight offset. This starts a challenge to check each node is at zero then waits to see if they both register 100% which will trigger lock release. I’ll break the flow into 4 parts Main Scan, Keep Alive Loops, Reboot Loops, and User Challenge.

Main Scan:

On the left are 2 inputs one is the entrance motion sensor the other an input_boolean to trigger a manual scan from HA’s front end. As set it allows one full arrive/depart every 2 minutes. This consists of 2 arrive, then 2 depart and finally another arrive scan. Each node has it’s own topic so that arrive/depart could be called independently.

Additionally there are traffic nodes that will pause/hold scans and loops as not to overlap. Reboot > arrive/depart > device states > echo. Adjustments may require manually recalculating several delay nodes, this is by design to be able fine tune the system.

Note on loop scan node, loop count entry is always +1. Ex. loop count = 1 will send 2, loop count = 2 will send 3 messages. It will also average them over the time set.

Keep Alive Loops (echo and known device states):

On the left are 2 injection nodes, every 45 seconds an echo call goes out and every 15 minutes a known device states call. There are your delay, traffic, and finally mqtt topics out.

Reboot Loops:

On the left are 2 nodes that listen for each node. There is also an input_boolean to trigger a manual full reboot from HA and a daily trigger set for 5am.

If a node isn’t heard from in 5 minutes it will send a reboot command and create a persistent notification that the node went offline. If it doesn’t hear from it for 15 min it will create another notification.

User Challenge:

Using the same scan trigger it checks a max/min sensor of the 2 nodes is zero, then waits for the individual nodes sensors to register at 100%. Then triggers a notification if the flow is completed with and on/off entity to shut off access from HA. Finally calling a service to release the door.

Prerequisites:

2 nodes running Andrew J Freyer’s monitor.sh. Follow all directions for setting up sensors inside HA. Set nodes to -tad.

The community version of ssh.

Open a terminal and set up ssh keys for nodes.
ssh key-gen
When it asks to enter a file name, enter: /config/ssh/id_rsa
At passphrase, just leave blank and hit enter 2x

Copy the key to node, still in terminal.
ssh-copy-id -i /config/ssh/id_rsa [email protected]
enter password
enter yes to proceed if you get a warning

Test by running
ssh -i /config/ssh/id_rsa [email protected] sudo shutdown -r
You should get a shutdown is scheduled response.

Repeat steps for the other node using /config/ssh/id_rsa2

Setup shell commands to call reboot in ha config.yaml

shell_command:
  restart_pi1: ssh -i /config/ssh/id_rsa [email protected] sudo shutdown -r
  restart_pi2: ssh -i /config/ssh/id_rsa2 [email protected] sudo shutdown -r

Then scripts to call shell_command since I can’t seem to find how to call them directly from nodered. Add to scripts.yaml alternatively you can use the ui:

reboot_pi1:
  alias: reboot pi 1
  sequence:
  - service: shell_command.restart_pi1
  mode: single
reboot_pi2:
  alias: reboot pi 2
  sequence:
  - service: shell_command.restart_pi2
  mode: single

Under helpers create 2 input_boolean/toggle one for the manual scan and one for manual reboot.

A way to release/open your lock from HA. I am using esphome with a relay wired to the same lines used buzz someone in on the legacy system.

Finally the nodered flow:

[{"id":"7d105d71.cc18e4","type":"tab","label":"Access/Bluetooth Presense","disabled":false,"info":""},{"id":"d8d0d9e5.5285e","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"monitor/scan/depart","qos":"0","retain":"true","broker":"601bef1.d5b981","x":1400,"y":420,"wires":[]},{"id":"9f34783f.06e968","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"120","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":480,"y":300,"wires":[["83ff1621.82c1a","83b50aa7.286558","120414d0.b0e873"]]},{"id":"83ff1621.82c1a","type":"change","z":"7d105d71.cc18e4","name":"none","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":300,"wires":[["b6f26d21.32ceb","8a3ef747.1d0ae","75dce590.a5811c"]]},{"id":"b6f26d21.32ceb","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":920,"y":420,"wires":[["bc415583.7d715"]]},{"id":"40acaa9d.72c654","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"monitor/scan/arrive","qos":"0","retain":"true","broker":"601bef1.d5b981","x":1410,"y":300,"wires":[]},{"id":"a5f63957.458d6","type":"server-state-changed","z":"7d105d71.cc18e4","name":"vestibule motion","server":"","version":1,"exposeToHomeAssistant":true,"haConfig":[{"property":"name","value":"vestibule"},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.vestibule_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":80,"y":300,"wires":[["bccbd872.e800f8"],[]]},{"id":"10ba164a.e01b02","type":"api-call-service","z":"7d105d71.cc18e4","name":"buzzer","server":"","version":1,"debugenabled":true,"service_domain":"switch","service":"turn_on","entityId":"switch.buzzer","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1410,"y":120,"wires":[[]]},{"id":"8a3ef747.1d0ae","type":"looptimer","z":"7d105d71.cc18e4","duration":"20","units":"Second","maxloops":"2","maxtimeout":"60","maxtimeoutunits":"Second","name":"scan loop timer","x":940,"y":360,"wires":[["6970ec48.46b3f4","40acaa9d.72c654"],[]]},{"id":"bc415583.7d715","type":"looptimer","z":"7d105d71.cc18e4","duration":"20","units":"Second","maxloops":"1","maxtimeout":"40","maxtimeoutunits":"Second","name":"scan loop timer","x":1080,"y":420,"wires":[["d8d0d9e5.5285e","a2ce60e6.7c6c7"],[]]},{"id":"299ca154.e1da76","type":"api-call-service","z":"7d105d71.cc18e4","name":"notify","server":"","version":1,"debugenabled":false,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"mike buzzer.\",\"title\":\"mike notification\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":100,"wires":[["a633704.3e7af9"]]},{"id":"61b420ac.b42f08","type":"inject","z":"7d105d71.cc18e4","name":"15 min device state loop","props":[{"p":"topic","vt":"str"}],"repeat":"900","crontab":"","once":false,"onceDelay":0.1,"topic":"1","x":110,"y":660,"wires":[["b3de9c79.3a649","399a943e.c8b3ec","99a31670.14efc8"]]},{"id":"2a336bd6.8b3a74","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"monitor/rpz/KNOWN DEVICE STATES","qos":"","retain":"","broker":"601bef1.d5b981","x":1350,"y":660,"wires":[]},{"id":"a09ac8ce.390aa8","type":"change","z":"7d105d71.cc18e4","name":"none","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":660,"wires":[["2a336bd6.8b3a74","b221f24b.8e3868"]]},{"id":"e19e2988.936868","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"blue/rpi/KNOWN DEVICE STATES","qos":"","retain":"","broker":"601bef1.d5b981","x":1360,"y":720,"wires":[]},{"id":"b221f24b.8e3868","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1140,"y":720,"wires":[["e19e2988.936868"]]},{"id":"a57e32b8.e75a5","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"blue/scan/arrive","qos":"0","retain":"true","broker":"601bef1.d5b981","x":1420,"y":360,"wires":[]},{"id":"3fdcf326.b3502c","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"blue/scan/depart","qos":"0","retain":"true","broker":"601bef1.d5b981","x":1420,"y":480,"wires":[]},{"id":"6970ec48.46b3f4","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"1500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1220,"y":360,"wires":[["a57e32b8.e75a5"]]},{"id":"a2ce60e6.7c6c7","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1240,"y":480,"wires":[["3fdcf326.b3502c"]]},{"id":"7860ad41.e1335c","type":"api-current-state","z":"7d105d71.cc18e4","name":"Is Michael conf 0?","server":"","version":1,"outputs":2,"halt_if":"0.0","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.michael_confidence","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":330,"y":100,"wires":[["d90277dc.9386c8"],[]]},{"id":"493508e0.d4d9e","type":"inject","z":"7d105d71.cc18e4","name":"45 sec echo loop","props":[{"p":"topic","vt":"str"}],"repeat":"45","crontab":"","once":true,"onceDelay":0.1,"topic":"1","x":90,"y":840,"wires":[["ec2059da.8eef"]]},{"id":"ccde2633.1b2fb","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"monitor/echo","qos":"","retain":"","broker":"601bef1.d5b981","x":1430,"y":780,"wires":[]},{"id":"119b3b67.f67655","type":"change","z":"7d105d71.cc18e4","name":"none","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":840,"wires":[["ccde2633.1b2fb","13bbba35.5bf4ae"]]},{"id":"f13a4ee9.4e872","type":"mqtt out","z":"7d105d71.cc18e4","name":"","topic":"blue/echo","qos":"","retain":"","broker":"601bef1.d5b981","x":1440,"y":840,"wires":[]},{"id":"13bbba35.5bf4ae","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1300,"y":840,"wires":[["f13a4ee9.4e872"]]},{"id":"b61f90cd.7666c","type":"traffic","z":"7d105d71.cc18e4","name":"pause/unpause","property_allow":"payload","filter_allow":"unpause","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"pause","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":760,"y":840,"wires":[["82e0395c.a0d528"]]},{"id":"b3de9c79.3a649","type":"change","z":"7d105d71.cc18e4","name":"pause echo loop","rules":[{"t":"set","p":"payload","pt":"msg","to":"pause","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":720,"wires":[["ec2059da.8eef"]]},{"id":"f35f8899.1128f8","type":"change","z":"7d105d71.cc18e4","name":"unpause echo loop","rules":[{"t":"set","p":"payload","pt":"msg","to":"unpause","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":780,"wires":[["ec2059da.8eef"]]},{"id":"399a943e.c8b3ec","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"45","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":120,"y":780,"wires":[["f35f8899.1128f8"]]},{"id":"18e9d6aa.e75629","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":660,"wires":[["a09ac8ce.390aa8"]]},{"id":"99a31670.14efc8","type":"traffic","z":"7d105d71.cc18e4","name":"pause/unpause","property_allow":"payload","filter_allow":"unpause","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"pause","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":440,"y":660,"wires":[["c2f49b2.155d4e8"]]},{"id":"120414d0.b0e873","type":"change","z":"7d105d71.cc18e4","name":"pause all loops","rules":[{"t":"set","p":"payload","pt":"msg","to":"pause","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":360,"wires":[["24901d9d.f66142"]]},{"id":"fa973cd2.7bf4a","type":"change","z":"7d105d71.cc18e4","name":"unpause all loops","rules":[{"t":"set","p":"payload","pt":"msg","to":"unpause","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":670,"y":420,"wires":[["59d4d107.da3b48"]]},{"id":"83b50aa7.286558","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"135","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":420,"wires":[["fa973cd2.7bf4a"]]},{"id":"24901d9d.f66142","type":"link out","z":"7d105d71.cc18e4","name":"pause loops","links":["c24cda0a.f6e18","d0668473.a1eaa8"],"x":795,"y":360,"wires":[]},{"id":"c24cda0a.f6e18","type":"link in","z":"7d105d71.cc18e4","name":"pause/unpause device state","links":["24901d9d.f66142","59d4d107.da3b48"],"x":315,"y":680,"wires":[["99a31670.14efc8"]]},{"id":"d0668473.a1eaa8","type":"link in","z":"7d105d71.cc18e4","name":"pause/unpause echo loop","links":["24901d9d.f66142","59d4d107.da3b48"],"x":635,"y":820,"wires":[["b61f90cd.7666c"]]},{"id":"59d4d107.da3b48","type":"link out","z":"7d105d71.cc18e4","name":"unpause loops","links":["d1520867.a4f4","ee39041d.938ea","d0668473.a1eaa8","c24cda0a.f6e18"],"x":795,"y":420,"wires":[]},{"id":"a633704.3e7af9","type":"ha-entity","z":"7d105d71.cc18e4","name":"Mike Hands Free","server":"","version":1,"debugenabled":false,"outputs":2,"entityType":"switch","config":[{"property":"name","value":"Mike Hands Free"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:toggle-switch-outline"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":1010,"y":80,"wires":[["e929ad72.1771c8"],[]]},{"id":"96de552c.40d52","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":250,"y":480,"wires":[["850e2ed2.ac9358"]]},{"id":"850e2ed2.ac9358","type":"api-call-service","z":"7d105d71.cc18e4","name":"Turn off manual scan","server":"","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.manual_scan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":480,"wires":[[]]},{"id":"75dce590.a5811c","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":930,"y":300,"wires":[["40acaa9d.72c654","6970ec48.46b3f4"]]},{"id":"139cd307.917e35","type":"server-state-changed","z":"7d105d71.cc18e4","name":"Manual scan","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.manual_scan","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":70,"y":480,"wires":[["96de552c.40d52","24e06059.d8b4e8"],[]]},{"id":"d90277dc.9386c8","type":"ha-wait-until","z":"7d105d71.cc18e4","name":"is rpi 100?","server":"","outputs":2,"entityId":"sensor.michael_conf","entityIdFilterType":"exact","property":"state","comparator":"is","value":"100","valueType":"str","timeout":"20","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":true,"x":510,"y":100,"wires":[["4d2c7ff9.5b31"],[]]},{"id":"4d2c7ff9.5b31","type":"ha-wait-until","z":"7d105d71.cc18e4","name":"is rpz 100?","server":"","outputs":2,"entityId":"sensor.michael_confz","entityIdFilterType":"exact","property":"state","comparator":"is","value":"100","valueType":"str","timeout":"20","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":true,"x":670,"y":100,"wires":[["299ca154.e1da76"],[]]},{"id":"e929ad72.1771c8","type":"looptimer","z":"7d105d71.cc18e4","duration":"5","units":"Second","maxloops":"1","maxtimeout":"60","maxtimeoutunits":"Second","name":"scan loop timer","x":1240,"y":120,"wires":[["10ba164a.e01b02"],[]]},{"id":"8f7a4106.9e0388","type":"api-call-service","z":"7d105d71.cc18e4","name":"reboot blue rpz","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":" script.reboot_14","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1180,"y":1320,"wires":[[]]},{"id":"b9d825e3.4cffd","type":"api-call-service","z":"7d105d71.cc18e4","name":"reboot monitor rpi","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"turn_on","entityId":" script.reboot_19","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1170,"y":1080,"wires":[[]]},{"id":"1f25a43.f23025c","type":"mqtt in","z":"7d105d71.cc18e4","name":"monitor/rpi/#","topic":"monitor/rpi/#","qos":"0","datatype":"auto","broker":"601bef1.d5b981","x":70,"y":1060,"wires":[["af9e8f77.30b918"]]},{"id":"67f6ab73.23ec44","type":"mqtt in","z":"7d105d71.cc18e4","name":"blue/rpz/#","topic":"blue/rpz/#","qos":"0","datatype":"auto","broker":"601bef1.d5b981","x":60,"y":1320,"wires":[["22c9bb76.2f603c"]]},{"id":"d26eaae1.f8f57","type":"trigger","z":"7d105d71.cc18e4","name":"is rpi online?","op1":"off","op2":"on","op1type":"str","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":570,"y":1060,"wires":[[],["b9d825e3.4cffd","7dad5d1d.34a454","671cebbf.deaa4c","28376ea6.27f032"]]},{"id":"15585a2b.f9d896","type":"trigger","z":"7d105d71.cc18e4","name":"is rpz online?","op1":"off","op2":"on","op1type":"str","op2type":"str","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":570,"y":1320,"wires":[[],["8f7a4106.9e0388","f81166c2.b665b8","28376ea6.27f032","671cebbf.deaa4c"]]},{"id":"f63db111.ad891","type":"link out","z":"7d105d71.cc18e4","name":"hold loops and scans","links":["4ed2b519.53813c","ba77562.c3b37a8","f157f08a.2e257"],"x":1015,"y":1160,"wires":[]},{"id":"9b92db9.da91628","type":"link out","z":"7d105d71.cc18e4","name":"release loops and scans","links":["4ed2b519.53813c","ba77562.c3b37a8","f157f08a.2e257"],"x":1195,"y":1220,"wires":[]},{"id":"4ed2b519.53813c","type":"link in","z":"7d105d71.cc18e4","name":"hold/release scan","links":["9b92db9.da91628","f63db111.ad891"],"x":115,"y":440,"wires":[["24e06059.d8b4e8"]]},{"id":"f81166c2.b665b8","type":"api-call-service","z":"7d105d71.cc18e4","name":"notify if rebooted","server":"","version":1,"debugenabled":true,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"rpz restarted\",\"title\":\"rpz restarted\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1180,"y":1380,"wires":[[]]},{"id":"7dad5d1d.34a454","type":"api-call-service","z":"7d105d71.cc18e4","name":"notify if rebooted","server":"","version":1,"debugenabled":true,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"rpi restarted\",\"title\":\"rpi restarted\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1180,"y":1000,"wires":[[]]},{"id":"3adbe5d7.f0468a","type":"server-state-changed","z":"7d105d71.cc18e4","name":"vestibule motion","server":"","version":1,"exposeToHomeAssistant":true,"haConfig":[{"property":"name","value":"vestibule"},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.vestibule_motion","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":80,"y":100,"wires":[["f52136b2.2cd0a8"],[]]},{"id":"f52136b2.2cd0a8","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"120","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":180,"y":180,"wires":[["7860ad41.e1335c"]]},{"id":"24e06059.d8b4e8","type":"traffic","z":"7d105d71.cc18e4","name":"hold/release","property_allow":"payload","filter_allow":"release","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"hold","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":310,"y":380,"wires":[["9f34783f.06e968"]]},{"id":"671cebbf.deaa4c","type":"change","z":"7d105d71.cc18e4","name":"hold loops and scans","rules":[{"t":"set","p":"payload","pt":"msg","to":"hold ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":1160,"wires":[["f63db111.ad891"]]},{"id":"accee6a9.34e838","type":"change","z":"7d105d71.cc18e4","name":"release loops and scans","rules":[{"t":"set","p":"payload","pt":"msg","to":"release","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1220,"wires":[["9b92db9.da91628"]]},{"id":"28376ea6.27f032","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"200","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":850,"y":1220,"wires":[["accee6a9.34e838"]]},{"id":"af9e8f77.30b918","type":"change","z":"7d105d71.cc18e4","name":"set to on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":1060,"wires":[["d26eaae1.f8f57","699d0908.7f1f8"]]},{"id":"22c9bb76.2f603c","type":"change","z":"7d105d71.cc18e4","name":"set to on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":1320,"wires":[["15585a2b.f9d896","2583819c.b0cf86"]]},{"id":"699d0908.7f1f8","type":"trigger","z":"7d105d71.cc18e4","name":"is rpi non-responsive?","op1":"off","op2":"on","op1type":"str","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":540,"y":1000,"wires":[[],["4f5e0137.917b5"]]},{"id":"4f5e0137.917b5","type":"api-call-service","z":"7d105d71.cc18e4","name":"notify if unresponsive","server":"","version":1,"debugenabled":true,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"rpi unresponsive\",\"title\":\"rpi unresponsive\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":800,"y":1000,"wires":[[]]},{"id":"2583819c.b0cf86","type":"trigger","z":"7d105d71.cc18e4","name":"is rpz non-responsive?","op1":"off","op2":"on","op1type":"str","op2type":"str","duration":"15","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":540,"y":1380,"wires":[[],["1bc74068.29f598"]]},{"id":"1bc74068.29f598","type":"api-call-service","z":"7d105d71.cc18e4","name":"notify if unresponsive","server":"","version":1,"debugenabled":true,"service_domain":"persistent_notification","service":"create","entityId":"","data":"{\"message\":\"rpi unresponsive\",\"title\":\"rpi unresponsive\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":800,"y":1380,"wires":[[]]},{"id":"f1fe7423.7a6b68","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":190,"y":1260,"wires":[["d82ef8d2.1dc32"]]},{"id":"d82ef8d2.1dc32","type":"api-call-service","z":"7d105d71.cc18e4","name":"Turn off manual reboot","server":"","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.manual_scan","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":380,"y":1260,"wires":[[]]},{"id":"f7a952ee.ecfe1","type":"server-state-changed","z":"7d105d71.cc18e4","name":"Manual reboot switch","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.reboot_monitor_nodes","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"x":100,"y":1200,"wires":[["f1fe7423.7a6b68","671cebbf.deaa4c","28376ea6.27f032","b9d825e3.4cffd","b0d8b375.b6ad9"],[]]},{"id":"b0d8b375.b6ad9","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":840,"y":1280,"wires":[["8f7a4106.9e0388"]]},{"id":"2d177e1f.f82eb2","type":"inject","z":"7d105d71.cc18e4","name":"Daily reboot","props":[{"p":"payload"}],"repeat":"","crontab":"00 05 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":70,"y":1140,"wires":[["b0d8b375.b6ad9","b9d825e3.4cffd","671cebbf.deaa4c","28376ea6.27f032"]]},{"id":"82e0395c.a0d528","type":"traffic","z":"7d105d71.cc18e4","name":"hold/release","property_allow":"payload","filter_allow":"release","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"hold","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":990,"y":840,"wires":[["119b3b67.f67655"]]},{"id":"ba77562.c3b37a8","type":"link in","z":"7d105d71.cc18e4","name":"hold/release echo","links":["9b92db9.da91628","f63db111.ad891"],"x":875,"y":820,"wires":[["82e0395c.a0d528"]]},{"id":"c2f49b2.155d4e8","type":"traffic","z":"7d105d71.cc18e4","name":"hold/release","property_allow":"payload","filter_allow":"release","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"hold","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":670,"y":660,"wires":[["18e9d6aa.e75629"]]},{"id":"f157f08a.2e257","type":"link in","z":"7d105d71.cc18e4","name":"hold/release device state","links":["9b92db9.da91628","f63db111.ad891"],"x":555,"y":680,"wires":[["c2f49b2.155d4e8"]]},{"id":"bccbd872.e800f8","type":"delay","z":"7d105d71.cc18e4","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":120,"y":380,"wires":[["24e06059.d8b4e8"]]},{"id":"ec2059da.8eef","type":"traffic","z":"7d105d71.cc18e4","name":"pause/unpause","property_allow":"payload","filter_allow":"unpause","ignore_case_allow":false,"negate_allow":false,"send_allow":false,"property_stop":"payload","filter_stop":"pause","ignore_case_stop":false,"negate_stop":false,"send_stop":false,"default_start":true,"differ":false,"x":520,"y":840,"wires":[["b61f90cd.7666c"]]},{"id":"601bef1.d5b981","type":"mqtt-broker","name":"Mosquitto","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
1 Like