Automatisation Sunset but not before x oclock

Dear HA-Community,

iam maybe just stupid, but:
How can i realise an automatisation on sunrise, but not before may 6am.

I cant use a time-trigger with sunrise condition, caus if the sunrise ist after 6 am, it dont run.
I cant use a sunrise trigger with time condition, caus it does not run if sunrise is after/before 6am.

What i want:
Our windows-shutter should go up with the sunset. But not before 6am. So in the summer they should not go up may at 5oclock. And in the winter normal with the sunrise.

Did anyone got an idea?


You can add both as trigger and condition.
That way if the sun rises the automation gets triggered, you need a condition to check if it is past 6am.
If the same automation is triggered at 6am, you have a second condition to check if the sun is already above the horizon.

Edit: YAML

- alias: Shutters - Open at Sunset
  id: 'shutters_open'
  - platform: sun
    event: sunrise
  - platform: time
    at: '06:00:00'
  - condition: sun
    after: sunrise
  - condition: time
    after: '05:59:59'
  - service: cover.open_cover
      - cover.entity_id_of_your_cover/cover_group

If the sun is rising, the automation is triggered, but the covers are only opend if that event happend after 06:00 am.
If it is 06:00 am, the automation is triggered, but the covers are only opend, if the sun has already risen.

Do you mean sunrise?

Or do you live where the sun sets after midnight but before 06:00?

1 Like

Yh, first HomeAssi on Mars :rofl:
Sure, Sunrise

Wait what… is it that simple?
Thanks a lot :heart_eyes: