Would love to understand what is going on. Anyone know?
This is my full automation:
- id: '1619471711923'
alias: Turn Off Sprinkler
description: Turns off sprinkler if rain is forecast or the day is set to off.
trigger:
- platform: time
at: input_datetime.sprinkler_start_time
condition:
- condition: template
value_template: "{{ (states('input_select.sprinkler_setting') == 'Auto' and\n\
\ states('input_number.precipitation_forecast') | float(1) < states('input_number.precipitation_threshold')\
\ | float(1) and\n ((states('input_boolean.sprinkler_mon') == 'off' and now().weekday()\
\ == 0) or\n (states('input_boolean.sprinkler_tue') == 'off' and now().weekday()\
\ == 1) or\n (states('input_boolean.sprinkler_wed') == 'off' and now().weekday()\
\ == 2) or\n (states('input_boolean.sprinkler_thu') == 'off' and now().weekday()\
\ == 3) or\n (states('input_boolean.sprinkler_fri') == 'off' and now().weekday()\
\ == 4) or\n (states('input_boolean.sprinkler_sat') == 'off' and now().weekday()\
\ == 5) or\n (states('input_boolean.sprinkler_sun') == 'off' and now().weekday()\
\ == 6))) or\n states('input_select.sprinkler_setting') == 'off' }}"
action:
- service: switch.turn_off
target:
entity_id: switch.sprinkler
data: {}
I get an error in the UI when I press the Test button on the Condition
.
In Developer Tools/Template it returns true
or false
.