Esphome alarm system

Hey Mat, this is the error message i’m getting under developer tool which i hit call service

Developer Tools

Failed to call service esphome/pulseeyealarm_arm_home. expected dict for dictionary value @ data[‘service_data’]. Got 2020

2020 being the code i was using for testing

You need exactly what I put above:

code: '2020'

Don’t forget the quotes here and in your esp code. Otherwise you’ll strip codes that start with 0.

Hey Mat i’ve done all of that but stll not working but i think the source of my problem is the substitutions. see the below screenshot i removed all of the code and only left these few lines and i’m still getting this error when the substitutions is in the code. what are your thoughts

Hard to know if this should compile at all. I assume you have to have a valid esphome: block

I would start the other way. Strip down the code to just the binary_sensors and none of the alarm logic. This will be a basic vanilla esphome project at that point. Then you can add back in the alarm piece of it. Those are my thoughts.

okay i removed esphome all together i’m starting from the beginning again

Hey Matt, here’s a little update from a student to a teacher like back at school lol. so i removed Esp home and all the folders then re-installed. This did not fix the recursion error i was getting but i managed to find what was cause that error so let me detail it here for anyone having the same issue in the future. Now we both know that secrets.yaml file is required in the \config\esphome folder so i did re-create that file but i did not add an entry to it i just waited on it to complain. It was then i realised after i added the !include secrets.yaml that the recursion error happened. So what i did was copy the contents of the secrets.yaml file that is in the \config directory into the esphone directory secrets file and that stopped complaining. I am still looking for a way to use the includes but for now that solved my issue with that error. Earlier you asked if that was allowed so this answers that question yes it works. but i will get back to the includes at another point. The only inssue i’m having is arming and disarming the alarm. The code works and does arm and disarm but it does nothing in regards to triggering the alarm. I have tried the call function as you highlighted in the developers option and that give me an error message seen in the screenshot attached. Any ideas i’m almost home

I’m glad you are on the right path here.

You can see the error message says it is expecting a dictionary, but you only provided a string in the service data. You need to use code: '1111'

yea i have used 1111 and that gives me the error message i am getting there but i’m trying to understand what directory the errors is complaining about as it does not give a path i’m learning as i go along but this one has me a bit stumped

Read this very carefully, you need to use

code: '1111'

That entire line in the service data.

okay trying that again now

Okay i used the entire line before i left out the code: part my bad. so i’m not getting any error message whien i hit call service

is this service call suppose to change the state. When i go back to the dashboard it does not change the state to armed from the disarmed state. the keypad works changing the state though

Are you using the template_alarm_control_panel? If so, this is weird since that template uses this same service call to arm and disarm the system.
Use the developers tools to check the states of all the entities on the esp unit change the way they should when you make the service calls. If that all works, then the error is in your homeassistant config.

yea i’m pretty sure i am but i’m looking over the config file now becasue at one point i changed it to manual to test

okay you are right i did not set it back to template i’m going that now

Okay i just set back the config to use template but the arming and disarming doesn’t happen on the keypad and the state does not change using developers tool. Something about template. can you lend me 5 minutes to just peek over it for me

Configure a default setup of Home Assistant (frontend, api, etc)

default_config:

Text to speech

tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

secrets inside templates not allowed

must use hard coded ‘code’ on home assistant panel

esphome code does not need to match HA code

alarm_control_panel:

  • platform: template
    panels:
    home_alarm:
    value_template: “{{ states(‘sensor.alarm_condition’) }}”
    arm_home:
    - condition: template
    value_template: “{{ code == ‘MYCODE’ }}”
    - service: esphome.alarm_system_arm_home
    data:
    code: !secret esp_alarm_code
    disarm:
    - condition: template
    value_template: “{{ code == ‘MYCODE’ }}”
    - service: esphome.alarm_system_disarm
    data:
    code: !secret esp_alarm_code

The last thing you want to debug is the alarm_control_panel. First, you want to make sure that when you use the service calls in Developers that the states of the esp entities respond correctly using the states tab on the Developers section. If not, then something on the esp unit isn’t working correctly. In that case, you would need to go to the logs on the esp unit itself.

Sorry I only have time for asynchronous help even though it isn’t ideal.

will go through that again now…

np at all well at least this help is much appreciated so thanks anyway

okay so the stage does not change when i do the call so i will hit esp logs now

Okay one quick thing i have armed the alarm not using the arm code but changing the states under development options to see if the alarm sees the triggers but it didn’t when i activated the contact and motion but if you look at the images the alarm conditions state did not change. any thoughts