Esphome alarm system

This only changes the state in home assistant, but the alarm logic resides 100% in the esp code. You need to debug the logic using the esp logs.

update now so after i changed the condition state manually i can now make the call to states and arming and disarming is working with the call to states the triggers are working now so my alarm is going off. i don’t have the siren connected yet but it is flashing so i know that is working only thing now the code is not working in the panel again for arming and disarming but everything else is working i can see the finishing line

so all i have to do now is get the arming and disarming via the keypad working and all the rest is easy thanks again Matt for all your help so far and for the little i will need going forward lol

There is some weirdness in the template_alarm_control_panel. I think the issue is related to an unavailable state in the esp alarm condition, which can lock it up. I sometimes need to manually use the service calls to update the esp alarm state to get them synced together correctly. You might be experiencing this.

yes i’m experiencing this because now it is broken again i have to manually enable the condition for it to be in sync with the alarm status and once i do that the alarm works with the triggers now i have disarmed via the service call it only arms one part of it and leaves the condition disarmed. code in the keypad still doesn’t work but that is minor compared to the state change issues i’m having now. How do you suggest i get these in sync

forgot to tag the reply for this above message

so here the order i have to do it in to get ti to work

arm the alarm using the services an call service

then i have to go to the states and set the alarm condition to armed

after i do that home_alarm changes from armed to unknown

only now i can use the service call esphome.alarm_system_arm_home which now sets the state and condition to match.

now i can walk in front of the sensor and the trigger works

now i can use the service call esphome.alarm_system_disarm which changes both together to disarmed or armed

i am not able to document as yet what breaks this cycle yet because now it seem to keep in sync after i did this the second time. i restarted hass and it keeped the state as armed just now

I’ve found that once you’ve gotten them synced it is rare for it to become unsynced. I have a special method that sets the state of the esp unit using a switch physically located at the esp unit. Since the template mirrors the esp unit, this is another way around this deadlock.

okay cool so far it is still synced so that is good news now… how do you suppose i tackle the issue where the keypad is not arming. so far you know that i have a completely mirrored secrets.yaml file without using the includes. The includes was causing my maximum recursion error. do you have any suggestions here for me. Now on another note. I have a traditional siren that i’m trying to figure out how to integrate. It is a 12 volt 3 wire siren the third wire for the wobble. do you feel i can use this. I was thinking a relay would work

hey Matt, i’m stuck now. I’ve done everything and all out of idea only thing i cant do is arm from the keypad in Hass but everything else works fine

okay it is all working now arming and arming with code and sensors working

It should resolvev to True when you want to alarm to arm.

If you want your code to be 1111 did you use:

 “{{ code == ‘1111’ }}”

?

it was my mistake

i thought the CODE part was part of the value template and i didn’t understand i had to replace that with my code thanks Matt for all your help for the entire project all the rest will be smooth sailing from here i will now add my state arm away

i can truly say that i have learned a lot from 0 experience its all about learning and growing. i still have a lot more to learn so when i’m finished this project i will probably take a few Udemy course in coding. i know have been very annoying thanks for putting up with me

Oh good! Note that you can use different codes for different things if you do choose, i.e. a different code to arm and disarm in both ha and in the esp unit. Or you can keep it simple as use the same code.

my next project will be to create a tiled android ap to take the results from the esp32 so that it still remains stand alone but i will also add the option to ad tiles from hass so that i can add stuff like my camera from my front door and so on

Cool, please share if you do. I have a secret arming/disarm method that is also standalone and is also undocumented. The sky is the limit once you get more familiar.

yea i prefer to keep it simple lol i’m only sorry that this does not work value_template: “{{ code == ‘!secret esp_alarm_code’ }}” but inputting the code in the config file works so i’m happy with that. i will add an editor to my door keypad when i create it so that i can edit the code line how you would edit the master code in a traditional system just it would be way easier because it would edit the secrets.yaml file instead i think that would be pretty easy

for sure now from last week i can look at the code and understand what most of it is saying and i can modify it too so i learning a lot for sure. do you know any good Udemy course that you would recommend. For sure you are the first person i will share that part with. I will give you the entire android ap when it is done. i will design the layout in photoshop and share with you. how it will look