Verisure alarm as trigger for automation (need help)

Im trying to have the state of my Verisure Alarm to control lights in the entrance. But Im struggling

I want the automation to be triggered if the state is changing from Armed home / Armed away to Disarmed
I also want it to only work when the sun is below the horizon.
The light is a Philips Hue light.

The automation is working when I trigger it manually (so it seems like I have the lights ok), but it will not trigger by changing the state of the alarm. here is “code”

- action:
  - alias: ''
    data:
      brightness: 256
      rgb_color:
      - 255
      - 197
      - 100
    entity_id: light.ball
    service: light.turn_on
  - delay: 00:02:00
  - alias: ''
    data: {}
    entity_id: light.ball
    service: light.turn_off
  alias: 'Lys Gang etter sunset '
  condition:
  - after: sunset
    before: sunrise
    condition: sun
  id: '1511256767915'
  trigger:
  - entity_id: alarm_control_panel.trollkleiva_alarm
    from: Armed away
    platform: state
    to: Disarmed
  - entity_id: alarm_control_panel.trollkleiva_alarm
    from: Armed home
    platform: state
    to: Disarmed

need help

Can you edit your post, highlight your code and use the </> button. It will format the yaml so people can read it.

- action:
  - alias: ''
    data:
      brightness: 256
      rgb_color:
      - 255
      - 197
      - 100
    entity_id: light.ball
    service: light.turn_on
  - delay: 00:02:00
  - alias: ''
    data: {}
    entity_id: light.ball
    service: light.turn_off
  alias: 'Lys Gang etter sunset '
  condition:
  - after: sunset
    before: sunrise
    condition: sun
  id: '1511256767915'
  trigger:
  - entity_id: alarm_control_panel.trollkleiva_alarm
    from: Armed away
    platform: state
    to: Disarmed
  - entity_id: alarm_control_panel.trollkleiva_alarm
    from: Armed home
    platform: state
    to: Disarmed

Take a look at the documentation for conditions. This bit is wrong. You need to have multiple conditions.

condition:
    condition: or  # 'when dark' condition: either after sunset or before sunrise
    conditions:
      - condition: sun
        after: sunset
      - condition: sun
        before: sunrise

Check out the documentation:

Sunset to Sunrise will not work because it crosses the reset. Days reset at midnight. So anything after sunset does not equal before sunrise. You want to write your condition based on before sunrise OR after sunset.

before sunrise = 0 to sunrise. after sunset = sunset to 24 (or midnight).

Thanks. Ill try that.

I did make the changes to the condition, but still the same problem.
I also tried the same by taking the condition completely away and only have the trigger and the action. Still not working. seems like the error has to do with the the Verisure part (since the light (action) works when triggered manually from the web interface.

Any suggestions?

So taht means your trigger isn’t working.

Verify that “Armed home”, “Armed away”, and “Disarmed” are actual states of the device alarm_control_panel.trollkleiva_alarm.

Also, what are the possible states of the device?

use underscore and it will work. armed_away, armed_home etc.

1 Like