Script Triggering for 1 second

I have the below automation to trigger a script (also below) just before sunset. It is triggering but the lights are turning straight back off after just one second. Can anyone please advise what may be wrong with either of the below?

Automation:

- id: 'sunset_living_room'
  alias: Sunset Living Room
  trigger:
    platform: sun
    event: sunset
    offset: '-00:05:00'
  action:
    service: script.turn_on
    entity_id: script.sunset_living_room

Script:

sunset_living_room:
  alias: Sunset Living Room
  icon: "mdi:weather-sunset-down"
  sequence:
    - service: light.turn_on
      data:
        entity_id: light.play_bar_1
        brightness: 80
        rgb_color:
          - 235
          - 137
          - 52
    - service: light.turn_on
      data:
        entity_id: light.play_bar_2
        brightness: 80
        rgb_color:
          - 235
          - 137
          - 52
    - service: light.turn_on
      data:
        entity_id: light.play_bar_3
        brightness: 80
        rgb_color:
          - 235
          - 137
          - 52
    - service: light.turn_on
      data:
        entity_id: light.tv_l
        brightness: 40
        rgb_color:
          - 235
          - 137
          - 52
    - service: light.turn_on
      data:
        entity_id: light.tv_r
        brightness: 40
        rgb_color:
          - 235
          - 137
          - 52
    - service: light.turn_off
      entity_id: light.living_room

Just an update, I’ve moved entity_id outside of data but that has not solved it.

everything looks OK to me as far as I can tell.

are you sure you don’t have any other automations triggering that would turn those back off again?

the other thing you can try is to just move all of the script sequence steps from the script into the automation to see if it makes any difference.

1 Like

I checked already and there are no conflicts.

I’ll try moving the sequence steps and see how that goes.

I’m at a loss. I’ve moved the sequence to the automation instead and still the same problem.

I have two other scripts and automations that are experiencing the same issue.

Any help will be appreciated.

So I decided to delete the scripts and automations, then created them again, exactly the same as before, and they work now. Still confused but hey, they work now.

Would be nice to know why they didn’t before.