To this automation I would like to add the condition that if in the case I am not at home both on holidays and working days, the script starts at 9.
- id: 'Luci piante matteo'
alias: Luci piante matteo
trigger:
- platform: time
at: '09:00:00'
- platform: time
at: '10:00:00'
condition:
- condition: zone
entity_id: device_tracker.iphone_matteo
zone: zone.home
- condition: template
value_template: >
{{ (is_state('binary_sensor.workday_sensor', 'on') and now().hour == 9) or
(is_state('binary_sensor.workday_sensor', 'off') and now().hour == 10) }}
action:
- service: script.accendi_piante