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.