Sunset offset twice as a trigger

Hello all,

I want to automate my blinds, but not every blind at the same time after sunset.
Opening the separate blinds on a certain time is no problem. Even the first group closing after sunset (offset +00:30) works, but I have trouble closing the blind at the second time after sunset (offset +00:45).
Would someone please give me advise on this subject?

description: ''
trigger:
  - platform: time
    at: '08:30:00'
  - platform: time
    at: '09:00:00'
  - platform: sun
    event: sunset
    offset: '+00:30'
  - platform: sun
    event: sunset
    offset: '+00:45'
condition: []
action:
  - choose:
      - conditions:
          - condition: time
            after: '08:29:00'
            before: '08:31:00'
        sequence:
          - service: cover.open_cover
            target:
              entity_id:
                - cover.duwi_zw_esj_300_blind_control
                - cover.rolluik_computerkamer_compute
                - cover.rolluik_eetkamer
                - cover.rolluik_logeerkamer_logeerk
      - conditions:
          - condition: time
            after: '08:59:00'
            before: '09:01:00'
        sequence:
          - service: cover.open_cover
            target:
              entity_id: cover.rolluik_woonkam
      - conditions:
          - condition: sun
            after: sunset
            after_offset: '+00:30'
        sequence:
          - service: cover.close_cover
            target:
              entity_id:
                - cover.duwi_zw_esj_300_blind_control
                - cover.rolluik_computerkamer_compute
                - cover.rolluik_eetkamer
                - cover.rolluik_logeerkamer_logeerk
      - conditions:
          - condition: sun
            after: sunset
            after_offset: '+00:45'
        sequence:
          - service: cover.close_cover
            target:
              entity_id: cover.rolluik_woonkam
    default: []
mode: single

Thanks in advance for your help.

Franklin

Not my strong point, but it looks to me as if your automation will only run between 08:29:00 and 08:31:00 - at any other time it will stop when the first condition fails.

Have you tried putting each condition and command sequence in a separate script and calling them from the main automation? That way each script will stop if the condition fails, but the automation will carry on. A bit spaghetti-like so probably bad practice.

Does it all have to be in one automation? You’ve got four separate triggers.

Thats not entirely true. All the conditions work execpt the one at sunset offset +00:45.
I had all the automations seperate working, but wanted to try them catch in one automation. I did this with my heating but that are all triggers on time and not at sunset.

After days of trial and error I managed to do this in one automation. To help people who want to do the same here is my code:

alias: Rolluiken
description: ''
trigger:
  - platform: time
    at: '08:30:00'
  - platform: sun
    event: sunset
    offset: '+00:45:00'
  - platform: sun
    event: sunset
    offset: '+00:30:00'
  - platform: time
    at: '09:00:00'
condition: []
action:
  - choose:
      - conditions:
          - condition: time
            after: '08:29:59'
            before: '08:30:01'
        sequence:
          - service: cover.open_cover
            target:
              entity_id:
                - cover.duwi_zw_esj_300_blind_control
                - cover.rolluik_computerkamer_compute
                - cover.rolluik_eetkamer
                - cover.rolluik_logeerkamer_logeerk
      - conditions:
          - condition: sun
            after: sunset
            after_offset: '+00:45:00'
        sequence:
          - service: cover.close_cover
            target:
              entity_id:
                - cover.rolluik_woonkam
      - conditions:
          - condition: sun
            after: sunset
            after_offset: '+00:30:00'
        sequence:
          - service: cover.close_cover
            target:
              entity_id:
                - cover.duwi_zw_esj_300_blind_control
                - cover.rolluik_computerkamer_compute
                - cover.rolluik_eetkamer
                - cover.rolluik_logeerkamer_logeerk
      - conditions:
          - condition: time
            after: '08:59:59'
            before: '09:00:01'
        sequence:
          - service: cover.open_cover
            target:
              entity_id: cover.rolluik_woonkam
    default: []
mode: single

I guess the solution is hidden in the details. I only changed the time gap for fireing the time platform and narrowed it to one second. As said this is working now.

Franklin