Can I use the calendar component like ‘holiday calendar’ as a condition in an automation?
- id: '2'
alias: Programma Tapparelle
trigger:
- platform: time
at: 07:30:00
- platform: time
at: 07:45:00
- platform: time
at: 10:00:00
- platform: time
at: 20:00:00
- platform: time
at: 10:00:00
- platform: time
at: 11:00:00
- platform: time
at: 10:12:00
condition:
- condition: state
entity_id: input_boolean.programma_tapparelle
state: 'on'
- condition: not
conditions:
- condition: calendar
entity_id: calendar.festivita
after: '00:00:00'
action:
- service: cover.set_cover_position
target:
entity_id:
- cover.sonoff_cam_lett
- cover.sonoff_cam_giu
data:
position: >
{% if trigger.now.strftime("%H:%M:%S") == "07:30:00" %}
40 # Apertura alle 07:30
{% elif trigger.now.strftime("%H:%M:%S") == "07:45:00" %}
60 # Apertura alle 07:45
{% elif trigger.now.strftime("%H:%M:%S") == "10:00:00" %}
90 # Apertura alle 10:00
{% elif trigger.now.strftime("%H:%M:%S") == "20:00:00" %}
20 # Chiusura alle 20:00
{% elif trigger.now.strftime("%H:%M:%S") == "10:00:00" %}
60 # Apertura alle 10:00
{% elif trigger.now.strftime("%H:%M:%S") == "11:00:00" %}
90 # Apertura alle 11:00
{% elif trigger.now.strftime("%H:%M:%S") == "16:25:00" %}
60 # Apertura alle 16:25 (giorni festivi)
{% endif %}
this is my automation but I can’t get it to work