Hi, i need your help about a configuration that I have.
I’m basically tryin’ to build a draft alarm POC and I have the following in my configurations.yaml:
alarm_control_panel:
- platform: manual
name: Alarm
code: !secret alarm_control_panel_code
code_arm_required: false # Don't require the code to arm the alarm
disarm_after_trigger: false # Arm again after triggering
arming_time: 120 # Delay from arming and becoming armed, eg. to leave the house.
delay_time: 60 # Allow time to disarm the alarm before it triggers, eg. when arriving home
trigger_time: 600 # Amount of time the alarm is triggered for
disarmed:
trigger_time: 0 # Ensure the alarm can never be directly triggered when disarmed
armed_home:
arming_time: 20 # Leave no delay between arming -> armed
delay_time: 0 # Leave no delay between pending -> triggered
I have now built 3 automations, first one is taking care to trigger the alarm (if the alarm is armed_away or armed_home) if one of the four door sensors got open:
- alias: "Alarm - Trigger when sensors go off"
trigger:
- platform: state
entity_id: binary_sensor.finestra_sala_contact, binary_sensor.finestra_bagno_contact, binary_sensor.finestra_camera_contact, binary_sensor.porta_ingresso_contact
to: "on"
condition:
# Only trigger the alarm if it's armed
condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.alarm
state: armed_home
- condition: state
entity_id: alarm_control_panel.alarm
state: armed_away
action:
service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.alarm
Then, I have an automation which is asking the Xiaomi Gateway to turn on red if one of the aforementioned contacts got open, which is working:
- alias: "Alarm - Triggered"
trigger:
- platform: state
entity_id: alarm_control_panel.alarm
to: "triggered"
action:
- service: light.turn_on
data:
entity_id: light.xiaomi_gateway_light
color_name: red
brightness: 255
And finally, the automation which is not working. It should shutdown that light when I disarm the alarm, but for any reason it’s not working. Tried as well to set brightness to zero, but without any luck:
- alias: "Alarm - Disarmed"
trigger:
- platform: state
entity_id: alarm_control_panel.alarm
to: "disarmed"
action:
service: light.turn_off
entity_id: light.xiaomi_gateway_light
Can someone point me where i’m committing mistake?
Thanks and regards!