I had it working fine then a update or restart…something… and now I get error. extra key not allowed @ data[‘condition’]. I’ve searched and tried different thing for days none… I give, I need help. it’s somewhere in the condition: condition: template, because if I remove that and the if, elif it works, and the if, elif works in the template check. Thanks
FWIW, I believe the template can be reduced to this:
front_zone_timer_start:
sequence:
- service: timer.start
data_template:
entity_id: timer.front_zone_timer
duration: >
{% set z = states('sensor.sprinkler_current_zone_front')[-1:] %}
{{ (states('input_number.sprinkler_zone_' ~ z ~ '_run_time') | int) * 60 }}
How it works:
First line gets the state value of sensor.sprinkler_current_zone_front and then slices the last character of the value. So if the value is Zone 3 it sets the variable z to 3.
Second line concatenates the string ‘input_number.sprinkler_zone_’ with the value of variable z and the string ‘_run_time’. So if z is 3, the result of the concatenation is an entity_id:
input_number.sprinkler_zone_3_run_time
It gets the state value of that entity, converts it from string to integer and then multiplies it by 60 (to convert minutes to seconds).
Newbie here I was going to get to that but was trying to do one step at a time. Thanks both of you… I was trying to do it myself learning along the way but got stumped along the way.