Add twilight and dusk as triggers for sun

At this moment I can only select sunrise and sunset as triggers for automations.
Could it be possible to add twilight and dusk as possible triggers to?
This could be of use for automations when it gets dark or light, I know I can set an offset for this but in my case this doesn’t do the trick for the automations I have in mind.

Same here with me

Use the sun angle sensor, and you can trigger it with numeric state below -6 degrees or whatever dusk angle you’re targetting.

This came up before in a core discussion and was decided against as it had too many variants of dusk/dawn. But you can get a perfect replacement with sun angle.

2 Likes

or you could user the offset

triggers:
  - trigger: sun
    event: sunrise
    offset: "-01:00:00"

Sun2 is a better integration of Sun events.

1 Like

These are already included with the sun integration, well almost. Next dusk sensor is supplied, it may be disabled by default. Twilight is the time between setting and dusk. So next setting is the start of twilight and next dusk is the end.