I am trying to add conditions to a automation action and am wondering whether this should work or not (obviously depending on the scripts being right etc). Thanks in advance!
-
alias: Run Cycle 2
initial_state: ‘on’
trigger:- platform: time_pattern
minutes: 0
seconds: 0
condition:
- condition: template
value_template: >
{{ now().strftime(’%Y-%m-%d %H:%M:00’) == states(‘input_datetime.cycle2_next_run_time’) }} - condition: state
entity_id: input_boolean.cycle2_enable
state: ‘on’
action: - condition: template
value_template: “{{ ‘states.sensor.sensor1’, ‘On’}}” - service: script.run_a_cycle
data_template:
cycle: 2 - condition: template
value_template: “{{ ‘states.sensor.sensor1’, ‘Off’}}” - service: script.update_next_runtime
- platform: time_pattern