Automation of two cover problem

good morning,
in automations I have this code that controls the opening of two shutters every day according to certain conditions.
The commands from the cards of the two covers work
Can you tell me why one, the first, opens and the second doesn’t?
The automations are perfectly equal, only the shutter changes.

Thanks, Alberto

- alias: Apertura tapparelle giorni festivi in base al periodo scolastico off cucina
  trigger:
    - platform: template
      value_template: "{{ states('sensor.time') == (state_attr('input_datetime.opshutfestivi', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
  condition: 
  - condition: and
    conditions:
    - condition: time
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
    - condition: state
      entity_id: input_boolean.periodo_scolastico
      state: 'off'
    - condition: state
      entity_id: input_boolean.blocco_cucina
      state: 'off'
  action:
    - service: cover.set_cover_position
      data_template:
        entity_id: cover.tapparella_cucina
        position: "100"

- alias: Apertura tapparelle giorni festivi in base al periodo scolastico off sala
  trigger:
    - platform: template
      value_template: "{{ states('sensor.time') == (state_attr('input_datetime.opshutfestivi', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
  condition: 
  - condition: and
    conditions:
    - condition: time
      weekday:
        - mon
        - tue
        - wed
        - thu
        - fri
        - sat
        - sun
    - condition: state
      entity_id: input_boolean.periodo_scolastico
      state: 'off'
    - condition: state
      entity_id: input_boolean.blocco_sala
      state: 'off'
  action:
    - service: cover.set_cover_position
      data_template:
        entity_id: cover.tapparella_sala
        position: "100"

I am not sure, but what is the point of the weekday condition? It is always true as you have listed every day of the week.

Yeah that’s a strange condition.

Also your aliases should be quoted and your cover positions should not be quoted.

Also you can trigger both actions in the same automation.

your value template is somewhat complex, have a look here where @123 offered a better solution Automation triggering reliability