I wanted to put together a simple alarm system so I started with the manual alarm control panel and branched out a little. There are two pieces. The primary component (custom_components/alarm_control_panel/bwalarm.py) and the frontend panel (panels/alarm.html).
The component uses the same interfaces as the other alarm control panels but adds a state (warning) for a state when a delayed trip happens. It also does all the logic in the component (see process_event function), you only specify what sensors to use in the configuration.
The panel provides an overview of what inputs sensors are active as well as a heads up of any currently open sensors (or additional items to watch like locks).
This is pretty cool actually. Iâm working to replace my Control 4 setup with Home Assistant, and Iâve been thinking Iâd have to get the Envisalink board to interface with my DSC alarm system, but I might actually go this route.
Is there some sort of alarm hooked up that goes off when something is triggered when itâs armed or do you have some kind of silent alarm that notifies you?
The component has two output entities that turn on/off. The alarm and the warning. Right now, I have a relay controlled alarm siren (from the original house alarm) connected to the alarm switch component. For the warning, Iâm going to have a script like component that plays a looped audio sound from my PI3.
I hadnât thought about a notification but HA makes it pretty easy to set one up.
Thatâs fantastic. For mine I think Iâll set it to notify me when the alarm is triggered so I can take action â whether that means checking to see if it was a false alarm by checking with family or calling the police. Thanks for sharing.
Nice work! Thanks for sharing. I have also a question.
I canât find the non actoin or action you have when there is movement as the alarm is arm or disarm, in your files.
Sorry, if i donât unerstand it very well. Thanks for help.
Not sure if I understand the question. I donât specifically look at motion events, I group binary_sensors into the configuration groups âimmediateâ and âdelayedâ. Anything in the immediate group causes an immediate alarm. Anything in the âdelayedâ group will move to the warning state before alarming (giving you a chance to disarm). There is also a separate group ânotathomeâ for things to ignore if arming home.
This is just what I was looking for! Cool!
My guess is that this is something way more people want. Maybe you would want to create a pull request for thisâŚ
I donât use a code at the moment as the only access is an SSL protected connection and a password on the home assistant interface. I consider that password my authentication. Not exactly strong two factor authentication but good enough for now.
The base alarm_control_panel class does include an option for a code to be specified. You would need to apply the code pieces from the built in Manual alarm control panel which means config/handling in the python code (pretty easy) and adding the additional input processing in the frontend piece (usually a little more work to get the layout right)
Thank you for the reply , I was trying to follow your suggestion and implement the part that deals with the code but my python skills are not that good , could you please point me to the right direction, thanks
I make no promises on the quality of this (it seemed to work during my brief testing), but it should at least give you an idea of what needs to be changed.
If you look at some of the later revisions as well, I also changed the âalarmâ and âwarningâ config sections to take a service rather than group/switch ID, so you can change
Note that this method will NOT turn the switch back off when the alarm is disarmed, so youâd have to use automation to do that if you want to continue using your existing switches with this implementation.
Hi
Thank you for sharing your code. When I was trying your code it wasnât asking for a code to arm or disarm the alarm.
I was tying to trace your code but I couldnât find out why itâs not working.
Update: I was able to arm and disarm using the code only from the states panel, couldnât get it to work from the Alarm panel (alarm.html) , any idea why?
Thanks
Did you implement the activation of a service instead of entity_id for alarm and warning?
Itâs not working for me , I was able to get the entity_id to work with alarm and warning. I got lost a little tracking the revisions.
Thank you for any help
Note that I commented out the schema validation so it wonât tell you if your configuration is wrong until it actually tries to call the service. It also only supports a single service (no lists using â-â), so if you want multiple services youâll need to have it call a script.