[Custom Component] Alarmo - browser managed alarm system

Just wanted to say thank you for this add-on

2 Likes

Hi guys, happy 2021 to all!

Sorry about the lack of updates lately. Rest assured, I havenā€™t abandoned this project.
Allow me to give you a small update:

Currently Iā€™m working on adding the possibility for creating areaā€™s in Alarmo.
This will allow you to divide your house/mansion/palace in multiple compartments, where each has its own set of sensors / delay times / automations and can be armed separately.

The change is quite big as it effectively creates multiple independent alarm_control_panel entities, I had to restructurize a lot of things to make this possible.
On top of it all there will be the option for enabling a ā€˜masterā€™ entity (still looking for a good name), which can be used to arm/disarm all areaā€™s synchronously, and reports the overall status.

I got things mostly working, but I still need to make some adjustments to the GUI to make things configurable and organized, conduct some corner-case testing and provide a way for upgrading existing configurations to this version.
Iā€™m guessing this will take me one or two weeks moreā€¦ :blush:

15 Likes

I feel really stupid, but I canā€™t find a way to run/configure this CC.
I installed it, and itā€™s here:

But all I got now is this:

Where to go on from here?? All these different ways of configuration of HA is quite hard to follow.

Try clicking here:

Its in the menu on the left.

NOW i feed really stupid LOL
Thanks

Hey,
So Iā€™ve tried to implement this, but unfortunately itā€™s still not working as I would like it to.
Basically, I have remotes and presence detection that arm the alarm when Iā€™m already out of the house.
Sometimes Iā€™m 2 minutes up the road (plus the delay) when the alarm is activated. However, if there is a sensor opened, its a PITA.

Again, is there a way that I can send an ā€œoverrideā€ in an automation that will bypass the delay?

Perhaps even the option to check for open sensors PRIOR to going into ā€œarmingā€ state".

I didnā€™t mean an actual code, but if I armed the BWALARM with {ā€œcodeā€:ā€œoverrideā€} in the data, it would simply override any arming delays.

I hope Iā€™m making sense.

Otherwise, been using Alarmo for weeks now and its been working flawlessly. Just a few little things that would really make it supremo for my use case.

Thanks again.

Wow that sounds like a lot of work. Hope thatā€™ll turn out as you plan to !

Iā€™ve been using Alarmo now for a couple of months and it works great. Iā€™m entirely happy with it, thanks so much for this nice integration :grinning:

Thank you! I was feeling too stupid to ask

+1
Very happy. Working great here. Main use for two HA I run on two houses. Thanks a lot. :grinning:
Different areas will take you a lot of work. Most people donā€™t need it. Not sure if it is worth, but good luck, mate

I totally agree

Iā€™m also happy with the existing Alarmo functionality (and once a little bug regarding the reporting of open sensors is fixed it will be perfect for my needs.)
For me the zones feature is not needed, but I can imagine that this is a fairly general need, and it makes sense to me to have this at the top of the priority list for new features (or perhaps Iā€™m not creative enough :smiley: , do any of you have great ideas for features that would help a lot of people?).

Personally I am simply abusing the armed home and armed night modes to create different areas in my home that are armed or not. But if the zones feature is developed, I might redevelop my automations around alarmo to use this new functionality.

The multiple area feature was requested by a couple of users.
I think itā€™s pretty useful in case you have a garage, which requires different delay settings than the rest of the house.
Once itā€™s in place I will start using it too for that purpose.
I understand it can be complete overkill for some/many users, I am designing things for maintaining backwards compatibility.
I prioritized this feature since it required quite some architectural changes, not because I think other items are less important.

Thanks for all the positive feedback!

2 Likes

@neliss I just wanted to thank you for this project. I tried a lot of stuff to get the stock alarm to work well with my setup and HomeKit. While the basic setup technically worked, I wanted to get some additional information out of it. My attempts at creating a working template sensor for the manual integration failed, when I saw this custom component mentioned on the Average Automation youtube channel. It worked perfectly! letting me easily setup a sensor that I could pass to HomeKit, which allows me to then play an alarm sound on my AirPlay devices. Thanks again for the impressive work. Future plans on my end include keypads or tablets at all the entry doors.

1 Like

This is great news! I currently have my hard-wired commercial alarm system setup in this way so that my two sheds are in a second ā€˜areaā€™ allowing me to arm/disarm those independently from the house. Hopefully this added feature will allow proper integration with HA.

Not to knock any additional flexibility with areas, but how is this abuse? Thatā€™s exactly what armed_home and armed_night modes are for.

You might be right :slight_smile:

Hey, any chance you can share your flow please? I am also using Node-Red and would love to utilise the open sensors myself. Thanks.

Iā€™ll try to do it in about ten hours from now. If I forget send me a reminder :smiley:

OK so here are the node red sequences you asked for.
explanation in next post due to character limit :wink:

[{"id":"45ba7ca2.2877d4","type":"subflow","name":"notifications","info":" - msg.imageretrieveURL: if you want to send for example a screenshot of a security camera\r\n \r\n- msg.NotifyType: allowing you to specify whether it is a security notification (fire/burglar so high priority notification. The built in functionality of using the alarm_stream_max channel does not have any effect fo me, so I created my own logic that overrides do not disturb and silent mode and sets a long and annoying buzzer), a text to speech notification, a normal notification, or both.\r\n\r\n - msg.title: the title of the notification\r\n\r\n - msg.message: the message of the notification\r\n\r\n - msg.TTSmessage: the message for the text to speech notification to say\r\n \r\n- msg.who: who needs to receive the message. for example ā€œjohn&janeā€ would result in both receiving the notifications. It expects that in the android HA companion app the names set are in the format ā€œmobile janeā€.\r\n\r\n - msg.actioncode1 2 & 3: the action code that will be sent back\r\n \r\n- msg.actiontitle1 2 & 3: the action button that will appear in the notification.\r\n \r\n - msg.clickaction: what will happen when you click the notification","category":"","in":[{"x":20,"y":60,"wires":[{"id":"341e956d.75e64a"}]}],"out":[],"env":[],"color":"#DDAA99"},{"id":"707a3c93.417354","type":"split","z":"45ba7ca2.2877d4","name":"split for addressees","splt":"&","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"who","x":370,"y":60,"wires":[["50666e35.e9e42"]]},{"id":"3a8152a0.79cb4e","type":"change","z":"45ba7ca2.2877d4","name":"Prepare split","rules":[{"t":"set","p":"payload2","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"who","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":60,"wires":[["707a3c93.417354"]]},{"id":"50666e35.e9e42","type":"change","z":"45ba7ca2.2877d4","name":"finish split & calculate delay","rules":[{"t":"set","p":"who","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload2","tot":"msg"},{"t":"set","p":"delay","pt":"msg","to":"parts.index*6000","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":600,"y":60,"wires":[["2f957901.7e2a96"]]},{"id":"e1bea19c.d01de","type":"api-current-state","z":"45ba7ca2.2877d4","name":"store ringermode","server":"5c29d263.09d2ac","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.mobile_{{who}}_ringer_mode","state_type":"str","state_location":"ringermode","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":610,"y":240,"wires":[["46c35eeb.8560d"]]},{"id":"c235356e.f0b738","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Set ringer mode normal","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_ringer_mode\",\"title\":\"normal\",\"data\":{\"importance\":\"high\",\"priority\":\"high\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1090,"y":240,"wires":[["1482a438.444fcc"]]},{"id":"d0f7dd0c.4f3f1","type":"stoptimer","z":"45ba7ca2.2877d4","duration":"1","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":780,"y":300,"wires":[["bbed25b3.baf8c8"],[]]},{"id":"26cba22.5a4965e","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Restore ringer mode","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_ringer_mode\",\"title\":\"{{ringermode}}\",\"data\":{\"importance\":\"high\",\"priority\":\"high\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":740,"y":380,"wires":[["9bae94ad.927d28"]]},{"id":"7a48c152.2d55a","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Notify","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"title\":\"{{title}}\",\"message\":\"{{message}}\",\"data\":{\"ttl\":0,\"importance\":\"high\",\"priority\":\"high\",\"vibrationPattern\":\"300, 500, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100, 1000, 100\",\"channel\":\"alarm_stream\",\"image\":\"{{{imageretrieveURL}}}\",\"timeout\":\"{{timeout}}\",\"clickAction\":\"{{{clickaction}}}\",\"actions\":[{\"action\":\"{{actioncode1}}\",\"title\":\"{{actiontitle1}}\"},{\"action\":\"{{actioncode2}}\",\"title\":\"{{actiontitle2}}\"},{\"action\":\"{{actioncode3}}\",\"title\":\"{{actiontitle3}}\"}]}}","dataType":"json","mergecontext":"","output_location":"outputtext","output_location_type":"msg","mustacheAltTags":false,"x":349,"y":380,"wires":[["49ed9464.49b89c"]]},{"id":"49ed9464.49b89c","type":"stoptimer","z":"45ba7ca2.2877d4","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":540,"y":380,"wires":[["26cba22.5a4965e"],[]]},{"id":"46c35eeb.8560d","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Set alarm stream volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":20,\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"alarm_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":838,"y":240,"wires":[["c235356e.f0b738"]]},{"id":"1482a438.444fcc","type":"api-current-state","z":"45ba7ca2.2877d4","name":"store mediavolume","server":"5c29d263.09d2ac","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.mobile_{{who}}_volume_level_music","state_type":"str","state_location":"mediavolume","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":390,"y":300,"wires":[["76d4c249.b34e9c"]]},{"id":"76d4c249.b34e9c","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Set media volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":20,\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"music_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":300,"wires":[["d0f7dd0c.4f3f1"]]},{"id":"bbed25b3.baf8c8","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Notify Text to speech","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\t   \"title\": \"{{TTSmessage}}\",\t   \"message\": \"TTS\",\t   \"data\": {\t       \"ttl\": 0,\t       \"importance\": \"high\",\t       \"priority\": \"high\"    \t   }\t}","dataType":"json","mergecontext":"","output_location":"outputtts","output_location_type":"msg","mustacheAltTags":false,"x":980,"y":300,"wires":[["7a48c152.2d55a"]]},{"id":"9bae94ad.927d28","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Restore media volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":\"{{mediavolume}}\",\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"music_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":959,"y":380,"wires":[[]]},{"id":"453592cb.a7320c","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Turn off Do Not Disturb","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_dnd\",\"title\":\"off\",\"data\":{\"importance\":\"high\",\"priority\":\"high\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":240,"wires":[["e1bea19c.d01de"]]},{"id":"259b81df.21d27e","type":"switch","z":"45ba7ca2.2877d4","name":"NotifyType","property":"NotifyType","propertyType":"msg","rules":[{"t":"eq","v":"security","vt":"str"},{"t":"eq","v":"TTSandNormal","vt":"str"},{"t":"eq","v":"normal","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":130,"y":260,"wires":[["453592cb.a7320c"],["59d1ba01.956544","e26a2940.29f7d8"],["59d1ba01.956544"],["59d1ba01.956544"]]},{"id":"f5be1950.ec8ec8","type":"api-current-state","z":"45ba7ca2.2877d4","name":"store mediavolume","server":"5c29d263.09d2ac","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.mobile_{{who}}_volume_level_music","state_type":"str","state_location":"mediavolume","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":490,"y":520,"wires":[["afd41645.fb41d8"]]},{"id":"7b941810.25d7b8","type":"stoptimer","z":"45ba7ca2.2877d4","duration":"1","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":360,"y":580,"wires":[["54268b9.01de874"],[]]},{"id":"f695c209.ffbd7","type":"stoptimer","z":"45ba7ca2.2877d4","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":760,"y":580,"wires":[["472e51dc.29c68"],[]]},{"id":"afd41645.fb41d8","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Set media volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":20,\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"music_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":690,"y":520,"wires":[["7b941810.25d7b8"]]},{"id":"54268b9.01de874","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Notify Text to speech","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"title\":\"{{TTSmessage}}\",\"message\":\"TTS\",\"data\":{\"ttl\":0,\"importance\":\"high\",\"priority\":\"high\"}}","dataType":"json","mergecontext":"","output_location":"aaa","output_location_type":"msg","mustacheAltTags":false,"x":560,"y":580,"wires":[["f695c209.ffbd7"]]},{"id":"472e51dc.29c68","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Restore media volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":\"{{mediavolume}}\",\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"music_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":580,"wires":[[]]},{"id":"e26a2940.29f7d8","type":"api-current-state","z":"45ba7ca2.2877d4","name":"silent?","server":"5c29d263.09d2ac","version":1,"outputs":2,"halt_if":"normal","halt_if_type":"str","halt_if_compare":"is_not","override_topic":false,"entity_id":"sensor.mobile_{{who}}_ringer_mode","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":330,"y":520,"wires":[[],["f5be1950.ec8ec8"]]},{"id":"59d1ba01.956544","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Set notification stream volume","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"message\":\"command_volume_level\",\"title\":20,\"data\":{\"importance\":\"high\",\"priority\":\"high\",\"channel\":\"notification_stream\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":390,"y":720,"wires":[["d8943f4a.c294d"]]},{"id":"556f323d.c3336c","type":"comment","z":"45ba7ca2.2877d4","name":"Normal stream","info":"","x":420,"y":680,"wires":[]},{"id":"17e380.ab013c8","type":"switch","z":"45ba7ca2.2877d4","name":"TTS set?","property":"TTSmessage","propertyType":"msg","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":120,"wires":[["a7ad65e6.038ec8"],["259b81df.21d27e"]]},{"id":"a7ad65e6.038ec8","type":"change","z":"45ba7ca2.2877d4","name":"Set TTS","rules":[{"t":"set","p":"TTSmessage","pt":"msg","to":"title&\" \"&message","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":120,"wires":[["259b81df.21d27e"]]},{"id":"d8943f4a.c294d","type":"api-call-service","z":"45ba7ca2.2877d4","name":"Notify","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_mobile_{{who}}","entityId":"","data":"{\"title\":\"{{title}}\",\"message\":\"{{message}}\",\"data\":{\"ttl\":0,\"importance\":\"high\",\"priority\":\"high\",\"vibrationPattern\":\"100, 1000, 100, 1000, 100\",\"timeout\":\"{{timeout}}\",\"clickAction\":\"{{{clickaction}}}\",\"actions\":[{\"action\":\"{{actioncode1}}\",\"title\":\"{{actiontitle1}}\"},{\"action\":\"{{actioncode2}}\",\"title\":\"{{actiontitle2}}\"},{\"action\":\"{{actioncode3}}\",\"title\":\"{{actiontitle3}}\"}]}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":720,"wires":[[]]},{"id":"5eb89b90.18d424","type":"comment","z":"45ba7ca2.2877d4","name":"TTS stream","info":"","x":470,"y":480,"wires":[]},{"id":"7fbdc94a.b08ae8","type":"comment","z":"45ba7ca2.2877d4","name":"security stream","info":"","x":620,"y":200,"wires":[]},{"id":"2f957901.7e2a96","type":"delay","z":"45ba7ca2.2877d4","name":"wait until time","pauseType":"delayv","timeout":"0","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":160,"y":120,"wires":[["17e380.ab013c8"]]},{"id":"341e956d.75e64a","type":"switch","z":"45ba7ca2.2877d4","name":"Who set?","property":"who","propertyType":"msg","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":180,"y":20,"wires":[["90daac93.e601"],["3a8152a0.79cb4e"]]},{"id":"90daac93.e601","type":"change","z":"45ba7ca2.2877d4","name":"Set who","rules":[{"t":"set","p":"who","pt":"msg","to":"john&jane","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":20,"wires":[["3a8152a0.79cb4e"]]},{"id":"8f604079.8e279","type":"switch","z":"c9d8b497.48e108","name":"takeSnapshot?","property":"cameraentity","propertyType":"msg","rules":[{"t":"cont","v":"camera","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":500,"y":2840,"wires":[["f910c2a0.67df5"],["5de702f0.0a2fec"]]},{"id":"2640ae4f.204a62","type":"change","z":"c9d8b497.48e108","name":"IdentifySensor&MapSensorsToCameras","rules":[{"t":"set","p":"triggeredsensor","pt":"msg","to":"$keys(data.new_state.attributes.open_sensors)","tot":"jsonata"},{"t":"set","p":"cameraentity","pt":"msg","to":"triggeredsensor","tot":"msg"},{"t":"change","p":"cameraentity","pt":"msg","from":"binary_sensor.inkom_pir_alarm","fromt":"str","to":"camera.nas_inkom","tot":"str"},{"t":"change","p":"cameraentity","pt":"msg","from":"binary_sensor.garage_pir_alarm","fromt":"str","to":"camera.nas_garage","tot":"str"},{"t":"change","p":"cameraentity","pt":"msg","from":"binary_sensor.camera_gang_verdiep_pir_alarm","fromt":"str","to":"camera.nas_boven","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":2780,"wires":[["2a1904f2.b3f4bc"]]},{"id":"f910c2a0.67df5","type":"api-call-service","z":"c9d8b497.48e108","name":"Take snapshot","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"camera","service":"snapshot","entityId":"{{cameraentity}}","data":"{\"filename\":\"{{{imagestoreURL}}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":700,"y":2840,"wires":[["a8abf60b.43c838"]]},{"id":"885de277.724d9","type":"subflow:45ba7ca2.2877d4","z":"c9d8b497.48e108","name":"","env":[],"x":930,"y":2900,"wires":[]},{"id":"59b229df.40f3e8","type":"change","z":"c9d8b497.48e108","name":"Define parameters","rules":[{"t":"set","p":"entityid","pt":"msg","to":"data.entity_id","tot":"jsonata"},{"t":"set","p":"friendlyname","pt":"msg","to":"data.attributes.friendly_name","tot":"jsonata"},{"t":"set","p":"timestamp","pt":"msg","to":"$now('[Y0001][M01][D01] [H01][m01][s01]', '+0100')","tot":"jsonata"},{"t":"set","p":"imagestoreURL","pt":"msg","to":"\"/config/www/\"&friendlyname&timestamp&\".jpg\"","tot":"jsonata"},{"t":"set","p":"imageretrieveURL","pt":"msg","to":"\"https://ha.chooseyourURL.com/local/\"&friendlyname&timestamp&\".jpg\"","tot":"jsonata"},{"t":"set","p":"devicetype","pt":"msg","to":"data.attributes.device_class","tot":"jsonata"},{"t":"set","p":"NotifyType","pt":"msg","to":"security","tot":"str"},{"t":"set","p":"title","pt":"msg","to":"devicetype","tot":"msg"},{"t":"set","p":"message","pt":"msg","to":"friendlyname&\" kies een actie.\"","tot":"jsonata"},{"t":"set","p":"TTSmessage","pt":"msg","to":"title&\" \"&message","tot":"jsonata"},{"t":"set","p":"who","pt":"msg","to":"john&jane","tot":"str"},{"t":"set","p":"clickaction","pt":"msg","to":"/lovelace-john/cameras","tot":"str"},{"t":"set","p":"actioncode1","pt":"msg","to":"alarmo_pauze","tot":"str"},{"t":"set","p":"actiontitle1","pt":"msg","to":"Pauze30min","tot":"str"},{"t":"set","p":"actioncode2","pt":"msg","to":"alarmo_disarmmanual","tot":"str"},{"t":"set","p":"actiontitle2","pt":"msg","to":"Disarm+ntAutoMode","tot":"str"},{"t":"set","p":"actioncode3","pt":"msg","to":"alarmo_rearm","tot":"str"},{"t":"set","p":"actiontitle3","pt":"msg","to":"Ignore+Rearm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":2780,"wires":[["8f604079.8e279"]]},{"id":"9ece9f11.df6ba","type":"server-state-changed","z":"c9d8b497.48e108","name":"Alarm pending","server":"5c29d263.09d2ac","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"alarm_control_panel.alarmo","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"pending","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":90,"y":2660,"wires":[["d46ca9ff.2acad8","2640ae4f.204a62"],[]]},{"id":"2a1904f2.b3f4bc","type":"api-current-state","z":"c9d8b497.48e108","name":"get friendly name","server":"5c29d263.09d2ac","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"{{triggeredsensor}}","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":850,"y":2780,"wires":[["59b229df.40f3e8"]]},{"id":"a8abf60b.43c838","type":"change","z":"c9d8b497.48e108","name":"add TTS suffix","rules":[{"t":"set","p":"TTSmessage","pt":"msg","to":" TTSmessage&\"en zie bijgevoegde foto\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2840,"wires":[["5de702f0.0a2fec"]]},{"id":"5de702f0.0a2fec","type":"ha-wait-until","z":"c9d8b497.48e108","name":"wait untill alarm triggered","server":"5c29d263.09d2ac","outputs":2,"entityId":"alarm_control_panel.alarmo","entityIdFilterType":"exact","property":"state","comparator":"is","value":"triggered","valueType":"str","timeout":"33","timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":690,"y":2920,"wires":[["885de277.724d9","a6af93be.4e8b6"],["b3a46147.5139f","a6af93be.4e8b6"]]},{"id":"b3a46147.5139f","type":"debug","z":"c9d8b497.48e108","name":"timed out want alarm disarmed","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":990,"y":2940,"wires":[]},{"id":"a55a1dac.8d106","type":"server-state-changed","z":"c9d8b497.48e108","name":"Alarm triggered","server":"5c29d263.09d2ac","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"alarm_control_panel.alarmo","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"triggered","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":100,"y":2720,"wires":[["6f019e39.4551b","dab94121.20b75"],[]]},{"id":"72c4a214.a2e07c","type":"gate","z":"c9d8b497.48e108","name":"block triggered if received pending","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"status","persist":false,"x":580,"y":2720,"wires":[["2640ae4f.204a62"]]},{"id":"d46ca9ff.2acad8","type":"change","z":"c9d8b497.48e108","name":"block 'triggered' messages","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"close","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":2640,"wires":[["72c4a214.a2e07c"]]},{"id":"a6af93be.4e8b6","type":"change","z":"c9d8b497.48e108","name":"allow 'triggered' messages","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"open","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":2980,"wires":[["72c4a214.a2e07c"]]},{"id":"8d4b5e25.38cd6","type":"server-state-changed","z":"c9d8b497.48e108","name":"Alarm disarmed","server":"5c29d263.09d2ac","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"alarm_control_panel.alarmo","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"disarmed","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":120,"y":3200,"wires":[["6eb88de5.4b4954"],[]]},{"id":"6eb88de5.4b4954","type":"switch","z":"c9d8b497.48e108","name":"no open sensors?","property":"$keys(data.new_state.attributes.open_sensors)","propertyType":"jsonata","rules":[{"t":"istype","v":"undefined","vt":"undefined"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":310,"y":3200,"wires":[[],["d5adff7d.ec3c5"]]},{"id":"d5adff7d.ec3c5","type":"change","z":"c9d8b497.48e108","name":"IdentifyOpenSensors","rules":[{"t":"set","p":"payload","pt":"msg","to":"$keys(data.new_state.attributes.open_sensors)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":3200,"wires":[["2481ffe8.bb5b8"]]},{"id":"2481ffe8.bb5b8","type":"split","z":"c9d8b497.48e108","name":"one msg per sensor","splt":"","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"opensensors","x":740,"y":3200,"wires":[["6e0443c.de3bebc"]]},{"id":"6e0443c.de3bebc","type":"api-current-state","z":"c9d8b497.48e108","name":"get friendly name","server":"5c29d263.09d2ac","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"{{payload}}","state_type":"str","state_location":"","override_payload":"none","entity_location":"data2","override_data":"msg","blockInputOverrides":true,"x":170,"y":3260,"wires":[["54454ba.21395b4"]]},{"id":"54454ba.21395b4","type":"change","z":"c9d8b497.48e108","name":"Define friendlyname","rules":[{"t":"set","p":"payload","pt":"msg","to":"data2.attributes.friendly_name","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":3260,"wires":[["d53ff305.e13cb"]]},{"id":"762546c1.693078","type":"change","z":"c9d8b497.48e108","name":"Define parameters","rules":[{"t":"set","p":"NotifyType","pt":"msg","to":"security","tot":"str"},{"t":"set","p":"title","pt":"msg","to":"Alarm aanzetten mislukt. ","tot":"str"},{"t":"set","p":"message","pt":"msg","to":"payload&\" zijn open. Wilt u alarm opnieuw proberen aanzetten of forceren?\"","tot":"jsonata"},{"t":"set","p":"TTSmessage","pt":"msg","to":"title&message","tot":"jsonata"},{"t":"set","p":"who","pt":"msg","to":"john&jane","tot":"str"},{"t":"set","p":"clickaction","pt":"msg","to":"/lovelace-john/cameras","tot":"str"},{"t":"set","p":"actioncode1","pt":"msg","to":"ALARMO_RETRY_ARM","tot":"str"},{"t":"set","p":"actiontitle1","pt":"msg","to":"opnieuw","tot":"str"},{"t":"set","p":"actioncode2","pt":"msg","to":"ALARMO_FORCE_ARM","tot":"str"},{"t":"set","p":"actiontitle2","pt":"msg","to":"forceer","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":3320,"wires":[["b40776f7.aed248"]]},{"id":"d53ff305.e13cb","type":"join","z":"c9d8b497.48e108","name":"friendly msgs to 1array","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":600,"y":3260,"wires":[["6d61d0c4.363a2"]]},{"id":"b7ca2e3.fb8c2d","type":"function","z":"c9d8b497.48e108","name":"array to 1 string","func":"msg.payload = msg.payload.join(\" en \");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":3320,"wires":[["762546c1.693078"]]},{"id":"b40776f7.aed248","type":"subflow:45ba7ca2.2877d4","z":"c9d8b497.48e108","name":"","env":[],"x":550,"y":3320,"wires":[]},{"id":"3b435257.d9a11e","type":"comment","z":"c9d8b497.48e108","name":"Notify Arming failed due to open sensors","info":"","x":260,"y":3160,"wires":[]},{"id":"1307525a.c0d1fe","type":"comment","z":"c9d8b497.48e108","name":"Notify Alarm triggered ","info":"","x":160,"y":2600,"wires":[]},{"id":"6d61d0c4.363a2","type":"switch","z":"c9d8b497.48e108","name":"multiple open sensors?","property":"$keys(data.new_state.attributes.open_sensors)","propertyType":"jsonata","rules":[{"t":"istype","v":"array","vt":"array"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":830,"y":3260,"wires":[["b7ca2e3.fb8c2d"],["762546c1.693078"]]},{"id":"6f019e39.4551b","type":"change","z":"c9d8b497.48e108","name":"stop loop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":2780,"wires":[["25c5423f.1a003e"]]},{"id":"25c5423f.1a003e","type":"ha-wait-until","z":"c9d8b497.48e108","name":"wait untill triggered finished","server":"5c29d263.09d2ac","outputs":1,"entityId":"alarm_control_panel.alarmo","entityIdFilterType":"exact","property":"state","comparator":"is_not","value":"triggered","valueType":"str","timeout":0,"timeoutType":"num","timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":160,"y":2820,"wires":[["dab94121.20b75"]]},{"id":"dab94121.20b75","type":"looptimer-advanced","z":"c9d8b497.48e108","duration":"1","units":"Minute","maxloops":"100","maxtimeout":"30","maxtimeoutunits":"Minute","name":"loop","x":330,"y":2720,"wires":[["72c4a214.a2e07c"],[]]},{"id":"e3e5e885.900f48","type":"server-events","z":"c9d8b497.48e108","name":"response","server":"5c29d263.09d2ac","event_type":"mobile_app_notification_action","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":80,"y":3020,"wires":[["c77270fe.9bd08","40d8a61e.42ec18","9f7395d0.a22988"]]},{"id":"c77270fe.9bd08","type":"switch","z":"c9d8b497.48e108","name":"alarmo_pauze?","property":"payload.event.action","propertyType":"msg","rules":[{"t":"eq","v":"alarmo_pauze","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":260,"y":3020,"wires":[["e33cc404.ee3878"]]},{"id":"40d8a61e.42ec18","type":"switch","z":"c9d8b497.48e108","name":"alarmo_disarm & disable auto mode?","property":"payload.event.action","propertyType":"msg","rules":[{"t":"eq","v":"alarmo_disarmmanual","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":3060,"wires":[["886bca6.e110038"]]},{"id":"9f7395d0.a22988","type":"switch","z":"c9d8b497.48e108","name":"Ignore & rearm?","property":"payload.event.action","propertyType":"msg","rules":[{"t":"eq","v":"alarmo_rearm","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":260,"y":3100,"wires":[["d16c19c3.592758"]]},{"id":"886bca6.e110038","type":"api-call-service","z":"c9d8b497.48e108","name":"Turn of Alarm Auto Mode","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.alarm_auto_mode","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":3060,"wires":[["b0673e8f.84d04"]]},{"id":"b0673e8f.84d04","type":"api-call-service","z":"c9d8b497.48e108","name":"Alarmo Disarm","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"alarm_control_panel","service":"alarm_disarm","entityId":"alarm_control_panel.alarmo","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":820,"y":3060,"wires":[[]]},{"id":"e33cc404.ee3878","type":"api-call-service","z":"c9d8b497.48e108","name":"set alarm-pauze 30min","server":"5c29d263.09d2ac","version":1,"debugenabled":false,"service_domain":"input_datetime","service":"set_datetime","entityId":"input_datetime.alarm_pauze","data":"{\"time\":\"00:30:00\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":3020,"wires":[[]]},{"id":"d16c19c3.592758","type":"link out","z":"c9d8b497.48e108","name":"To alarm state decision tree","links":["d5fb9559.bd49b8"],"x":375,"y":3100,"wires":[]},{"id":"55319851.2a25c8","type":"comment","z":"c9d8b497.48e108","name":"react to actionable notification alarm triggered + uitleg","info":"set alarm pauze zal Decision tree lanceren die alarm zal disarmen.\n\nALarm disarm moet ik toch manueel disarmen want auto mode off overruled niet de huidige status van het alarm.\n\nLink out zal Decision tree lanceren die alarm zal disarmen.","x":240,"y":2980,"wires":[]},{"id":"5c29d263.09d2ac","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true}]
1 Like

One sequence reacts to the the alarm going into pending mode or triggered mode.
I only want to receive a notification when the alarm is triggered, but in case the triggered device is in a room where I have a camera, the sequence will allready take a picture when the alarm goes into pending mode (because then the ā€˜culpritā€™ will be in that room), it will only send the picture if the alarm goes into triggered mode.

Iā€™m using actionable notifications (the notification node is actually a subflow so you have to click edit subflow template to see whatā€™s going on there) so you I can choose what needs to happen when the alarm goes off. I included also the sequences that act upon the choice I make.

The final sequence is the one that reacts to a failure to arm the alarm due to open sensors. Note that this currently only works when you have an exit delay set, due to a little bug in Alarmo. Once that bug is fixed it will allways work. The tricky bit here was to have node red work both with 1 open sensor as well as multiple open sensors.