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

  1. A notification of what sensor triggered the alarm requires logic external to the HA alarm components (I think, although I wouldn’t be surprised if there is some ‘trigger reason’ attribute on the alarm). One simple way is to feed nodered trigger input messages to your notification node.

  2. Triggered Away and Triggered Home are just 2 different states, based on the arming method used. So you can use current state nodes with alarm_control_panel.home_alarm to feed your alarm trigger in nodered. For example, I have only perimeter sensors (doors, windows, etc) active if home, and the interior motion sensors will trigger only when armed away. To do this I have 3 alarm_control_panel.home_alarm current state nodes; one that passes messages if the state is armed_home, another with armed_away, and a 3rd with armed_night. The appropriate sensors feed these nodes (motions only go to away, perimeter triggers away and night, home is like night but excludes some perimeter nodes), and those 3 nodes send messages to the alarm trigger.

  3. I have a similar notification that uses presence detection (tracking phones connecting to our router). If nobody is home and the alarm is not armed, it sends a notification… also sends a list of opened doors/windows if there happen to be any.

  4. I don’t, because maybe sometimes I want to leave the house with a small bathroom window open. I still want the rest of the sensors to trigger though, including motions when nobody is home. So I don’t use ‘prearming’ conditions like that. Instead I just have it send a list of open sensors when it gets armed. Of course, an open sensor will not trigger when closed unless you tell it too… mine are setup so if armed with a window already open, that window has to be closed, then reopened to trigger the alarm.

Here’s the one I use to let us know that it’s about too rain and a door or window is opened, this can be used for the security system as well.

It can also be used to inform you if any of your sensors are unavailable, which I still need to do.

[{"id":"99a80042.61572","type":"ha-get-entities","z":"67c47ca9.0a8ff4","server":"26956a45.92d866","name":"","rules":[{"property":"entity_id","logic":"is","value":"binary_sensor.window","valueType":"re"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":370,"y":200,"wires":[["fee2f31.f21711"]]},{"id":"eebbe821.c11bc8","type":"ha-get-entities","z":"67c47ca9.0a8ff4","server":"26956a45.92d866","name":"","rules":[{"property":"entity_id","logic":"is","value":"binary_sensor.door","valueType":"re"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":370,"y":260,"wires":[["fee2f31.f21711"]]},{"id":"79d48e1e.14e7","type":"ha-get-entities","z":"67c47ca9.0a8ff4","server":"26956a45.92d866","name":"","rules":[{"property":"entity_id","logic":"is","value":"cover.door_garage","valueType":"re"},{"property":"state","logic":"is","value":"on","valueType":"str"}],"output_type":"split","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":370,"y":140,"wires":[["fee2f31.f21711"]]},{"id":"fee2f31.f21711","type":"template","z":"67c47ca9.0a8ff4","name":"Format Friendly Name","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{{payload.attributes.friendly_name}}}","output":"str","x":640,"y":200,"wires":[["6edc0c32.5e4ff4"]]},{"id":"6edc0c32.5e4ff4","type":"join","z":"67c47ca9.0a8ff4","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":", ","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":810,"y":200,"wires":[["7eb0a63f.86bac8"]]},{"id":"7eb0a63f.86bac8","type":"api-call-service","z":"67c47ca9.0a8ff4","name":"Notify","server":"26956a45.92d866","version":1,"debugenabled":false,"service_domain":"notify","service":"android_noify_group","entityId":"","data":"{\"message\":\"It's about to rain and these have been left open: {{{payload}}}.\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":930,"y":200,"wires":[[]]},{"id":"26956a45.92d866","type":"server","z":"","name":"Hass.io","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
  1. It can be done, a few different ways. One way would be to use the flow I just shared about which window/door is open and have it check after the alarm is triggered.

  2. The only thing I use differently between arm home, and arm away is how bright to turn on the “notify lights”. I use two Hue Go lights above my entertainment center to give us color alerts as to the status of the house. Baby blue means rain, Red means alarm is armed, etc. Armed Home sets them at 6% brightness so they aren’t bright enough to keep us up at night, but we can still see that the alarm is armed. Armed Away sets them to 100% brightness so I can see on the cameras that they are armed.

  1. I’m not sure what would cause it not to honestly, but I figured it’d be nice to know if it didn’t. I tested to make sure it works by trying to arm the alarm with an incorrect passcode.

  2. No, because I still want it to arm if we forget to close a window or door, or if any of the sensors are unavailable.

1 Like

Hello Justin,
I just want to thank you for your sharing.
I am new in HA (2-3 months now) and I made the choice to use ONLY node-red for automations.
So your baseline for all these alarm settings in node-red is a great place to start.
I am still going through all the discussion and I will not hesitate to share any constructive idea…

Sincerely, Vincent

here is my home alarm system, still working on it. So far I am using an input_boolean switch in home assistant, which is exported to iOS home app as a switch to arm and disarm the alarm.

I also have a Siren attached to a Zigbee outlet also exported to iOS home app.

when I arm the alarm with a switch, ''current state" node allows sensor outputs to reach siren which sound for 15min then turns off.

water leak sensors bypass the switch and directly connected to the siren since I want them to sound siren regardless the alarm state.

I have push notifications set up with “notify” service for each alarm state and siren state.

Here comes the tricky part. I have no knowledge of programming except what I read here so my way of doing things probably is the stupidest and longest way, I am aware of it but I can’t write any function and hell don’t even know how to fill the information for 80% of nodes to make it work.

I take nodes that I can at least somewhat understand what to fill and try every possible combination until it works. I spend 2h trying to figure out how to use “and/or/nor/xor” Boolean logic gate nodes but for the love of god couldn’t make it work.

Thats how I did the “if sensor is in open position when armed, disarm the alarm and notify which sensor is open” in a novice way:

“Trigger state” node is checking outputs of “Alarm arm” switch and 'binary.contact_sensor" and only outputting “true” if both are true at the same time and notifies you the message you want + disarming the alarm. if those 2 conditions aren’t met then node doesn’t do any action but push notification, and alarm is armed anyway.

For the reasons stated above (being novice) I couldn’t get the other output of ‘‘trigger state’’ (blocked) node to trigger the next node which notifies you the ‘‘alarm is armed’’ even if I tried to set a custom output inside that node. so I used a change node to turn ‘‘blocked’’ output ''on" output so notify node can work.

Hope this can help people who are like me. However, If you have any suggestions how to make what I made in 1000 steps in a much simpler way I am open to suggestions :slight_smile:

Edit: Ok I found out about subflows and here is the simplified version:

This has been great for me, been testing it for a few day now and everything seems to be running smoothly. In the coming weeks i’ll hook up the old alarm siren with this and start implementing it properly.

The next step is to get the wife to start using it. That’s a whole new ball game :rofl:
Has anyone used an actual alarm sound, beeping or along those lines to show its being armed rather than the google voice. Looking into that at the minute by casting a mp3 hosted on sound cloud or locally via home assistants media browser? Though not there yet.

I use a simple plug in siren with a smart switch.

Electronic Alarm Siren Horn 120dB Indoor/Outdoor Security Siren for Home Security System 30W DC 12V 1.1Ah 8 X 5.5 X 9Inch https://www.amazon.ca/dp/B07ZRHD73Y/ref=cm_sw_r_cp_api_i_Y3ZbGb16PE5Z4

They are very loud. It’s not a speaker. It emits alarm sound.

That looks like a beast of a siren. Decent price too. Be even better if it made the air raid nose, definitly get the neighbours out to check on the noise.

I have alarm system already in the house with the siren already wired in, that should work, just need a relay. hooked into it.

Hi PickleSlice
Was adding the Alarm_Control_Panel and using automation.yaml, and it worked, but the from day to day or I was starting the Automation Editor, and then it diden’t work.
After 5. try I was MAD on Automation Editor…

Then I was looking on this and Node Red, I have added the Test (Arm/Disarm) works well, but my question is… your “Input”, “Output” and “Status” box, where did you get that, so when i press the “automation” then I can see the status inside the “output” box ?

@PickleSlice

Its flow is very good, but I couldn’t make it work on mine

@PickleSlice Thanks for sharing this. Great starting point for my alarm setup and working well so far.

If I want to have different Alarm Triggers depending on the Alarm Status eg. Arm Home, Arm Away. How would you recommend doing this. Would I modify the Alarm Triggers Subflow and add a Current State Node at the start which then feeds to a switch? Or would you recommend a different way?

Also is there a way for certain sensors to allow a delay time but the rest just instantly set the alarm to triggered. eg. you walk through front door you have 20 seconds to turn the alarm off, if you walk through back door the alarm goes off.

@Kermit Thanks for the code! When I try this at home I have to adapt it as I’m not using the core telegram bot but the node red contrib one. So I tried to use a function node with

let payload = {chatId: xxxxxxxxxx,type: "message",content: $count(open) > 0 ? "Der Alarm wurde aktiviert, aber folgende Fenster/Türen sind noch offen: " & $join(open.attributes.friendly_name, ", ") & "." : "Der Alarm wurde aktiviert."}
return {payload}

But what comes back is

"ReferenceError: $count is not defined (line 1, col 60)"

Do you have a hint for me what I am doing wrong?

Great job, @PickleSlice btw! :wink:

@PickleSlice - thanks for this - its ticked many boxes (and also made quite alot of changes etc :slight_smile: )

One thing i am struggling with though, which you or somone else may be able to help me out with?

1 - Setting Home & Away and Home & Armed with different sensors?
For example - Home & Away should use motion and door sensors, to trigger the alarm, however Home & Armed should only use the door sensors.

I have tried multiple ways but just cant seem to figure it out.

2 - This prob isnt relevant an deserves a new post - however i have integrated alexa which works great - however when the alarm is pending - i wanted to make a sound from to alert me to disarm the alarm. I assume i would just need to put a new state in the flow to show pending?

Thanks for sharing the above to, its really helped with the design.

@PickleSlice First of all thank you very much for sharing your alarm setup.

In an earlier post, you wrote that a lot has changed over the months/years. Can you do an update on your post or blog and notify us in the forum? I’m eager to see what you have changed and have used quite a lot of your examples altogether in my setup.

Alarm wise, you are one of the only ones that exactly uses Node Red fully for Alarm automation, so a lot of people will be interested. I’m sure of that!

I would like to arm my alarm using envisalink from Node Red but sending string “0331xxxx” does not seem to do anything. Can anyone post a flow (code redacted) that they have which is working? Maybe my problem…Do I need to set-up yaml configuration to be able to use the envisalink add on in Node-red? Maybe my syntax is wrong for the injection node?

I’m glad this has been so helpful to everyone. I’ve gotten multiple direct messages asking for an update on my alarm. It’s become a big and complicated monster over the years, but I’ll definitely see if I can pull some more flows out of it and share.

So I’ll just start sharing different portions of my alarm system in pieces. Here is a small flow that changes two Hue Go lights on my entertainment center so that we know what status the alarm is in.

image

[{"id":"e89fc387a6f9edf3","type":"subflow","name":"Armed lights RED (2)","info":"","category":"","in":[{"x":40,"y":180,"wires":[{"id":"4cbc874706d74cbd"}]}],"out":[{"x":480,"y":40,"wires":[{"id":"1bd6d8c9ed4a1660","port":0}]},{"x":480,"y":320,"wires":[{"id":"75daa462dadb05ed","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"07d6511179c313d3","type":"api-call-service","z":"e89fc387a6f9edf3","name":"Go 1 and 2 on, RED 10%","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.hue_go_1","light.hue_go_2"],"data":"{\"brightness_pct\":10,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":570,"y":120,"wires":[["8c7ad4aebb56514e"]]},{"id":"75daa462dadb05ed","type":"api-current-state","z":"e89fc387a6f9edf3","name":"Go 2 on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_2","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":300,"wires":[[],["dc96a807c5b5b9db"]]},{"id":"8c7ad4aebb56514e","type":"delay","z":"e89fc387a6f9edf3","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":760,"y":120,"wires":[["1bd6d8c9ed4a1660"]]},{"id":"1bd6d8c9ed4a1660","type":"api-current-state","z":"e89fc387a6f9edf3","name":"Go 2 on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_2","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":60,"wires":[[],["07d6511179c313d3"]]},{"id":"4cbc874706d74cbd","type":"time-range-switch","z":"e89fc387a6f9edf3","name":"9p to 5a","lat":"27.918805","lon":"-81.866830","startTime":"21:00","endTime":"05:00","startOffset":0,"endOffset":0,"x":140,"y":180,"wires":[["1bd6d8c9ed4a1660","522360e5c87f098a"],["75daa462dadb05ed","782c44799d0946b7"]]},{"id":"b0e6472c35c1e902","type":"delay","z":"e89fc387a6f9edf3","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":780,"y":240,"wires":[["75daa462dadb05ed"]]},{"id":"dc96a807c5b5b9db","type":"api-call-service","z":"e89fc387a6f9edf3","name":"Go 1 and 2 on, RED 100%","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.hue_go_1","light.hue_go_2"],"data":"{\"brightness_pct\":100,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":580,"y":240,"wires":[["b0e6472c35c1e902"]]},{"id":"782c44799d0946b7","type":"api-current-state","z":"e89fc387a6f9edf3","name":"Go 1 on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_1","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":220,"wires":[[],["dc96a807c5b5b9db"]]},{"id":"522360e5c87f098a","type":"api-current-state","z":"e89fc387a6f9edf3","name":"Go 1 on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_1","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":360,"y":140,"wires":[[],["07d6511179c313d3"]]},{"id":"3321e5b4f7ae98d4","type":"subflow","name":"Triggered lights red - 100% (2)","info":"","category":"","in":[{"x":0,"y":100,"wires":[{"id":"6a19a4bc17160eca"}]}],"out":[{"x":360,"y":180,"wires":[{"id":"6a19a4bc17160eca","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"6a19a4bc17160eca","type":"api-call-service","z":"3321e5b4f7ae98d4","name":"Armed lights on, RED 100%","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.hue_go_1","light.hue_go_2"],"data":"{\"brightness_pct\":100,\"transition\":1.5,\"rgb_color\":[255,0,0]}","dataType":"json","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","x":200,"y":100,"wires":[["5282b89ca3b63304"]]},{"id":"5282b89ca3b63304","type":"delay","z":"3321e5b4f7ae98d4","name":"2sec","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":390,"y":100,"wires":[["3e7196afdf24b4c9","9b97d4fd4aebdd75"]]},{"id":"9b97d4fd4aebdd75","type":"api-current-state","z":"3321e5b4f7ae98d4","name":"Armed lights on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":550,"y":160,"wires":[[],["6a19a4bc17160eca"]]},{"id":"3e7196afdf24b4c9","type":"api-current-state","z":"3321e5b4f7ae98d4","name":"Armed lights on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":550,"y":40,"wires":[[],["6a19a4bc17160eca"]]},{"id":"4e9292fe507fe030","type":"subflow","name":"Turn off armed lights (2)","info":"","category":"","in":[{"x":20,"y":80,"wires":[{"id":"57dc44b4ba4a6324"}]}],"out":[{"x":180,"y":140,"wires":[{"id":"4e9292fe507fe030","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"57dc44b4ba4a6324","type":"api-call-service","z":"4e9292fe507fe030","name":"Turn off triggered lights","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.tv_strip","light.hue_go_1","light.hue_go_2"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":260,"y":80,"wires":[["c55e7d78c623576c"]]},{"id":"c55e7d78c623576c","type":"delay","z":"4e9292fe507fe030","name":"2sec","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":430,"y":80,"wires":[["2c14d4b74bddb05f","6eb32436a78059a0"]]},{"id":"6eb32436a78059a0","type":"api-current-state","z":"4e9292fe507fe030","name":"Armed lights on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_1","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":670,"y":140,"wires":[["57dc44b4ba4a6324"],[]]},{"id":"2c14d4b74bddb05f","type":"api-current-state","z":"4e9292fe507fe030","name":"Armed lights on?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.hue_go_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":670,"y":40,"wires":[["57dc44b4ba4a6324"],[]]},{"id":"4d99968276f54a25","type":"server-state-changed","z":"5f5b2ee4.811bd","name":"Armed State","server":"26956a45.92d866","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"alarm_control_panel.home_alarm","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"for":"0","forType":"num","forUnits":"minutes","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":490,"y":2740,"wires":[["9e3ea8615e4780b3","8db43c466f4d6987"]]},{"id":"bc79816bc0f7073b","type":"comment","z":"5f5b2ee4.811bd","name":"Home Alarm lights","info":"The poll state node checks the alarm status every 30 minutes and, if the alarm is armed and the armed lights are off, to turn on the amred lights. ","x":510,"y":2640,"wires":[]},{"id":"9e3ea8615e4780b3","type":"switch","z":"5f5b2ee4.811bd","name":"State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"disarmed","vt":"str"},{"t":"eq","v":"triggered","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":670,"y":2740,"wires":[["d93fba98a7e31fa4"],["545233f279f2be28"]]},{"id":"d93fba98a7e31fa4","type":"subflow:4e9292fe507fe030","z":"5f5b2ee4.811bd","name":"Turn off armed lights","env":[],"x":900,"y":2740,"wires":[[]]},{"id":"545233f279f2be28","type":"subflow:3321e5b4f7ae98d4","z":"5f5b2ee4.811bd","name":"Triggered lights - 100%","env":[],"x":910,"y":2800,"wires":[[]]},{"id":"1514ae3ffa7217fa","type":"subflow:e89fc387a6f9edf3","z":"5f5b2ee4.811bd","name":"Armed lights RED","env":[],"x":890,"y":2680,"wires":[[],[]],"outputLabels":["10%","100%"]},{"id":"8db43c466f4d6987","type":"switch","z":"5f5b2ee4.811bd","name":"State","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"armed_home","vt":"str"},{"t":"eq","v":"armed_away","vt":"str"},{"t":"eq","v":"armed_night","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":670,"y":2680,"wires":[["1514ae3ffa7217fa"],["1514ae3ffa7217fa"],["1514ae3ffa7217fa"]]},{"id":"b91825128e80f438","type":"poll-state","z":"5f5b2ee4.811bd","name":"Poll alarm state","server":"26956a45.92d866","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"30","updateIntervalType":"num","updateIntervalUnits":"minutes","outputinitially":true,"outputonchanged":false,"entity_id":"alarm_control_panel.home_alarm","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":500,"y":2680,"wires":[["8db43c466f4d6987"]]},{"id":"26956a45.92d866","type":"server","name":"Hass.io","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

This is a flow that sets the alarm for the night at 10:30pm, and a watchdog that checks every 30 minutes to make sure it’s armed.

[{"id":"be70b3ae427e7db0","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Lock Front Door","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"lock","service":"lock","areaId":[],"deviceId":[],"entityId":["lock.front_door_lock"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1200,"y":2780,"wires":[[]]},{"id":"3658e463f00e64fb","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Front Door Unlocked?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"unlocked","halt_if_type":"str","halt_if_compare":"is","entity_id":"","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":980,"y":2780,"wires":[["be70b3ae427e7db0"],[]]},{"id":"c96848fc81e32065","type":"time-range-switch","z":"5f5b2ee4.811bd","name":"11p - 4:30a","lat":"28.06989","lon":"-81.95686","startTime":"23:00","endTime":"04:30","startOffset":0,"endOffset":0,"x":690,"y":2840,"wires":[["30b7f542bccb8958","57725e1d95368606","3658e463f00e64fb"],[]]},{"id":"b15c459084e7b0af","type":"inject","z":"5f5b2ee4.811bd","name":"Every 30mins","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":true,"onceDelay":"5","topic":"","payload":"","payloadType":"str","x":520,"y":2840,"wires":[["c96848fc81e32065"]]},{"id":"4f76ef5a989da228","type":"inject","z":"5f5b2ee4.811bd","name":"10:30pm","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 22 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":700,"y":2720,"wires":[["30b7f542bccb8958","57725e1d95368606","be70b3ae427e7db0"]]},{"id":"57725e1d95368606","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Turn on night boolean","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_on","areaId":[],"deviceId":[],"entityId":["input_boolean.night_routine_boolean"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":980,"y":2840,"wires":[[]]},{"id":"30b7f542bccb8958","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Alarm Armed Night?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"armed_night","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.home_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":980,"y":2720,"wires":[[],["191cdfc643af8d6a"]]},{"id":"191cdfc643af8d6a","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Arm Night","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_arm_night","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.home_alarm"],"data":"{\"code\":\"5849\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":1160,"y":2720,"wires":[[]]},{"id":"26956a45.92d866","type":"server","name":"Hass.io","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

This flow disarms the alarm at 5 am and sends the payload every 5 minutes until 6 am to ensure the alarm disarms properly.

[{"id":"f788fd1b8a5f07f0","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Disarm Home","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_disarm","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.home_alarm"],"data":"{\"code\":\"5849\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":740,"y":2500,"wires":[["9b5a41d5987140d3"]]},{"id":"be4a44fe17e4953f","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Alarm Status","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"armed_night","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.home_alarm","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":550,"y":2500,"wires":[["f788fd1b8a5f07f0"],[]]},{"id":"9b5a41d5987140d3","type":"delay","z":"5f5b2ee4.811bd","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":740,"y":2560,"wires":[["be4a44fe17e4953f"]]},{"id":"39bd1d2149f95e1b","type":"inject","z":"5f5b2ee4.811bd","name":"5-6am","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"*/5 5 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":180,"y":2500,"wires":[["3b9e8d3038157e2d"]]},{"id":"3b9e8d3038157e2d","type":"time-range-switch","z":"5f5b2ee4.811bd","name":"","lat":"28.06989","lon":"-81.95686","startTime":"05:00","endTime":"09:00","startOffset":0,"endOffset":0,"x":330,"y":2500,"wires":[["be4a44fe17e4953f"],[]]},{"id":"26956a45.92d866","type":"server","name":"Hass.io","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
1 Like

Here is a flow that arms and disarms based on a users location in relation to home. This particular flow uses Life360, but anything that tracks the users location can be used.

[{"id":"a2e525de083ac0f9","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Alarm armed away?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"armed_away","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.home_alarm","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":920,"y":3560,"wires":[[],["4c33cd9356a135b2"]],"outputLabels":["yes","no"]},{"id":"51a7e521db9c86e6","type":"delay","z":"5f5b2ee4.811bd","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1120,"y":3620,"wires":[["a2e525de083ac0f9"]]},{"id":"4c33cd9356a135b2","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Arm alarm away","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_arm_away","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.home_alarm"],"data":"{\"code\":\"5849\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1120,"y":3560,"wires":[["51a7e521db9c86e6"]]},{"id":"61e94bc2875c5642","type":"comment","z":"5f5b2ee4.811bd","name":"**Home Routine________________________________________________________________________________________________________________________","info":"","x":690,"y":3680,"wires":[]},{"id":"e123373155368dbd","type":"api-call-service","z":"5f5b2ee4.811bd","name":"Disarm Alarm","server":"26956a45.92d866","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_disarm","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.home_alarm"],"data":"{\"code\":\"5849\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":540,"y":3720,"wires":[[]]},{"id":"76c4340bfa4f5beb","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Ava Home?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"device_tracker.life360_ava","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":710,"y":3560,"wires":[["a2e525de083ac0f9"],["a2e525de083ac0f9"]]},{"id":"6350899904639878","type":"api-current-state","z":"5f5b2ee4.811bd","name":"Family Home?","server":"26956a45.92d866","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"group.family","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":0,"forType":"num","forUnits":"minutes","x":540,"y":3560,"wires":[[],["76c4340bfa4f5beb"]]},{"id":"f13a773e8c805d24","type":"server-state-changed","z":"5f5b2ee4.811bd","name":"Justin Presence","server":"26956a45.92d866","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"device_tracker.life360_justin","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"home","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":240,"y":3560,"wires":[["6350899904639878"],["e123373155368dbd"]]},{"id":"ee55192cc5ffdbde","type":"comment","z":"5f5b2ee4.811bd","name":"**Away Routine________________________________________________________________________________________________________________________","info":"","x":690,"y":3520,"wires":[]},{"id":"26956a45.92d866","type":"server","name":"Hass.io","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]