Automation kicks off, but not all entities turn on/off

I am new to HA so my apologies if my automation logic is not spot on. The automation triggers, however not all light turn on and off. Some do and some do not. When I manually trigger the automation they all work as expected.

My goal is this:

  • Turn Landscape lights and porch dimmer on 15 min after sunset
  • Turn Landscape lights and porch dimmer off at 12:15am
  • Turn Flood Lights on at 12:15am
  • Turn Flood Lights off 90 min before sunrise
  • Turn Landscape lights and porch dimmer on 90 min before sunrise
  • Turn Landscape lights and porch dimmer off 30 min before sunrise
- alias: 'Landscape Lights On (Night)'
  trigger:
    platform: sun
    event: sunset
    offset: '+00:15:00'
  action:
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_on
      data:
        entity_id: light.front_porch_level
        brightness_pct: 30

- alias: 'Landscape Lights Off (Night)'
  trigger:
    platform: time
    at: '00:15:00'
  action:
    - service: switch.turn_off
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_off
      entity_id: light.front_porch_level

- alias: 'Flood Lights On'
  trigger:
    platform: time
    at: '00:15:00'
  action:
    - service: switch.turn_on
      entity_id: switch.flood_lights_switch

- alias: 'Flood Lights Off'
  trigger:
    platform: sun
    event: sunrise
    offset: '-01:30:00'
  action:
    - service: switch.turn_off
      entity_id: switch.flood_lights_switch
- alias: 'Landscape Lights On (Morning)'
  trigger:
    platform: sun
    event: sunrise
    offset: '-01:30:00'
  action:
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_on
      data:
        entity_id: light.front_porch_level
        brightness_pct: 30

- alias: 'Landscape Lights On (Morning)'
  trigger:
    platform: sun
    event: sunrise
    offset: '-01:30:00'
  action:
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_on
      data:
        entity_id: light.front_porch_level
        brightness_pct: 30

- alias: 'Landscape Lights Off (Morning)'
  trigger:
    platform: sun
    event: sunrise
    offset: '-00:30:00'
  action:
    - service: switch.turn_off
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_off
      entity_id: light.front_porch_level

Which lights don’t turn on/off? I don’t think there should be a space between automations.

brightness_pct: 30

- alias: 'Landscape Lights Off (Night)'

try

brightness_pct: 30
#
 - alias: 'Landscape Lights Off (Night)'

But, when I manually trigger the automation all the lights turn on and off. It’s only when the automation is triggered automatically that not all turn on and off. Would that space cause this issue?

Which lights/switches don’t turn on/off? I don’t think the spaces between automations matter I always have at least one newline between all my automations.

Spaces don’t matter, I have them all over my automations.

@keithh666 I took out the spaces just in case. Let me see which ones turn on an off tonight and report back tomorrow morning.

@keithh666 alright so my automation that is set to turn on 15 minutes after sunset kicked off and the only light that turned on was the first one in the list. switch.backyard_landscape_lights_switch

How do you talk to your lights and switches? zwave? Using a USB stick or a hub?

To me this seems like a communication issue.

I have some issues with outdoor lights due to distance. Lately it’s been well behaved with some additional switches added to expand my network mesh but this is my old code to deal with it:

########################################
outdoor_on_rep:
  alias: Outdoor lights on repeat

  sequence:
    - service: script.outdoor_on

    - service: logbook.log
      data:
        name: 'Outdoor Lights On'
        message: 'Try 1'

    - delay: '00:01:00'

    - condition: state
      entity_id: group.outdoor_evenning_lights
      state: 'off'

    - service: script.outdoor_on

    - service: logbook.log
      data:
        name: 'Outdoor Lights On'
        message: 'Try 2'

    - delay: '00:01:00'

    - condition: state
      entity_id: group.outdoor_evenning_lights
      state: 'off'

    - service: script.outdoor_on

    - service: logbook.log
      data:
        name: 'Outdoor Lights On'
        message: 'Try 3'

########################################
outdoor_on:
  alias: Outdoor lights on
  sequence:
    - service: switch.turn_on
      entity_id:
       - switch.outdoor_sidedoor_switch
       - switch.outdoor_lv_switch
       - switch.outdoor_front_switch

    - service: light.turn_on
      entity_id:
       - light.outdoor_post_level
       - light.lower_patio_level
      data:
       brightness: 150

@jwelter I am using the Aeon USB Stick, but have lots of other Z-Wave switches, so my mesh should be decent. The other strange thing is that when I manually trigger the automation from the state menu, all the switches and lights turn on.

I will give your suggestion a shot and report back. Thanks for your help!

Thinking out of the box here, are you positive the automation you are manually testing is the one that is actually being automatically triggered? Maybe check the log right after it’s automatically triggered to verify the right automation is going off. Or if another automation is going off at the same time that conflicts with this one.

Those two things are all I can think of that could cause this…

- alias: 'Landscape Lights On (Morning)'
  trigger:
    platform: sun
    event: sunrise
    offset: '-01:30:00'
  action:
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_on
      data:
        entity_id: light.front_porch_level
        brightness_pct: 30


    It looks this is in there twice?

    Also I would combine these.... to avoid race conditions .....
    - alias: 'Landscape Lights Off (Night) and Floods On'
      trigger:
    platform: time
    at: '00:15:00'
      action:
    - service: switch.turn_off
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_off
      entity_id: light.front_porch_level
    - service: switch.turn_on
      entity_id: switch.flood_lights_switch

    - alias: 'Flood Lights Off and Landscape Lights On (Morning) '
      trigger:
    platform: sun
    event: sunrise
    offset: '-01:30:00'
      action:
    - service: switch.turn_off
      entity_id: switch.flood_lights_switch
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
        - switch.front_landscape_lights_switch
        - switch.garage_coach_lights_switch
    - service: light.turn_on
      data:
        entity_id: light.front_porch_level
        brightness_pct: 30

You might try putting a delay of a second or so between separate service calls like so…

- service: switch.turn_on
  entity_id:
    - switch.backyard_landscape_lights_switch
  • delay: '00:00:01:
    - service: switch.turn_on
    entity_id:
    • switch.front_landscape_lights_switch
  • delay: '00:00:01:
    - service: switch.turn_on
    entity_id:
    • switch.garage_coach_lights_switch

I don’t know if it will make a difference or not :stuck_out_tongue:

I would try it like this because the first one works.

  action:
    - service: switch.turn_on
      entity_id:
        - switch.backyard_landscape_lights_switch
    - service: switch.turn_on
      entity_id:
        - switch.front_landscape_lights_switch
    - service: switch.turn_on
      entity_id:
        - switch.garage_coach_lights_switch

@azeroth12 confirmed it is the correct automation. working manually and triggers all lights to turn on and off. But when automatic only one light. Going to try adding some delays like others have suggested hereto see if it changes anything for me.

@RobDYI thanks for the tip, but that didn’t work either… It’s really odd because my automation is so plain vanilla.

I know its an old thread, just replying if someone happens to be in the same situation. When i have multiple entity_ids i want to turn on/off in an action i always group them like this and it works every time.

action:
- service: switch.turn_on
  entity_id:
    - switch.backyard_landscape_lights_switch
    - switch.front_landscape_lights_switch
    - switch.garage_coach_lights_switch

Cheers!