I have been searching around and I am unable to arm and disarm my manual alarm panel. This is my first time posting code so I am hoping it posts correctly.
alias: ‘Auto Enable’
trigger:
platform: time
at: ‘20:00:00’
condition:
condition: state
entity_id: alarm_control_panel.Security_Alarm
state: ‘disarmed’
action:
Sorry about that, I’ve been commenting the condition out so it doesn’t apply since it shouldn’t be needed be needed to fire the action. I tried it again just now and same problem. Below is the code I used.
alias: ‘Auto Enable’
trigger:
platform: time
at: ‘06:00:00’
condition:
condition: state
entity_id: alarm_control_panel.Security_Alarm
state: ‘disarmed’
action:
I created an automation to disarm my alarm using the Automation editor and I’m now trying to add the ‘code: !secret alarm_code’ to the YAML through both the Edit YAML function and the File Editor but I can’t get the alarm code added.
I get “Message malformed: extra keys not allowed @ data[‘action’][0][‘code’]” when I try to add the code.
Can someone help me figure out what I’m doing wrong? Thank you!
I’ve got my own set of issues with the code part… I’m trying to enable and disable two systems at the same time and when I put the code statement in, I get the following errors:
Invalid config for [automation]: [code] is an invalid option for [automation]. Check: automation->action->1->code. (See /config/configuration.yaml, line 9).
Logger: homeassistant.components.manual.alarm_control_panel
Source: components/manual/alarm_control_panel.py:393
Integration: manual (documentation, issues)
First occurred: 2:58:05 PM (2 occurrences)
Last logged: 2:58:18 PM
Any thoughts on that? I’m going to try moving where the alarm is defined in the configuration.yaml and see if that has any bearing on the invalid code error
Well nevermind, the template I used for the automation was created with the UI editor and then I took the code it gave me - saved it in another folder and modified it…
Long story short, I had to place the service data into the brackets.
Went from
data: {}
entity_id: alarm_control_panel.home_alarm
code: !secret alarm_code To
data: {entity_id: alarm_control_panel.home_alarm, code: !secret alarm_code}
In my automation actions, I can make it work like this. However, the entity_id is used twice but if I drop target it gives error.
Any idea how fix it or better way as {} wasn’t working for me.