Assistance with calendar-driven automation

I’m reaching out as a noob who is seeking assistance with calendar-driven automation. I’ve encountered a challenge where the automation initiates as expected but fails to repeat the color changes I have configured. Strangely, if I initiate a scene automation separately, I achieve the desired results. However, when I incorporate the calendar into the automation, it only runs once and will not repeat. Your expertise will be greatly appreciated.

alias: Thanksgiving Lights
description: “”
trigger:

  • platform: calendar
    event: start
    offset: “0:0:0”
    entity_id: calendar.home_assistant
  • platform: sun
    event: sunset
    offset: “+00:01:00”
    condition:
  • condition: state
    entity_id: calendar.home_assistant
    attribute: message
    state: Thanks
    action:
  • service: scene.turn_on
    target:
    entity_id: scene.thanksgiving_outside_bulbs_1
    metadata: {}
  • delay:
    hours: 0
    minutes: 0
    seconds: 15
    milliseconds: 0
  • service: scene.turn_on
    target:
    entity_id: scene.thanksgiving_outside_bulbs_2
    metadata: {}
  • delay:
    hours: 0
    minutes: 0
    seconds: 15
    milliseconds: 0
  • repeat:
    count: 800
    sequence: []
    mode: single

Your automation is designed to trigger at the start of each scheduled Calendar event.

After triggering, it turns on two scenes (15 second delay between the scenes) and then rapidly executes 800 iterations of a seemingly useless repeat because it has no actions in its sequence. Did you remove them before posting the example or does it truly have no actions?

The automation won’t turn on the scenes again until it’s triggered again by another Calendar event.

Describe how you want this work because it’s current behavior seems incorrect.

Also please have a read of this: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

My goal is to setup all of my Holiday lighting automations in the calendar. I can turn them on manually with the scenes that I created. But I am looking for a way to have the scene trigger automatically.

Here is a scene that I can run manually and get the results I am looking to achieve. (Sorry, I can’t figure out how to copy and paste it correctly. )

alias: Thanksgiving Lights-old
description: ""
trigger:
  - platform: sun
    event: sunset
    offset: 0
condition: []
action:
  - delay:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
  - repeat:
      sequence:
        - service: scene.turn_on
          target:
            entity_id: scene.thanksgiving_outside_bulbs_1
          metadata: {}
        - delay:
            hours: 0
            minutes: 0
            seconds: 15
            milliseconds: 0
        - service: scene.turn_on
          target:
            entity_id: scene.thanksgiving_outside_bulbs_2
          metadata: {}
        - delay:
            hours: 0
            minutes: 0
            seconds: 30
            milliseconds: 0
      count: 800
  - service: scene.turn_on
    target:
      entity_id: scene.outside_lights_white
    metadata: {}
mode: single

Here is my original code formatted properly.

alias: Thanksgiving Lights
description: ""
trigger:
  - platform: calendar
    event: start
    offset: "0:0:0"
    entity_id: calendar.home_assistant
  - platform: sun
    event: sunset
    offset: "+00:01:00"
condition:
  - condition: state
    entity_id: calendar.home_assistant
    attribute: message
    state: Thanks
action:
  - service: scene.turn_on
    target:
      entity_id: scene.thanksgiving_outside_bulbs_1
    metadata: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - service: scene.turn_on
    target:
      entity_id: scene.thanksgiving_outside_bulbs_2
    metadata: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - repeat:
      count: 800
      sequence: []
mode: single

If you want the scenes to switch back and forth repeatedly they need to be nested under the Repeat… It looks like you did it correctly in the older automation, then changed it in the new one. As you have it currently, the Repeat action isn’t doing anything.

alias: Thanksgiving Lights
description: ""
trigger:
  - platform: sun
    event: sunset
    offset: "+00:01:00"
condition:
  - condition: state
    entity_id: calendar.home_assistant
    attribute: message
    state: Thanks
action:
  - repeat:
      count: 800
      sequence:
        - service: scene.turn_on
          target:
            entity_id: scene.thanksgiving_outside_bulbs_1
          metadata: {}
        - delay: 15
        - service: scene.turn_on
          target:
            entity_id: scene.thanksgiving_outside_bulbs_2
          metadata: {}
        - delay: 15
mode: single

Thanks. I see that now. I’ll change it and see what results I get.