Hi all,
I have an automation that calculates how much my garden must be watered based on rain values and then runs the sprinklers. The calculation is done within a template condition like this:
action:
- if:
- condition: time
weekday:
- wed
- sun
enabled: false
then:
- choose:
- conditions:
- condition: template
value_template: >
{% set regenist = (states('sensor.rain_last_3_days') | float)
+ (states('sensor.gw1100a_v2_2_3_daily_rain_rate') | float)%}
{% set regensoll = (12 | float) %} {{ regenist < (0.125 *
regensoll) }}
sequence:
- service: input_select.select_option
data:
option: "1.00"
target:
entity_id: input_select.bewasserung_zeitwahl
- service: notify.mobile_app_handynermin
data:
title: Auto Bewässerung
message: >
Gieße volle Gießdauer (Regen IST ({{ regenist }}mm) weniger
als 1/8 des SOLL ({{(0.125 * regensoll)}}mm))
Error that I get when I run the automation is this: Error rendering data template: UndefinedError: ‘regensoll’ is undefined
When I put the same code into the template editor it work perfectly. but within the automation something goes wrong.
What mistake am i making here? Any ideas?
thx in advance,
zavjah