DIY Alarm System in Home Assistant

DIY Alarm System in Home 
 Assistant

I will be including the Videos that are a part of the DIY Security Alarm Playlist above. I will try to paste the code (YAML, JSON, etc.) below for you to copy. I may need to find a better way to share these so let me know if you are having issues.

Ultimately, the video series is too long for me to cover in text format. I am happy to answer questions on Discord but the first 2 videos were nearly 1 hour of raw recordings.

The quick summary, is using the Home Assistant Manual Alarm Panel as the front-end of our alarm. This Panel controls your passcode (if set), the flow of armed-home, armed-away, pending, triggered, and disarmed. Based on these states, we will use Node-Red to build out our logic, automations, and actual functionality.

Soon to come: Noonlight integrations, Konnected.io, and Ring2MQTT

Alarm Control Panel YAML

alarm_control_panel: - platform: manual name: Intrusion Alarm disarm_after_trigger: false arming_time: 0 delay_time: 45 trigger_time: 10 disarmed: trigger_time: 0

Date Time Sensor

sensor: # ... - platform: time_date display_options: - 'time' - 'date' - 'date_time' - 'date_time_utc' - 'date_time_iso' - 'time_date' - 'time_utc' - 'beat'

Notify iPhone Node

{ "message": "{{message}}", "title": "{{title}}", "data": { "push": { "sound": { "name": "default", "critical": 1, "volume": 1 } }, "actions": [ { "action": "TURN_OFF_SECURITY_ALARM", "title": "Turn Off Alarm" }, { "action": "ACKNOWLEDGE", "title": "Call Police Department" } ], "persistent": true, "tag": "persistent" }}

Importable Node-Red 

[{"id":"877ee90e97ca08a1","type":"tab","label":"Security","disabled":false,"info":"","env":[]},{"id":"54670a08c2e19fe4","type":"comment","z":"877ee90e97ca08a1","name":"Check Alarm Status","info":"","x":130,"y":40,"wires":[]},{"id":"114ff70dd48127f1","type":"server-state-changed","z":"877ee90e97ca08a1","name":"Intrusion Alarm","server":"b3e69109.1bba7","version":5,"outputs":1,"exposeAsEntityConfig":"","entityId":"alarm_control_panel.intrusion_alarm","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":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":120,"y":120,"wires":[["fee38b05953355dd"]]},{"id":"fee38b05953355dd","type":"debug","z":"877ee90e97ca08a1","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":400,"y":120,"wires":[]},{"id":"6c1255f6483f50f5","type":"comment","z":"877ee90e97ca08a1","name":"Triggering Intrusion Alarm","info":"","x":150,"y":240,"wires":[]},{"id":"38b7d5b55daa97a3","type":"trigger-state","z":"877ee90e97ca08a1","name":"Alarm Tripped","server":"b3e69109.1bba7","version":4,"inputs":0,"outputs":2,"exposeAsEntityConfig":"","entityId":"binary_sensor.chuckbuildsdoorsensor_contact","entityIdType":"exact","debugEnabled":false,"constraints":[{"targetType":"entity_id","targetValue":"alarm_control_panel.intrusion_alarm","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"armed_home"},{"targetType":"entity_id","targetValue":"binary_sensor.chuckbuildsdoorsensor_contact","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"customOutputs":[],"outputInitially":false,"stateType":"str","enableInput":false,"x":110,"y":320,"wires":[["1ac6effc38145feb"],[]]},{"id":"1ac6effc38145feb","type":"api-call-service","z":"877ee90e97ca08a1","name":"Trigger Alarm Panel","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_trigger","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.intrusion_alarm"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":430,"y":320,"wires":[["b91fb1e92b296a2b"]]},{"id":"b91fb1e92b296a2b","type":"change","z":"877ee90e97ca08a1","name":"Set Message","rules":[{"t":"set","p":"message","pt":"msg","to":"Did you mean to trip the alarm?","tot":"str"},{"t":"set","p":"title","pt":"msg","to":"Intrusion Alarm Triggered","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":320,"wires":[["d27985566ed84436"]]},{"id":"d27985566ed84436","type":"api-call-service","z":"877ee90e97ca08a1","name":"Notify iPhone","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_charless_iphone","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"title\":\"{{title}}\",\"data\":{\"push\":{\"sound\":{\"name\":\"default\",\"critical\":1,\"volume\":1}},\"actions\":[{\"action\":\"TURN_OFF_SECURITY_ALARM\",\"title\":\"Turn Off Alarm\"},{\"action\":\"ACKNOWLEDGE\",\"title\":\"Call Police Department\"}],\"persistent\":true,\"tag\":\"persistent\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":320,"wires":[["0a4ca82a77b88493"]]},{"id":"0a4ca82a77b88493","type":"delay","z":"877ee90e97ca08a1","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1100,"y":460,"wires":[["0c5288beec587793"]]},{"id":"0c5288beec587793","type":"api-current-state","z":"877ee90e97ca08a1","name":"Check if Disarmed","server":"b3e69109.1bba7","version":3,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.intrusion_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","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":810,"y":460,"wires":[[],["9b209ac82b549c36"]]},{"id":"9b209ac82b549c36","type":"api-current-state","z":"877ee90e97ca08a1","name":"Check if Triggered","server":"b3e69109.1bba7","version":3,"outputs":2,"halt_if":"triggered","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.intrusion_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","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":790,"y":400,"wires":[[],["b91fb1e92b296a2b"]]},{"id":"170e0f3af690e7b3","type":"server-events","z":"877ee90e97ca08a1","name":"All Mobile App Notification Actions","server":"b3e69109.1bba7","version":3,"exposeAsEntityConfig":"","eventType":"mobile_app_notification_action","eventData":"","waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":180,"y":600,"wires":[["f914772f7d266298"]]},{"id":"9e2c0c82b5ea2dcf","type":"comment","z":"877ee90e97ca08a1","name":"Notification Response","info":"","x":140,"y":540,"wires":[]},{"id":"f914772f7d266298","type":"switch","z":"877ee90e97ca08a1","name":"","property":"payload.event.action","propertyType":"msg","rules":[{"t":"eq","v":"TURN_OFF_SECURITY_ALARM","vt":"str"},{"t":"eq","v":"ACKNOWLEDGE","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":600,"wires":[["9088296cee3857e0"],["ad75a8a15dcf6b68"]]},{"id":"9088296cee3857e0","type":"api-call-service","z":"877ee90e97ca08a1","name":"Disarm Alarm","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_disarm","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.intrusion_alarm"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":720,"y":580,"wires":[["42c579b61d7616fd"]]},{"id":"42c579b61d7616fd","type":"api-current-state","z":"877ee90e97ca08a1","name":"Check if Disarmed","server":"b3e69109.1bba7","version":3,"outputs":2,"halt_if":"disarmed","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.intrusion_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","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1010,"y":580,"wires":[["ce0aea808947755a"],["2f77e1322a9214b3"]]},{"id":"2f77e1322a9214b3","type":"delay","z":"877ee90e97ca08a1","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1020,"y":660,"wires":[["42c579b61d7616fd"]]},{"id":"ce0aea808947755a","type":"change","z":"877ee90e97ca08a1","name":"Set Message","rules":[{"t":"set","p":"message","pt":"msg","to":"Security Alarm is Disabled","tot":"str"},{"t":"set","p":"Title","pt":"msg","to":"Intrusion Alarm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":580,"wires":[["42519bb7f0d5de1b"]]},{"id":"42519bb7f0d5de1b","type":"api-call-service","z":"877ee90e97ca08a1","name":"Notify iPhone","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_charless_iphone","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"title\":\"{{title}}\",\"data\":{\"channel\":\"Alarm\",\"priority\":\"high\",\"ttl\":0}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1490,"y":580,"wires":[[]]},{"id":"ad75a8a15dcf6b68","type":"api-call-service","z":"877ee90e97ca08a1","name":"Trigger Alarm","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_trigger","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.intrusion_alarm"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":700,"y":700,"wires":[[]]},{"id":"2a0d0bf50221d384","type":"comment","z":"877ee90e97ca08a1","name":"Update to Noonlight Alarm Later","info":"","x":750,"y":660,"wires":[]},{"id":"11368bf89a5e8005","type":"comment","z":"877ee90e97ca08a1","name":"Disarm When Charles is Home","info":"","x":170,"y":760,"wires":[]},{"id":"6dc965c4b30930ee","type":"server-state-changed","z":"877ee90e97ca08a1","name":"Charles is Home","server":"b3e69109.1bba7","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"person.chuck","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"home","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":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":140,"y":840,"wires":[["e5f98a5134464728"],["33fbe9a33e9fbe52"]]},{"id":"33fbe9a33e9fbe52","type":"api-current-state","z":"877ee90e97ca08a1","name":"Check Alarm Status","server":"b3e69109.1bba7","version":3,"outputs":2,"halt_if":"armed_home","halt_if_type":"str","halt_if_compare":"is","entity_id":"alarm_control_panel.intrusion_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","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":860,"wires":[[],["7ec6e23ba8dd53aa"]]},{"id":"7ec6e23ba8dd53aa","type":"api-call-service","z":"877ee90e97ca08a1","name":"Arm Alarm Away","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_arm_away","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.intrusion_alarm"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":600,"y":860,"wires":[[]]},{"id":"e5f98a5134464728","type":"api-call-service","z":"877ee90e97ca08a1","name":"Disarm Alarm","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"alarm_control_panel","service":"alarm_disarm","areaId":[],"deviceId":[],"entityId":["alarm_control_panel.intrusion_alarm"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":380,"y":800,"wires":[[]]},{"id":"c3f16a1290748f5a","type":"comment","z":"877ee90e97ca08a1","name":"Alarm is triggered","info":"","x":120,"y":1020,"wires":[]},{"id":"b6844921f557fb07","type":"server-state-changed","z":"877ee90e97ca08a1","name":"Alarm Triggered","server":"b3e69109.1bba7","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"alarm_control_panel.intrusion_alarm","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"triggered","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":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":120,"y":1100,"wires":[["0b151020da3b255b","ceea0c4027886617"],[]]},{"id":"0b151020da3b255b","type":"api-call-service","z":"877ee90e97ca08a1","name":"Call Noonlight","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"","service":"","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":400,"y":1060,"wires":[[]]},{"id":"ceea0c4027886617","type":"api-call-service","z":"877ee90e97ca08a1","name":"TTS Warning","server":"b3e69109.1bba7","version":5,"debugenabled":false,"domain":"","service":"","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":390,"y":1020,"wires":[[]]},{"id":"b3e69109.1bba7","type":"server","name":"Home Assistant","addon":true}]

Privacy Policy
Terms and Conditions