This is how I setup the security alarm panel from Home Assistant using as a siren the Xiaomi gateway V2, and Xiaomi motion sensors, door/windows sensors as well as Xiaomi buttons, using 5 automations and 4 scripts.
Using these 5 automations and 4 scripts, you will have 5 seconds delay when arming the system to exit the house, and 5 seconds to disarm the system when you enter your home, this delay can be modified in the configuration file.
After you key in the code, the gateway will light green for about 5 seconds, one googles mini will inform you that the alarm has been armed and you have to exit, you will also receive a push notification on your phone that the alarm has been armed. When the alarm has been armed, the light on the gateway turn off.
When you come back or a sensor has been triggered, the light on the gateway will turn on orange colour, the google mini will play a message that the alarm has been triggered and you have to key in the code. If the code is successfully keyed in then, the alarm will be disarmed, otherwise the alarm will start sounding, the lights will flash blue and red and you will get a push notification on your phone.
Below is the code you have to add to your configuration.yaml file, modify the delay and pending time as you wish. Also change the code from 1234 to whatever you want or remove the code if you do not want to use any code.
If you find this useful, please leave a positive comment.
alarm_control_panel:
- platform: manual
name: Alarma Casa
pending_time: 0
delay_time: 5
trigger_time: 5
code: 1234
disarmed:
trigger_time: 5
armed_home:
pending_time: 5
delay_time: 5
trigger_time: 5
armed_away:
pending_time: 5
delay_time: 5
Below is the link to my scripts and automations if you want them, but you have to modify them to match your gateway and sensors.
[ Ссылка ]
Ещё видео!