Automation - Sun -> sunset not triggered

Can anyone please explain to me why this automation is no longer working? It worked fine up until a couple of days ago and suddenly stopt working:

alias: living_room_spots_turn_on_by_sunset
  - platform: 'sun'
    event: 'sunset'
    offset: '-00:25:00'
  - condition: state
    entity_id: light.living_room_spots_light
    state: 'off'
  - service: script.living_room_spots_light_turn_on

It suddenly stopped working and I see no errors in the logs. For some reason it’s not triggered anymore. The script itself is also running just fine. For some reason the automation seems not to be triggering anymore.

it looks right to me.

Why do you have a condition in this automation…if the lights are already on 25 minutes before sunset, they will stay on. If they are off, they will turn on.

Good point. Haven’t looked at the condition in that way. :slight_smile:

Still wonder why the automation is not triggered. I think it has to do with the minus offset. Will test that tomorrow. With a plus offset, it works, strangely.

This is working for me:

alias: Living Room light on
  - event: sunset
    offset: -00:20
    platform: sun
condition: []
  - service: switch.turn_on
    entity_id: switch.wall_plug_switch_current_value

Thanks. I will make a new test automation with your example. Perhaps I can make it work like that. :slight_smile:

And it’s running fine again. Issue seemed to be the id. I think something was messed up by it and therefor would not start. Replace the id and now it’s running fine again. :slight_smile: