Tips / automation with several sunset conditions

I try to use the function Configuration → Automations to program the following sequence,
1 - Monday, Tuesday and Friday, 1h30 before sunset, perform an action
2 - Saturday and Sunday, 1h00 before sunset, perform an action
3 - Wednesday, 50 minutes before sunset, perform an action.

I managed to get this. It works well for sequence 1. I don’t know how to introduce the other 2.

alias: On_RC_CD
description: ‘’
trigger:

  • platform: sun
    event: sunset
    offset: ‘-01:30’
    condition:
  • condition: time
    weekday:
    • mon
    • wed
    • fri
      action:
  • service: switch.turn_on
    target:
    entity_id:
    - switch.smart_switch_6_2
    mode: single

Just make 3 automations.

Like nickrout said, you could just simply create 3 separate automations.

Or you could also set the 3 above different triggers, give them all a unique trigger id.

The use the choose option, have 3 choosers with 3 different actions based on the trigger id and then put your day conditions under each separate choose action.

Here’s one way to do it using the “Choose” action:

alias: On_RC_CD
description: 'Turn on smart switch at specified times before sunset'
trigger:
  - platform: sun
    event: sunset
    id: MTF
    offset: '-01:30'
  - platform: sun
    event: sunset
    id: Weekend
    offset: '-01:00'
  - platform: sun
    event: sunset
    id: Wed
    offset: '-00:50'
condition:
  - condition: state
    entity_id: switch.smart_switch_6_2
    state: 'off'
action:
  - choose:
      - conditions:
          - condition: trigger
            id: MTF
          - condition: template
            value_template: >-
              {{ now().strftime('%A') in ['Monday', 'Tuesday', 'Friday'] }}
        sequence:
          - service: switch.turn_on
            target:
              entity_id: switch.smart_switch_6_2
      - conditions:
          - condition: trigger
            id: Weekend
          - condition: template
            value_template: >-
              {{ now().strftime('%A') in ['Saturday', 'Sunday'] }}
        sequence:
          - service: switch.turn_on
            target:
              entity_id: switch.smart_switch_6_2
      - conditions:
          - condition: trigger
            id: Wed
          - condition: template
            value_template: >-
              {{ now().strftime('%A') == 'Wednesday' }}
        sequence:
          - service: switch.turn_on
            target:
              entity_id: switch.smart_switch_6_2
    default: []
mode: single