I’m trying to fire some actions based on my alarm state changing from disarmed to armed_away. The actions run fine when I manually fire them from the automation but I can’t get this trigger to work. Can anyone tell me what I’m doing wrong? I have similar trigger setup to turn off my siren when the state of the alarm goes from armed_home or armed_away to disarmed if it’s firing.
The trigger’s definition looks fine. Ideally you should post the YAML code instead of a screenshot. Click the overflow menu (the three vertical dots in the upper right hand corner of the Automation Editor) and select “Edit in YAML”. Copy-paste the displayed YAML in o the forum message.
The following are all the potential states of an alarm_control_panel
. Not all alarm_control_panel integrations support all of the listed states.
disarmed
armed_home
armed_away
armed_night
armed_custom_bypass
pending
triggered
arming
disarming
Is it possible that your system doesn’t change directly from disarmed
to armed_away
but includes an intermediate state such as arming
?
disarmed → arming → armed_away
You can test this theory by simply erasing “From: disarmed”. The result will be that it should trigger when it changes from any state to armed_away
. If that works then you know it doesn’t change state directly from disarmed
to armed_away
.
If it still fails to trigger then something else is responsible for the issue.
I would remove from: disarmed
as a start
I would also verify armed_away
is correct state
So I changed the trigger to “arming”. It fires now. Problem is it also fires when I arm the alarm to alarm_home.
Is there a way to either make the alarm home skip the “pending” status and just go directly to armed so that it doesn’t trigger for home?
Or is there another way to accomplish this?
Did you also try what I had suggested? Erase the from
value and leave the to
value as armed_away
and it will trigger only when it changes to the armed_away
state.
In YAML, the State Trigger will look like this:
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: armed_away
i did try that. problem is I want the message from tts to be something like, “Alarm is arming, you have 30 seconds to leave the building” so i’m really looking for it to be broadcast for pending for alarm away. Then I’d like to do another one for when I arm it for home. is there anyway to differentiate between the two of them?
Thanks,
Andrew
That’s a completely different requirement from what was originally stated:
To continue to help you, I need you to confirm the order of states that occur when you arm the alarm panel. Go to Developer Tools > States and observe the state-changes that occur when you arm alarm_control_panel.home_alarm
. Take note of any intermediate states between disarmed and armed.
Follow-up:
If you discover that the pending
state occurs, prior to changing to armed_home
or armed_away
, you can use that in a trigger such as this:
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: pending
However, it will trigger prior to changing to one of several possible states and you want only one of them (armed_away
). You can’t simply use this:
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
from: pending
to: armed_away
because that will trigger the instant the state changes to armed_away
which is too late for your intended purpose of broadcasting an announcement while in the pending
phase.