dMopp
(dMopp)
November 10, 2022, 11:49pm
1
I try to get this one working:
condition: template
value_template: >-
{{ states("sensor.thermal_comfort_garten_absolutehumidity")|float <
(states("sensor.thermal_comfort_"+(area_name(trigger.entity_id)|string)+"_absolutehumidity")|float)
}}
Idea:
I’m trying to use the area name of the trigger sensor as part of the entity to check the value.
eG:
Trigger:
ID: sensor.sonoff _ house _relativehumidity
Value: 50
Area: house
Sensor:
ID: sensor.thermal_comfort_garten_absolutehumidity
Value 10
Sensor2:
ID: sensor.thermal_comfort _ house _absolutehumidity
Value 20
if Sensor1 < Sensor2; then …
So I want to create the name for the second sensor with the value room from the trigger
(Please ignore the spaces, formatting bug in the forum software)
zoogara
(Daryl)
November 11, 2022, 12:05am
2
If you plug it into the template editor, what error does it give? Ignore that - it won’t have a trigger.
Try adding quotes around trigger.entity_id
You need to assign defaults for your float()
filters. I would also use the slugify
filter instead of string
in case you have capitals or spaces in your Area names.
condition: template
value_template: >-
{{ states("sensor.thermal_comfort_garten_absolutehumidity") | float(0) <
(states("sensor.thermal_comfort_" + (area_name(trigger.entity_id) | slugify) + "_absolutehumidity") | float(0))
}}
dMopp
(dMopp)
November 12, 2022, 11:19pm
4
Sorry for the delay. This worked out. Finally i can recommend open the window based on the absolute values of humidity