I am trying to add some conditions to an existing automation but the nesting isn’t passing the config checker. It doesn’t seem to like me having ‘and’ nested inside ‘or’, nested inside ’ and’…
This orignally worked fine so the only bit that doesn’t work is the middle part with the value_templates
Hopefully what I have below is enough to explain what I am trying to do, but basically I want the ‘start_time1’ and it’s ‘enable’ to be logic AND, then logic OR’d with ‘start_time2’ and it’s ‘enable’.
automation:
- alias: Reticulation test code # start program 1 at designated time if it is enabled and today is selected as a watering day
initial_state: 'on'
trigger:
- platform: template
value_template: "{{ states('sensor.time') == (states.input_datetime.retic_program1_start_time_1.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
- platform: template
value_template: "{{ states('sensor.time') == (states.input_datetime.retic_program1_start_time_2.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
condition:
- condition: state
entity_id: input_boolean.retic_program1_enable
state: 'on'
- condition: state
entity_id: sensor.retic_program1_watering_day
state: 'True'
- condition: or
conditions:
- condition: and
conditions:
- condition: template
value_template: "{{ states('sensor.time') == (states.input_datetime.retic_program1_start_time_1.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
- condition: state
entity_id: input_boolean.retic_program1_start_time1_enable
- condition: and
conditions:
- condition: template
value_template: "{{ states('sensor.time') == (states.input_datetime.retic_program1_start_time_2.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
- condition: state
entity_id: input_boolean.retic_program1_start_time2_enable
- condition: or
conditions:
- condition: state
entity_id: input_boolean.retic_rain_parameters_met
state: 'on'
- condition: state
entity_id: input_boolean.retic_rain_override
state: 'on'
action:
- service: script.turn_on
entity_id: script.retic_program1_run
can someone please help me as I can’t figure out why it won’t work this way… I’m guessing it’s indentation but have been playing around with it for a while now.