Way to ignore errors in automation?

I have an automation that runs when the alarm is triggered. This automation flashes lights and sounds several sirens. The problem I have is that the automation does not fall through at the end when the alarm is disarmed to disable the sirens, also the volume on the speakers stays very high and is not restored (I guess the graphical representation is that the trace is not orange all the way down). I see an error when trying to flash the lights and I am assuming this is the cause for the automation not to continue? I wonder if there is a way to garantee that the automation will continue so the sirens can stop souding as they are pretty loud. Right now I have a second automation to disable the sirens when the alarm gets disarmed (but the lights don’t flash due to the named error, only turn on at full brightness). Funny thing is that when I try calling the light.toggle service through the dev tools on the named light I don’t get any errors. The affected light is a shelly 2 dimmer.

alias: Alarm Triggered
description: What should happen when the alarm has been triggered
trigger:
  - platform: state
    entity_id:
      - alarm_control_panel.main_alarm
    to: triggered
condition: []
action:
  - service: sonos.snapshot
    data:
      entity_id:
        - media_player.living_room
        - media_player.kitchen
  - service: sonos.join
    data:
      master: media_player.living_room
      entity_id: media_player.kitchen
  - service: media_player.volume_set
    data:
      volume_level: 0.8
    target:
      entity_id:
        - media_player.living_room
        - media_player.kitchen
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.sirens
  - parallel:
      - repeat:
          until:
            - condition: state
              entity_id: alarm_control_panel.main_alarm
              state: disarmed
          sequence:
            - service: light.toggle
              data:
                brightness_pct: 100
                color_name: red
              target:
                area_id:
                  - ffc5cdb1c8494e7ebd232b7ed261785b
                  - 9c67cb94403c4713b0d5679fcfb56eb3
                  - b94a0eb204dc4f2aa8380473fc9ddefd
                  - d7544b6ac28e4eb5b13ddc0682d8baae
                  - ed12f513bc27406684f82b4ea7a20084
                  - c8b0beebc28144d9a942fb5ef6c06319
            - delay:
                seconds: 1
      - repeat:
          until:
            - condition: state
              state: disarmed
              entity_id: alarm_control_panel.main_alarm
          sequence:
            - service: tts.google_say
              data:
                language: sv
                entity_id: media_player.living_room
                message: Larm utlöst
            - delay:
                seconds: 5
  - service: media_player.volume_set
    data:
      volume_level: 0.25
    target:
      entity_id:
        - media_player.living_room
        - media_player.kitchen
  - service: sonos.restore
    data:
      entity_id:
        - media_player.living_room
        - media_player.kitchen
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.sirens
mode: single

Executed: June 24, 2022, 2:47:34 PM
Error: Error when calling async_set_default for bulb Bedroom Roof at 192.168.1.141: {'code': -5000, 'message': 'general error'}

continue _on_error: true

2 Likes

@123 THANK YOU!
image

1 Like