Scene runs in the morning; sometimes one light fails to turn on

Hi, I have a morning scene that turns on 3 Hue bulbs via a scene. Sometimes (once a week usually) one of the lights fails to turn on. I was hoping to have a check 1 minute after first activating the scene to see if any of the bulbs are off, and if so run the scene again.

Now I know what you’re going to say – just activate the scene again in 1 minute if the lights are flaky, which I will probably end up doing.

But since HA is fairly new to me I’m also learning about conditions and wondering why this particular one doesn’t work. I think it’s because it’s part of an action, but not sure. It won’t save the script properly when trying to use this code:

alias: 'Daily timed events: Morning lights on'
description: ''
trigger:
  - platform: time
    at: '05:30:00'
condition: []
action:
  - scene: scene.kitchen_island_fun
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - condition:
    alias: "Check if any island lights failed to turn on"
    condition: or
    conditions:
      - condition: state
        entity_id: light.kitchen_island_left
        state: off
      - condition: state
        entity_id: light.kitchen_island_center
        state: off
      - condition: state
        entity_id: light.kitchen_island_right
        state: off
    - scene: scene.kitchen_island_fun
mode: single

I think it’s related to the “OR” condition but I’m not sure. Hoping for some tips here, thanks!

Dennis

Looking through the action docs I found one type and corrected it. But when I save it, then look at the yaml again here’s what happens:

..snip
  - condition: or
    conditions:
      - condition: state
        entity_id: light.kitchen_island_left
        state: off
      - condition: state
        entity_id: light.kitchen_island_center
        state: off
      - condition: state
        entity_id: light.kitchen_island_right
        state: off
    - scene: scene.kitchen_island_fun

This is all I get in the yaml:

...snip
  - condition: or
    conditions:
      - condition: state
        entity_id: light.kitchen_island_left
        state: off
    - scene: scene.kitchen_island_fun
mode: single

It basically cuts out the 2nd and 3rd entries, so I think something is wrong in the syntax.

The condition block should be outside the action block. Replace “condition: []” with your condition block inside of action and it should work.

Thanks for the reply. But this particular automation runs at 5:30 in the morning and sets 3 different scenes at that time (no condition).

It’s only after all those are set where I want to check the 3 lights a minute later.

So I didn’t want to have a condition for all the actions, that’s why I’ve structured it the way I did.

Hope that makes sense.

Here’s the actual complete script that’s running now:

alias: 'Daily timed events: Morning lights on'
description: ''
trigger:
  - platform: time
    at: '05:30:00'
condition: []
action:
  - scene: scene.kitchen_island_fun
  - scene: scene.kitchen_cabinets_normal
  - service: script.family_room_tv_lights_on_daily_color
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - condition: state
    entity_id:
      - light.kitchen_island_left
    state: 'off'
  - scene: scene.kitchen_island_fun
mode: single

In this case you need to work with “choose”. A good example is here https://community.home-assistant.io/t/condition-or-on-choice/214533/4