My combination Manual Alarm (YAML) and Node-RED alarm (and MORE!) - example, and looking for constructive criticism

I looked around everywhere, on multiple forums, reddit, etc and couldn’t find any node-red home alarm examples anywhere, so I’ve been working on one for the last couple days and wanted to share it here for anyone in the future who might be looking for an example to work off of, and to get criticism and advice on how I might make it better.

I wanted the simplicity of the Manual Alarm keypad, but an easier way to program it with Node-RED, so I started looking into merging the two together. Turned out to not be all that hard.

Currently, the siren is not connected during testing, I’m using a debug node for that.

The alarm auto arms at night @ 10:30p, and disarms in the morning @ 5a.

TTS announces all status change, as well as counts down when arming away.

I have current state nodes checking the status before each trigger is allowed to automate. I do this because I have a few lighting automations that will not always turn everything on or off, and I do not want to have that problem in the middle of the night with an alarm going off.

I have “alarm_control_panel.home_alarm” being monitored by a state node, going into a switch and sending the corresponding state to whichever flow it needs to.

The trigger automation at the bottom, is how I’m sending the triggered state to alarm_control_panel.home_alarm, but I think this could be done better and more efficiently, does anyone have any thoughts on that?

To do:
1. Setup a Go Control WA00Z-1 2 button zwave switch to arm/disarm manually from our bedroom.
2. Setup proximity arm/disarm on our phones using OwnTracks and Life360.
3. Notifications and Alerts

Does anyone have any thoughts on how to better implement this?

Latest code: My combination Manual Alarm (YAML) and Node-RED alarm (and MORE!) - example, and looking for constructive criticism - #6 by PickleSlice

Here’s the Manual Alarm YAML code, stored in alarm.yaml:
platform: manual
name: Home Alarm
code: !secret alarm_code
pending_time: 30
delay_time: 20
trigger_time: 1
disarmed:
trigger_time: 0
armed_home:
pending_time: 0
delay_time: 0

Here is a screenshot of the Flow and the code posted below.

Code:

Code redacted cause I am an 'idiot' and posted the code of three nodes.
9 Likes

Nice, I’ve been thinking of doing this. Will look into it more after vacay…

1 Like

Hope it helps!

I’ve been messing with it over the last few days and I’ve made a few more changes. I’ll update with the changes soon.

Here’s the most recent rendition:

I’m learning as I go, and I discovered these amazing things called sub flows. Makes the layout look so much better and easier to maintain. So I’ve turned all of the alarm modes into sub flows.

Updated Alarm code in Alarm.yaml. I’m still experimenting with this.

See next post
platform: manual
name: Home Alarm
code: !secret alarm_code
pending_time: 0
# delay_time: 1
trigger_time: 120
# disarmed:
# trigger_time: 0
# armed_home:
# pending_time: 0
# delay_time: 0
armed_away:
pending_time: 30
delay_time: 30

Armed Home:

[{"id":"85d83311.18d58","type":"subflow","name":"Armed Home","info":"","category":"","in":[{"x":80,"y":80,"wires":[{"id":"ab8ce01c.2663f"}]}],"out":[],"env":[],"status":{"x":1220,"y":160,"wires":[{"id":"5015c7b3.ac0278","port":0},{"id":"b792253e.5446d8","port":0},{"id":"2a1e8eeb.efc3f2","port":0}]}},{"id":"b792253e.5446d8","type":"api-call-service","z":"85d83311.18d58","name":"Say \"The house is armed.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is armed.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":100,"wires":[[]]},{"id":"11f66e7d.f79282","type":"api-call-service","z":"85d83311.18d58","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":440,"y":100,"wires":[["b792253e.5446d8"]]},{"id":"ab8ce01c.2663f","type":"api-current-state","z":"85d83311.18d58","name":"Armed Home?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":220,"y":80,"wires":[["22e76f32.18911","11f66e7d.f79282"],["1d5562e0.3290fd"]]},{"id":"22e76f32.18911","type":"api-call-service","z":"85d83311.18d58","name":"Armed lights on, 40%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":40,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":460,"y":40,"wires":[["c6b70832.a78ac8"]]},{"id":"5015c7b3.ac0278","type":"api-call-service","z":"85d83311.18d58","name":"Say \"The house failed to arm.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house failed to arm.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":670,"y":160,"wires":[[]]},{"id":"1d5562e0.3290fd","type":"api-call-service","z":"85d83311.18d58","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":440,"y":160,"wires":[["5015c7b3.ac0278"]]},{"id":"2a1e8eeb.efc3f2","type":"api-call-service","z":"85d83311.18d58","name":"Red lights on, 40%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":40,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":990,"y":40,"wires":[[]]},{"id":"cc0c16e4.a21bd8","type":"api-current-state","z":"85d83311.18d58","name":"Armed lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":790,"y":40,"wires":[[],["2a1e8eeb.efc3f2"]]},{"id":"c6b70832.a78ac8","type":"delay","z":"85d83311.18d58","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":630,"y":40,"wires":[["cc0c16e4.a21bd8"]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

30 second Away countdown:

[{"id":"b87866c.ab60098","type":"subflow","name":"30s countdown to armed away","info":"","category":"","in":[{"x":60,"y":80,"wires":[{"id":"7c7f17cd.558048"}]}],"out":[],"env":[]},{"id":"7c7f17cd.558048","type":"api-current-state","z":"b87866c.ab60098","name":"Pending","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"pending","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":160,"y":80,"wires":[["bc578c57.b02ef"],[]]},{"id":"b333400f.68289","type":"api-call-service","z":"b87866c.ab60098","name":"TTS armed in 30s","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house will be armed in 30 seconds.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":510,"y":80,"wires":[["ec8ee4f5.30b938"]]},{"id":"bc578c57.b02ef","type":"api-call-service","z":"b87866c.ab60098","name":"Set volume 70%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.2}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":320,"y":80,"wires":[["b333400f.68289"]]},{"id":"df2a25a0.beb298","type":"api-call-service","z":"b87866c.ab60098","name":"TTS armed in 20s","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house will be armed in 20 seconds.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":830,"y":80,"wires":[["c9a244d8.4416d8"]]},{"id":"492a2e55.66422","type":"api-call-service","z":"b87866c.ab60098","name":"TTS armed in 10s","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house will be armed in 10 seconds.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":80,"wires":[[]]},{"id":"ec8ee4f5.30b938","type":"stoptimer","z":"b87866c.ab60098","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"10sec","x":670,"y":80,"wires":[["df2a25a0.beb298"],[]]},{"id":"c9a244d8.4416d8","type":"stoptimer","z":"b87866c.ab60098","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"10sec","x":990,"y":80,"wires":[["492a2e55.66422"],[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Armed Away:

[{"id":"f9dcb285.9aa2d","type":"subflow","name":"Armed away","info":"","category":"","in":[{"x":40,"y":80,"wires":[{"id":"4cff3e55.d944a"}]}],"out":[{"x":1120,"y":80,"wires":[{"id":"6a819945.6aaf88","port":0},{"id":"84d846f0.04d2a8","port":0},{"id":"4d36061a.3c5188","port":0}]}],"env":[]},{"id":"4cff3e55.d944a","type":"api-current-state","z":"f9dcb285.9aa2d","name":"Armed away?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":180,"y":80,"wires":[["24633a12.833e16","999d7380.2df12"],["9d456500.6376b8"]]},{"id":"6a819945.6aaf88","type":"api-call-service","z":"f9dcb285.9aa2d","name":"GH say \"The alarm is armed away.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is armed away.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":80,"wires":[[]]},{"id":"999d7380.2df12","type":"api-call-service","z":"f9dcb285.9aa2d","name":"Set volume 70%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.7}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":80,"wires":[["6a819945.6aaf88"]]},{"id":"84d846f0.04d2a8","type":"api-call-service","z":"f9dcb285.9aa2d","name":"GH say \"The alarm was not set.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The alarm failed to arm.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":650,"y":140,"wires":[[]]},{"id":"9d456500.6376b8","type":"api-call-service","z":"f9dcb285.9aa2d","name":"Set volume 70%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.7}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":140,"wires":[["84d846f0.04d2a8"]]},{"id":"24633a12.833e16","type":"api-call-service","z":"f9dcb285.9aa2d","name":"Armed lights on, 40%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":40,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":420,"y":20,"wires":[["80bf2f1e.92bc9"]]},{"id":"80bf2f1e.92bc9","type":"delay","z":"f9dcb285.9aa2d","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":590,"y":20,"wires":[["2ab9669c.39d62a"]]},{"id":"4d36061a.3c5188","type":"api-call-service","z":"f9dcb285.9aa2d","name":"Armed lights on, 40%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":40,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":960,"y":20,"wires":[[]]},{"id":"2ab9669c.39d62a","type":"api-current-state","z":"f9dcb285.9aa2d","name":"Armed lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":750,"y":20,"wires":[[],["4d36061a.3c5188"]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Disarmed

[{"id":"1fd9a5a.e266d5a","type":"subflow","name":"House disarmed","info":"","category":"","in":[{"x":40,"y":80,"wires":[{"id":"18b037a5.8af298"}]}],"out":[],"env":[]},{"id":"60e58978.406f98","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Turn off armed lights","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"group.armed_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":380,"y":60,"wires":[["81bf49f3.7ff1d8"]]},{"id":"427a1ecc.1f1a1","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Say \"House is disarmed.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is disarmed.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":570,"y":120,"wires":[[]]},{"id":"889b9d54.7f9bc","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":360,"y":120,"wires":[["427a1ecc.1f1a1"]]},{"id":"18b037a5.8af298","type":"api-current-state","z":"1fd9a5a.e266d5a","name":"Disarmed?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":150,"y":80,"wires":[["60e58978.406f98","59dff7bc.14bfc8","889b9d54.7f9bc"],["9a42d615.382708"]]},{"id":"9a42d615.382708","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":360,"y":240,"wires":[["ad1ba460.24edb8"]]},{"id":"ad1ba460.24edb8","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Say \"House did not disarm.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house did not disarm.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":580,"y":240,"wires":[[]]},{"id":"29735e3d.2afc82","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":490,"y":180,"wires":[["c4abe81e.81b3c8"]]},{"id":"59dff7bc.14bfc8","type":"api-current-state","z":"1fd9a5a.e266d5a","name":"Siren on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.alarm_siren","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":340,"y":180,"wires":[["29735e3d.2afc82"],[]]},{"id":"30266e8.5aebd92","type":"api-current-state","z":"1fd9a5a.e266d5a","name":"Siren still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.alarm_siren","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":780,"y":180,"wires":[["b5884a3.ff189b8"],[]]},{"id":"b5884a3.ff189b8","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":950,"y":180,"wires":[["30266e8.5aebd92"]]},{"id":"d17da3b2.7d0e1","type":"api-call-service","z":"1fd9a5a.e266d5a","name":"Turn off armed lights","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"group.armed_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":960,"y":60,"wires":[["a9420ee7.25479"]]},{"id":"a9420ee7.25479","type":"api-current-state","z":"1fd9a5a.e266d5a","name":"Armed lights still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":740,"y":60,"wires":[["d17da3b2.7d0e1"],[]]},{"id":"81bf49f3.7ff1d8","type":"delay","z":"1fd9a5a.e266d5a","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":550,"y":60,"wires":[["a9420ee7.25479"]]},{"id":"c4abe81e.81b3c8","type":"delay","z":"1fd9a5a.e266d5a","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":630,"y":180,"wires":[["30266e8.5aebd92"]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Triggered

[{"id":"5633538f.2e3cac","type":"subflow","name":"House Alarm Triggered","info":"","category":"","in":[{"x":120,"y":40,"wires":[{"id":"cebfac9d.7cf58"},{"id":"e16898d9.2d3248"},{"id":"b061a2b5.6551f"}]}],"out":[],"env":[],"status":{"x":1160,"y":40,"wires":[{"id":"95ce5c4b.8060a","port":0},{"id":"a2d67f52.0f8d1","port":0},{"id":"80d3d5cb.9e0e78","port":0}]}},{"id":"e16898d9.2d3248","type":"api-call-service","z":"5633538f.2e3cac","name":"All lights on 100%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.all_lights","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":310,"y":100,"wires":[["7b2633bc.e1f69c"]]},{"id":"b061a2b5.6551f","type":"api-call-service","z":"5633538f.2e3cac","name":"Siren on!","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_on","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":280,"y":180,"wires":[["d4d2830b.e2511"]]},{"id":"d4d2830b.e2511","type":"stoptimer","z":"5633538f.2e3cac","duration":"2","units":"Minute","payloadtype":"num","payloadval":"0","name":"2min","x":410,"y":180,"wires":[["fe6b7f35.b26e4"],[]]},{"id":"fe6b7f35.b26e4","type":"api-call-service","z":"5633538f.2e3cac","name":"Siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":540,"y":180,"wires":[["9f609468.4e0fa8"]]},{"id":"4e2e6cc9.e0dcb4","type":"api-current-state","z":"5633538f.2e3cac","name":"Siren still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.alarm_siren","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":840,"y":180,"wires":[["95ce5c4b.8060a"],[]]},{"id":"95ce5c4b.8060a","type":"api-call-service","z":"5633538f.2e3cac","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1010,"y":180,"wires":[["4e2e6cc9.e0dcb4"]]},{"id":"908e6bc5.17a158","type":"api-current-state","z":"5633538f.2e3cac","name":"Triggered?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"triggered","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":40,"wires":[["80d3d5cb.9e0e78"],[]]},{"id":"80d3d5cb.9e0e78","type":"api-call-service","z":"5633538f.2e3cac","name":"Test Lights","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_on","entityId":"group.armed_lights","data":"\"brightness_pct\":\"100\"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":630,"y":40,"wires":[[]]},{"id":"9f609468.4e0fa8","type":"delay","z":"5633538f.2e3cac","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":670,"y":180,"wires":[["4e2e6cc9.e0dcb4"]]},{"id":"a2d67f52.0f8d1","type":"api-call-service","z":"5633538f.2e3cac","name":"Emergency lights on 100%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.all_lights","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":840,"y":100,"wires":[["3df67b41.a900f4"]]},{"id":"7b2633bc.e1f69c","type":"delay","z":"5633538f.2e3cac","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":470,"y":100,"wires":[["3df67b41.a900f4"]]},{"id":"3df67b41.a900f4","type":"api-current-state","z":"5633538f.2e3cac","name":"All lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.all_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":630,"y":100,"wires":[[],["a2d67f52.0f8d1"]]},{"id":"cebfac9d.7cf58","type":"api-call-service","z":"5633538f.2e3cac","name":"Alarm Triggered","server":"26956a45.92d866","version":1,"service_domain":"alarm_control_panel","service":"alarm_trigger","entityId":"alarm_control_panel.home_alarm","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":300,"y":40,"wires":[["908e6bc5.17a158"]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

OR statement to see if alarm is Away or Home:
image

[{"id":"16c964ac.08a67b","type":"subflow","name":"Alarm Armed?","info":"","category":"","in":[{"x":260,"y":300,"wires":[{"id":"1e02faa7.9739e5"},{"id":"e3dec98.4de6838"}]}],"out":[{"x":580,"y":300,"wires":[{"id":"1e02faa7.9739e5","port":0},{"id":"e3dec98.4de6838","port":0}]}],"env":[],"status":{"x":560,"y":160,"wires":[{"id":"1e02faa7.9739e5","port":0},{"id":"e3dec98.4de6838","port":0}]}},{"id":"1e02faa7.9739e5","type":"api-current-state","z":"16c964ac.08a67b","name":"Alarm Armed Home?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":420,"y":280,"wires":[[],[]]},{"id":"e3dec98.4de6838","type":"api-current-state","z":"16c964ac.08a67b","name":"Alarm Armed Away?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":420,"y":320,"wires":[[],[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Triggers:
image

[{"id":"d6b260aa.de4f6","type":"subflow","name":"Alarm Triggers","info":"","category":"","in":[],"out":[{"x":400,"y":80,"wires":[{"id":"63fdfe42.4a4aa","port":0},{"id":"eaea2f0d.129f3","port":0},{"id":"3d1df914.299db6","port":0},{"id":"a496135e.c6b04","port":0}]}],"env":[],"status":{"x":400,"y":140,"wires":[{"id":"63fdfe42.4a4aa","port":0},{"id":"eaea2f0d.129f3","port":0},{"id":"3d1df914.299db6","port":0},{"id":"a496135e.c6b04","port":0}]}},{"id":"63fdfe42.4a4aa","type":"server-state-changed","z":"d6b260aa.de4f6","name":"Exterior windows","server":"26956a45.92d866","version":1,"entityidfilter":"group.exterior_windows","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":200,"y":80,"wires":[[],[]]},{"id":"eaea2f0d.129f3","type":"server-state-changed","z":"d6b260aa.de4f6","name":"Exterior doors","server":"26956a45.92d866","version":1,"entityidfilter":"group.exterior_doors","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":190,"y":140,"wires":[[],[]]},{"id":"3d1df914.299db6","type":"server-state-changed","z":"d6b260aa.de4f6","name":"Garage open","server":"26956a45.92d866","version":1,"entityidfilter":"cover.door_garage","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"open","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":190,"y":200,"wires":[[],[]]},{"id":"a496135e.c6b04","type":"server-state-changed","z":"d6b260aa.de4f6","name":"Garage open","server":"26956a45.92d866","version":1,"entityidfilter":"cover.door_garage","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"opening","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":190,"y":260,"wires":[[],[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

10:3op Arm / 5a Disarm
image

[{"id":"2bff3893.276098","type":"subflow","name":"Arm 10:30p/Disarm 5a","info":"","category":"","in":[],"out":[{"x":500,"y":100,"wires":[{"id":"38e4d656.b0d82a","port":0},{"id":"f2d00289.be357","port":0}]}],"env":[]},{"id":"ab0d2e78.90bc2","type":"inject","z":"2bff3893.276098","name":"Arm @10:30p","topic":"","payload":"armed_home","payloadType":"str","repeat":"","crontab":"30 22 * * *","once":false,"onceDelay":0.1,"x":200,"y":80,"wires":[["38e4d656.b0d82a"]]},{"id":"717f1f27.c0ddb","type":"inject","z":"2bff3893.276098","name":"Disarm @ 5a","topic":"","payload":"disarmed","payloadType":"str","repeat":"","crontab":"00 05 * * *","once":false,"onceDelay":0.1,"x":200,"y":120,"wires":[["f2d00289.be357"]]},{"id":"f2d00289.be357","type":"api-call-service","z":"2bff3893.276098","name":"Disarm","server":"26956a45.92d866","version":1,"service_domain":"alarm_control_panel","service":"alarm_disarm","entityId":"","data":"{\"entity_id\":\"alarm_control_panel.home_alarm\",\"code\":\"5849\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":360,"y":120,"wires":[[]]},{"id":"38e4d656.b0d82a","type":"api-call-service","z":"2bff3893.276098","name":"Arm Home","server":"26956a45.92d866","version":1,"service_domain":"alarm_control_panel","service":"alarm_arm_home","entityId":"","data":"{\"entity_id\":\"alarm_control_panel.home_alarm\",\"code\":\"5849\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":370,"y":80,"wires":[[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

I finally have the alarm.yaml setup the way I need it to be.

platform: manual
name: Home Alarm
code: !secret alarm_code
pending_time: 0
delay_time: 0
trigger_time: 120
armed_away:
  trigger_time: 30
  delay_time: 90
  pending_time: 30

Either I’m misunderstanding the Manual Alarm documentation, or it needs updating, but I could not get it to work with the example and instructions provided. I set it up per the documentation, where the alarm would only go into pending and delay when in Armed Away, but it would pend and delay for every mode, so I ended up having to specify to only Pend and Delay in Amed Away, as posted above. This will instantly arm and disarm in Armed Home, and pend for 30 seconds when Armed Away, and delay for 90 seconds when Disarmed from Armed Away.

1 Like

Not many seem to be interested in this, but I’ll post up the update in case someone in the future is looking for something like this.

So here is where I landed. This seems to work flawlessly, or at least I haven’t had the scenario where it didn’t work properly. I’m still working on arming and disarming via presence, but that will be done soon as well. I’m monitoring different ways via notifications to see which is the most reliable. So far it seems like Life 360 is the way I’m going to go, but I want to test it a few more days before I implement it. I’m not sure if I’m going to use the away mode or not. I’ve got some cool countdowns utilizing my Google Homes, but I haven’t figured out how to interrupt the countdown for not_home to home. I may decide I don’t care that much and just use instant arm for both away and home if my presence automations are reliable. I’m also going to setup dynamic notifications, but again I’m not too worried about that.

[{"id":"5bf05af2.a54944","type":"subflow","name":"Alarm Armed? (2)","info":"","category":"","in":[{"x":260,"y":300,"wires":[{"id":"bae7d16d.a5236"},{"id":"e91d640b.d99d58"}]}],"out":[{"x":800,"y":300,"wires":[{"id":"bae7d16d.a5236","port":0},{"id":"e91d640b.d99d58","port":0}]}],"env":[],"status":{"x":800,"y":220,"wires":[{"id":"bae7d16d.a5236","port":0},{"id":"e91d640b.d99d58","port":0},{"id":"89580b7.d5a29f8","port":0},{"id":"31e7bc6.2ac0f44","port":0},{"id":"e14d2fd5.ac559","port":0},{"id":"dd01be7e.c8353","port":0}]}},{"id":"bae7d16d.a5236","type":"api-current-state","z":"5bf05af2.a54944","name":"Alarm Armed Home?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":420,"y":280,"wires":[[],[]]},{"id":"e91d640b.d99d58","type":"api-current-state","z":"5bf05af2.a54944","name":"Alarm Armed Away?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":420,"y":320,"wires":[[],[]]},{"id":"89580b7.d5a29f8","type":"poll-state","z":"5bf05af2.a54944","name":"Disarmed?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":380,"y":200,"wires":[[],[]]},{"id":"31e7bc6.2ac0f44","type":"poll-state","z":"5bf05af2.a54944","name":"Armed Away?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":390,"y":160,"wires":[[],[]]},{"id":"e14d2fd5.ac559","type":"poll-state","z":"5bf05af2.a54944","name":"Armed Home?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":390,"y":120,"wires":[[],[]]},{"id":"dd01be7e.c8353","type":"poll-state","z":"5bf05af2.a54944","name":"Disarmed?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":380,"y":80,"wires":[[],[]]},{"id":"7fc43fa8.558bd","type":"subflow","name":"Alarm Triggers (2)","info":"","category":"","in":[],"out":[{"x":320,"y":40,"wires":[{"id":"4d149ce3.631214","port":0},{"id":"b3cf9048.0225f","port":0},{"id":"4c189166.3bac7","port":0},{"id":"f469c217.890fd","port":0}]}],"env":[],"status":{"x":320,"y":220,"wires":[{"id":"4d149ce3.631214","port":0},{"id":"b3cf9048.0225f","port":0},{"id":"4c189166.3bac7","port":0},{"id":"f469c217.890fd","port":0},{"id":"4d149ce3.631214","port":1},{"id":"b3cf9048.0225f","port":1},{"id":"4c189166.3bac7","port":1},{"id":"f469c217.890fd","port":1}]}},{"id":"4d149ce3.631214","type":"server-state-changed","z":"7fc43fa8.558bd","name":"Exterior windows","server":"26956a45.92d866","version":1,"entityidfilter":"group.exterior_windows","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":100,"y":40,"wires":[[],[]]},{"id":"b3cf9048.0225f","type":"server-state-changed","z":"7fc43fa8.558bd","name":"Exterior doors","server":"26956a45.92d866","version":1,"entityidfilter":"group.exterior_doors","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":90,"y":100,"wires":[[],[]]},{"id":"4c189166.3bac7","type":"server-state-changed","z":"7fc43fa8.558bd","name":"Garage open","server":"26956a45.92d866","version":1,"entityidfilter":"cover.door_garage","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"open","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":90,"y":160,"wires":[[],[]]},{"id":"f469c217.890fd","type":"server-state-changed","z":"7fc43fa8.558bd","name":"Garage open","server":"26956a45.92d866","version":1,"entityidfilter":"cover.door_garage","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"opening","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"x":90,"y":220,"wires":[[],[]]},{"id":"bedb8102.ac531","type":"subflow","name":"House Alarm Triggered (2)","info":"","category":"","in":[{"x":40,"y":40,"wires":[{"id":"8412da75.8bebc8"}]}],"out":[],"env":[],"status":{"x":360,"y":220,"wires":[{"id":"8412da75.8bebc8","port":0},{"id":"fef7cfa9.9feaf","port":0}]}},{"id":"e844b4a0.8332e8","type":"api-call-service","z":"bedb8102.ac531","name":"All lights on 100%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.all_lights","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":430,"y":40,"wires":[["7cc8ea3c.5e87f4"]]},{"id":"e1e68ffb.b6083","type":"api-call-service","z":"bedb8102.ac531","name":"Siren on!","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"light.siren_strobe_alarm","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":400,"y":100,"wires":[["55a7f90e.065b38"]]},{"id":"55a7f90e.065b38","type":"stoptimer","z":"bedb8102.ac531","duration":"2","units":"Minute","payloadtype":"num","payloadval":"0","name":"2min","x":530,"y":100,"wires":[["7e64cb65.ccedd4"],[]]},{"id":"7e64cb65.ccedd4","type":"api-call-service","z":"bedb8102.ac531","name":"Siren off","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"light.siren_strobe_alarm","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":660,"y":100,"wires":[["efd9750e.83ec08"]]},{"id":"f2dff3b2.46c85","type":"api-current-state","z":"bedb8102.ac531","name":"Siren still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.siren_strobe_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":960,"y":100,"wires":[["9a3f502d.6e1de"],[]]},{"id":"9a3f502d.6e1de","type":"api-call-service","z":"bedb8102.ac531","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"light.siren_strobe_alarm","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1130,"y":100,"wires":[["f2dff3b2.46c85"]]},{"id":"efd9750e.83ec08","type":"delay","z":"bedb8102.ac531","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":790,"y":100,"wires":[["f2dff3b2.46c85"]]},{"id":"8efc07f6.a53428","type":"api-call-service","z":"bedb8102.ac531","name":"Emergency lights on 100%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.all_lights","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":40,"wires":[["10bf0bc6.067f04"]]},{"id":"7cc8ea3c.5e87f4","type":"delay","z":"bedb8102.ac531","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":590,"y":40,"wires":[["10bf0bc6.067f04"]]},{"id":"10bf0bc6.067f04","type":"api-current-state","z":"bedb8102.ac531","name":"All lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.all_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":750,"y":40,"wires":[[],["8efc07f6.a53428"]]},{"id":"ae2a7185.0d221","type":"api-call-service","z":"bedb8102.ac531","name":"Triggered!  Notification","server":"26956a45.92d866","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"The Home Alarm has been triggered!\",\"title\":\"Home Assistant\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":440,"y":160,"wires":[[]]},{"id":"8412da75.8bebc8","type":"api-current-state","z":"bedb8102.ac531","name":"Alarm Triggered?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"triggered","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":170,"y":40,"wires":[["ae2a7185.0d221","e844b4a0.8332e8","e1e68ffb.b6083"],[]]},{"id":"fef7cfa9.9feaf","type":"server-state-changed","z":"bedb8102.ac531","name":"Disarmed?","server":"26956a45.92d866","version":1,"entityidfilter":"alarm_control_panel.home_alarm","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":140,"y":220,"wires":[[],[]]},{"id":"e209e6fb.f06258","type":"subflow","name":"House disarmed (2)","info":"","category":"","in":[{"x":40,"y":140,"wires":[{"id":"34585a5.711fea6"}]}],"out":[],"env":[],"status":{"x":320,"y":260,"wires":[{"id":"34585a5.711fea6","port":1}]}},{"id":"e7d17b3a.80d5d8","type":"api-call-service","z":"e209e6fb.f06258","name":"Turn off armed lights","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"group.armed_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":420,"y":40,"wires":[["f1941cf0.8e44"]]},{"id":"fabf3bc7.3848b8","type":"api-call-service","z":"e209e6fb.f06258","name":"Say \"House is disarmed.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is disarmed.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":160,"wires":[[]]},{"id":"2bc0e46e.31934c","type":"api-call-service","z":"e209e6fb.f06258","name":"Set volume 30%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.3}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":160,"wires":[["fabf3bc7.3848b8"]]},{"id":"34585a5.711fea6","type":"api-current-state","z":"e209e6fb.f06258","name":"Disarmed?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":150,"y":140,"wires":[["e7d17b3a.80d5d8","2bc0e46e.31934c"],["902dd43a.7c22e8"]]},{"id":"8e6e3f4e.48274","type":"api-call-service","z":"e209e6fb.f06258","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":530,"y":220,"wires":[["ed85f6f3.b2cee8"]]},{"id":"902dd43a.7c22e8","type":"api-current-state","z":"e209e6fb.f06258","name":"Siren on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.alarm_siren","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":220,"wires":[["8e6e3f4e.48274"],[]]},{"id":"712c60df.6ddcf","type":"api-current-state","z":"e209e6fb.f06258","name":"Siren still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.alarm_siren","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":840,"y":220,"wires":[["bb057ab4.4e7818"],[]]},{"id":"bb057ab4.4e7818","type":"api-call-service","z":"e209e6fb.f06258","name":"Turn siren off","server":"26956a45.92d866","version":1,"service_domain":"switch","service":"turn_off","entityId":"switch.alarm_siren","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1010,"y":220,"wires":[["712c60df.6ddcf"]]},{"id":"ec6a3e4c.9a17f","type":"api-call-service","z":"e209e6fb.f06258","name":"Turn off armed lights","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_off","entityId":"group.armed_lights","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1000,"y":40,"wires":[["65c18a65.f80894"]]},{"id":"65c18a65.f80894","type":"api-current-state","z":"e209e6fb.f06258","name":"Armed lights still on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":780,"y":40,"wires":[["ec6a3e4c.9a17f"],[]]},{"id":"f1941cf0.8e44","type":"delay","z":"e209e6fb.f06258","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":590,"y":40,"wires":[["65c18a65.f80894"]]},{"id":"ed85f6f3.b2cee8","type":"delay","z":"e209e6fb.f06258","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":670,"y":220,"wires":[["712c60df.6ddcf"]]},{"id":"fa484c19.401f7","type":"subflow","name":"Armed away (2)","info":"","category":"","in":[{"x":40,"y":20,"wires":[{"id":"50025098.d767"}]}],"out":[],"env":[],"status":{"x":220,"y":180,"wires":[{"id":"50025098.d767","port":0},{"id":"50025098.d767","port":1},{"id":"7fa03bf6.503aa4","port":0}]}},{"id":"50025098.d767","type":"api-current-state","z":"fa484c19.401f7","name":"Armed away?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":160,"y":20,"wires":[["b1934e50.7c5c4","5d185a09.7eb224"],["b3360389.87f34"]]},{"id":"977c36a.d6ffdc8","type":"api-call-service","z":"fa484c19.401f7","name":"GH say \"The alarm is armed away.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is armed away.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":660,"y":80,"wires":[["d34ed623.1e0be8"]]},{"id":"5d185a09.7eb224","type":"api-call-service","z":"fa484c19.401f7","name":"Set volume 70%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.7}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":80,"wires":[["977c36a.d6ffdc8"]]},{"id":"2ab3f6fe.8dd77a","type":"api-call-service","z":"fa484c19.401f7","name":"GH say \"The alarm was not set.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The alarm failed to arm.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":650,"y":260,"wires":[["56094215.3e875c"]]},{"id":"b3360389.87f34","type":"api-call-service","z":"fa484c19.401f7","name":"Set volume 70%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.7}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":260,"wires":[["2ab3f6fe.8dd77a"]]},{"id":"b1934e50.7c5c4","type":"api-call-service","z":"fa484c19.401f7","name":"Armed lights on, 15%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":15,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":420,"y":20,"wires":[["fa056ff1.46413"]]},{"id":"fa056ff1.46413","type":"delay","z":"fa484c19.401f7","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":590,"y":20,"wires":[["8f0df270.d74e1"]]},{"id":"4d3be80e.0e9cc8","type":"api-call-service","z":"fa484c19.401f7","name":"Armed lights on, 15%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":15,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":980,"y":20,"wires":[["8f0df270.d74e1"]]},{"id":"8f0df270.d74e1","type":"api-current-state","z":"fa484c19.401f7","name":"Armed lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":770,"y":20,"wires":[[],["4d3be80e.0e9cc8"]]},{"id":"d34ed623.1e0be8","type":"api-call-service","z":"fa484c19.401f7","name":"Armed Away Notification","server":"26956a45.92d866","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"The house is Armed Away\",\"title\":\"Home Assistant\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":80,"wires":[[]]},{"id":"56094215.3e875c","type":"api-call-service","z":"fa484c19.401f7","name":"Did not Armed Away Notification","server":"26956a45.92d866","version":1,"service_domain":"notify","service":"pushover","entityId":"","data":"{\"message\":\"The house was *NOT* Armed Away\",\"title\":\"Home Assistant\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":930,"y":260,"wires":[[]]},{"id":"7fa03bf6.503aa4","type":"poll-state","z":"fa484c19.401f7","name":"Disarmed?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":80,"y":180,"wires":[[],[]]},{"id":"2d6cd573.771aea","type":"subflow","name":"Armed Home (2)","info":"","category":"","in":[{"x":40,"y":40,"wires":[{"id":"5d400ad8.305184"}]}],"out":[],"env":[],"status":{"x":220,"y":240,"wires":[{"id":"5d400ad8.305184","port":0},{"id":"39ad6110.ea3c7e","port":0}]}},{"id":"d00645f3.8e4b68","type":"api-call-service","z":"2d6cd573.771aea","name":"Say \"The house is armed.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house is armed.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":60,"wires":[[]]},{"id":"e6809c92.66ea4","type":"api-call-service","z":"2d6cd573.771aea","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":60,"wires":[["d00645f3.8e4b68"]]},{"id":"5d400ad8.305184","type":"api-current-state","z":"2d6cd573.771aea","name":"Armed Home?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":180,"y":40,"wires":[["4ead9beb.8bf314","dbc5a919.7f54d8","e6809c92.66ea4"],["ff521e79.31f0b"]]},{"id":"4ead9beb.8bf314","type":"api-call-service","z":"2d6cd573.771aea","name":"Armed lights on, 15%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":15,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":480,"y":20,"wires":[["6ec56ef5.8b3f"]]},{"id":"8d67453d.885478","type":"api-call-service","z":"2d6cd573.771aea","name":"Say \"The house failed to arm.\"","server":"26956a45.92d866","version":1,"service_domain":"tts","service":"google_cloud_say","entityId":"media_player.living_room_speaker","data":"{\"message\":\"The house failed to arm.\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":710,"y":300,"wires":[[]]},{"id":"ff521e79.31f0b","type":"api-call-service","z":"2d6cd573.771aea","name":"Set volume 40%","server":"26956a45.92d866","version":1,"service_domain":"media_player","service":"volume_set","entityId":"media_player.living_room_speaker","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":480,"y":300,"wires":[["8d67453d.885478"]]},{"id":"cbc1c574.1d8c58","type":"api-call-service","z":"2d6cd573.771aea","name":"Armed lights on, 15%","server":"26956a45.92d866","version":1,"service_domain":"light","service":"turn_on","entityId":"group.armed_lights","data":"{\"brightness_pct\":15,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1040,"y":20,"wires":[["df79a3d7.f54ba"]]},{"id":"df79a3d7.f54ba","type":"api-current-state","z":"2d6cd573.771aea","name":"Armed lights on?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.armed_lights","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":830,"y":20,"wires":[[],["cbc1c574.1d8c58"]]},{"id":"6ec56ef5.8b3f","type":"delay","z":"2d6cd573.771aea","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":650,"y":20,"wires":[["df79a3d7.f54ba"]]},{"id":"39ad6110.ea3c7e","type":"poll-state","z":"2d6cd573.771aea","name":"Disarmed?","server":"26956a45.92d866","version":1,"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":true,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"x":80,"y":240,"wires":[[],[]]},{"id":"dbc5a919.7f54d8","type":"api-current-state","z":"2d6cd573.771aea","name":"Garage Open?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"open","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"cover.door_garage","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":100,"wires":[["5432b76d.5fea08"],[]]},{"id":"5432b76d.5fea08","type":"api-call-service","z":"2d6cd573.771aea","name":"Close Garage","server":"26956a45.92d866","version":1,"service_domain":"cover","service":"close_cover","entityId":"cover.door_garage","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":640,"y":100,"wires":[["cd3a2a85.cdac08"]]},{"id":"cd3a2a85.cdac08","type":"delay","z":"2d6cd573.771aea","name":"1sec","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":790,"y":100,"wires":[["e394bef5.554a9"]]},{"id":"e394bef5.554a9","type":"api-current-state","z":"2d6cd573.771aea","name":"Garage Open?","server":"26956a45.92d866","version":1,"outputs":2,"halt_if":"open","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"cover.door_garage","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":960,"y":100,"wires":[["f45f8fb5.edb9c"],[]]},{"id":"f45f8fb5.edb9c","type":"api-call-service","z":"2d6cd573.771aea","name":"Close Garage","server":"26956a45.92d866","version":1,"service_domain":"cover","service":"close_cover","entityId":"cover.door_garage","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":1140,"y":100,"wires":[["e394bef5.554a9"]]},{"id":"5a4c4c9a.8e97d4","type":"tab","label":"Home Security System","disabled":false,"info":""},{"id":"2a5a4e7b.f88f72","type":"server-state-changed","z":"5a4c4c9a.8e97d4","name":"Home Alarm Mode","server":"26956a45.92d866","version":1,"entityidfilter":"alarm_control_panel.home_alarm","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":110,"y":100,"wires":[["ae1c2ee0.84e41"]]},{"id":"ae1c2ee0.84e41","type":"switch","z":"5a4c4c9a.8e97d4","name":"Filter Alarm Status","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"armed_home","vt":"str"},{"t":"eq","v":"armed_away","vt":"str"},{"t":"eq","v":"disarmed","vt":"str"},{"t":"eq","v":"triggered","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":410,"y":100,"wires":[["9408750a.95c6b8"],["efea14b6.eac328"],["51bbf255.61a04c"],["ec6988a4.83f968"]]},{"id":"3193f76c.7a17f8","type":"comment","z":"5a4c4c9a.8e97d4","name":"From Manual Alarm Panel_______________________________","info":"","x":250,"y":40,"wires":[]},{"id":"208f6d7e.e16702","type":"comment","z":"5a4c4c9a.8e97d4","name":"Trigger automation________________________________","info":"","x":230,"y":160,"wires":[]},{"id":"9408750a.95c6b8","type":"subflow:2d6cd573.771aea","z":"5a4c4c9a.8e97d4","name":"Armed Home","env":[],"x":670,"y":20,"wires":[]},{"id":"efea14b6.eac328","type":"subflow:fa484c19.401f7","z":"5a4c4c9a.8e97d4","name":"Armed Away","env":[],"x":670,"y":80,"wires":[]},{"id":"51bbf255.61a04c","type":"subflow:e209e6fb.f06258","z":"5a4c4c9a.8e97d4","name":"Disarmed","env":[],"x":660,"y":140,"wires":[]},{"id":"ec6988a4.83f968","type":"subflow:bedb8102.ac531","z":"5a4c4c9a.8e97d4","name":"Triggered","env":[],"x":660,"y":200,"wires":[]},{"id":"d38682dc.d5c77","type":"subflow:7fc43fa8.558bd","z":"5a4c4c9a.8e97d4","name":"Alarm Triggers","env":[],"x":100,"y":200,"wires":[["a1898eaa.0bc66"]]},{"id":"a1898eaa.0bc66","type":"subflow:5bf05af2.a54944","z":"5a4c4c9a.8e97d4","name":"","env":[],"x":280,"y":200,"wires":[["f303c632.2291e8"]]},{"id":"f303c632.2291e8","type":"api-call-service","z":"5a4c4c9a.8e97d4","name":"Triggered","server":"26956a45.92d866","version":1,"service_domain":"alarm_control_panel","service":"alarm_trigger","entityId":"alarm_control_panel.home_alarm","data":"{\"code\":\"5849\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":440,"y":200,"wires":[[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

Alarm panel code:

platform: manual
name: Home Alarm
code: !secret alarm_code
pending_time: 0
delay_time: 0
trigger_time: 120
armed_away:
  trigger_time: 30
  delay_time: 90
  pending_time: 30

11 Likes

I am currently looking to do the same thing and I like what you are doing. I am new to node red so that is going to take some figuring out. I have an Envisalink connected to a Vista 20 alarm panel. I have the Envisalink working and configured in yaml. I also want to use my smart motion detectors and lights to automate when the Envisalink is triggered. So far I have a manual alarm panel arming and disarming the envisalink when it change. I am sure this can be simplify with the function node. I haven’t figured that out yet. From what I read the function node has to be configured using java script. How do you have your function node for arming configured? If possible could you post that code for me to use as a template please?

Thanks in advance.

1 Like

Are you referring to getting the mode from the alarm and deciding what to do with it? If so, I’m handling that within the switch node, I’m not handling it programmatically with a Fuction node.

Which sends the mode off to its respective flow -

image

Does that answer your question?

Yes, that what I needed. I can see this is going to be way better than using automation. I noticed and output and and input on some of your subflows. What is that for? I tried to google it but I think Im asking the wrong question.

I’m new to all of this, but this definitely looks very interesting to me and something I will be following. Please keep us updated with your progress!

1 Like

Hopefully this isn’t against the rules, but I’ve started a blog to document all my Node-RED automations. Hopefully it can be helpful to someone. Some of it may be wrong, or can be done better, but I can guarantee they all work, as I’ve been running them all for weeks, or months. Maybe it’ll be helpful for you. Here’s my post on the Security System , which is the most up to date code I’m using.

I think I’m missing something obvious…

How does the alarm know that it’s ready to be armed? I see in your flows that you’re checking if the alarm failed to arm but I’m unclear on how that can happen?

For example if my front door is open and I go to set the alarm it should fail.

1 Like

This is great. I am trying to do something very similar and your nodered automation is a good starting point. I will try this and reach out to you for more help…

Please do, I’m happy to help.

Hmm… I’m not sure if I’m understanding your question, but I’ll see if I can answer what I think you’re asking.

The arming and disarming logic for the alarm is handled by Home Assistant with the Manual Alarm Panel, that’s the only part that has to be setup in your configs with YAML.

As far as the alarm failing to arm, I have no idea if it’s possible, but I wanted to get a notification if it ever happens.

I think I’m misunderstanding you, so please elaborate and I’ll be happy to discuss. Here’s a post on my blog about it, maybe that will help.

:EDIT:

Oh wait! I think I know what you’re asking.

As it is in this thread, the alarm has to be manually armed and disarmed in Lovelace with the Manual Alarm Panel. Here’s what that looks like:

I’ve since setup many different ways to arm/disarm it with locations, time and telegram, etc.

Here’s an example of what one of the location automations look like. Let me know if you want the code to play with.

Here’s how I setup a Telegram bot to arm and disarm the alarm - https://theautomationplace.com/2019/10/03/node-red-and-telegram/

1 Like

Hi @PickleSlice i got a good start with your sample.

I dont have a alarm light in my setup, So i removed all the alarm light nodes. But what i am not able to find from your automation is, when the alarm is triggered, how is the siren triggered?

I see all your configuration to turn off the siren when the home is disarmed. But i dont see any configuration to turn it on. Can you help me here?

Here is how my “House Alarm Triggered” subflow looks like

  • There is no configuration to trigger the siren here. I only see turning on the light. The node that says “Siren on!” actually only turns on the light.
  • I also dont understand the reason for using “stoptimer”. I am new to nodered. Do you mind explaining me what this stoptimer does for 2 min?

OK, for the siren. I use a Fortrezz zwave siren, and that’s how it would trigger for me. Using the light service for some damn reason.

As far as the stoptimer, I just used it as I was used to using it. Theres a dela node you can use in it’s place if you like. The stop timer can be manipulated based on what payload you send it. Once it’s counting down, if you send a payload with “STOP” it will stop the timer and not pass on the msg. If the stop timer receives any other msg, it will restart the time. In this particular case, it’s not required and could be a delay node instead.

I’m comparing to a normal wired alarm system. If you try to arm the alarm and the front door is open the alarm won’t arm. Thinking it through I think I could build out the logic in node-red though.

This past weekend i was using your blog and examples to start building out my home alarm. It’s incredibly helpful!

1 Like

In my setup, it will still arm with a door open, and once it’s closed that door will be armed as well. I have an alert that I’m trying to figure out that will say something like “The alarm is armed but these were left open!” and it will tell you which was left open. I’m still learning function nodes so it’s not ready yet.

I’m glad that the blog is helpful, I just made another post about using zigbee buttons, google homes, and Node-RED together. You must’ve been one of the 6 people that visited over the weekend :smiley: