Force RGB light on when armed home

What do you think is the best way to force a state of a light not to change/toggle by no one when alarm is armed home? The light most be enable in GUI to use when the alarm is not armed.

I have RGB light beside a backdoor that a lot of people in the house have opened including me when it’s armed. Always hate to talk to the security company…
So i thought i change to RGB light to red when it’s armed with 2 automations:

alias: alarm_home_on
description: ''
trigger:
  - platform: device
    device_id: <verisure.id>
    domain: alarm_control_panel
    entity_id: alarm_control_panel.verisure_alarm
    type: armed_home
condition: []
action:
  - service: light.turn_on
    data:
      color_name: red
      brightness_pct: 45
      transition: 20
    target:
      device_id: <zigbee2mqtt.id>
mode: single
alias: alarm_off
description: ''
trigger:
  - platform: device
    device_id: <verisure.id>
    domain: alarm_control_panel
    entity_id: alarm_control_panel.verisure_alarm
    type: disarmed
  - platform: device
    device_id: <verisure.id>
    domain: alarm_control_panel
    entity_id: alarm_control_panel.verisure_alarm
    type: armed_away
condition: []
action:
  - service: light.turn_off
    data: {}
    target:
      device_id: <zigbee2mqtt.id>
mode: single

Yesterday someone in bed turn off all the lights one by one (it’s excluded from “all light” toggle) and then armed the alarm. <edit: wrong order. So when i should let our cat in before my bedtime. Ok, no red light… ioooiiooooiiooo…Hi alarm central!

I want a full prof high availability automation to force every cpu clock to have that damn red light on. Even if HA restart or a nuke. I don’t care. I want it on.

Since the Hue motion sensor provides a switch to enable/disable motion detection, I have the annoying situation of stumbling through the hallway in the dark because someone has accidentally switched off the motion detector. (ok, your situation is much more annoying). In any case, I have created the following automation to immediately turn the switch back on as soon as it has been switched off:


- id: hue_motion_sensor_switch
  alias: Hue Motion Sensor Switch

  trigger:
  - platform: state
    entity_id: switch.hue_bewegungsmelder_flur_motion
    to: 'off'

  condition:
    - condition: state
      entity_id: input_boolean.diele_dauerlicht
      state: 'off'

  action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.hue_bewegungsmelder_flur_motion

Simplly replace the condition with your alarm state.

I’ll clarify @pedolsky you have to create a new automation that when the light status change (either on / off / whatever) if the alarm is on => turn the lamp on and make it red.

(What you have done successfully is the automation when the alarm status change)

That much i could understand. But i want a professional coder how they code for many scenario it can be off. Automation off, reboot (missing trigger) etc. A have a blueprint who have a string storage sensor to make it more high availability in some way. But i could not work out to use it myself.

Many of this kind of problems could been preventented with user policy/management in HA. 9 years in the coding of HA and they have very little user restrictions. And noob programers like me could use “simple” codes.

That’s why you need to be a professional coder in HA to have a working HA. A wife/kid in user mode is still a bull in a china shop.

I may be wrong, but I think it should be pretty reliable when you create automations with triggers that covers the cause (alarm) and the consequence (bulb). That is if it works correctly : trigger should execute when status change.

If you want to be extra safe : another automation when HA starts and another every XX seconds to check that if the alarm is on, the bulb should be turned on and red.

Otherwise yes, you need to have some knowledge to handle things like these, not necessarily a professionnal coder though.

IMHO all domotic solution are somehow like this, even a Philips Hue Hub and Hue bulbs can failed to turn on when you press a button on a hue remote (and no china tea cup were broken :wink:)

Another way to address this would be to use a conditional card to remove the light from the UI when the alarm is armed. It sounds like you would probably also want an automation as above as a backup, but this would avoid anyone getting confused about why the light keeps turning itself back on.