{% set value = (states('sensor.master_bathroom_humidity_average_linear_24h') | int(default=0) | round(1) - states('sensor.bathroom_humidity') | int(default=0) | round(1) ) > states('input_select.helpers_master_bath_humidity_threshold') | int(default=0) %}
value }}
Does this literal mean the sensor for average is at the end greater then the input?
Or does this mean the output of the calculation average-humidity is greater then input?
I need to know if the humidity (realtime sensor) is higher then the average sensor.
When we go shower the humidity rise so the fan turned on. Then i wait 5 minutes with a delay in automation then a wait template. The wait template is waiting when humidty is lower again then the average with a trashold
{% set value = states('sensor.rel-time-humid') | int(default=0) | round(1) > states('sensor.avg')| int(default=0) + 2 | round(1)%}
{{value }}
{% set value = states('sensor.rel-time-humid') | int(default=0) | round(1) < states('sensor.avg')| int(default=0) + 2 | round(1)%}
{{value }}
EDIT
PS: i do think your automation, looks a bit " to complicated "
And you might wanna rethink the use of an “average value-sensor” as a trigger , After a short while in a hot shower, your average-sensor will go sky high, and move the “trigger-point” along ( unless that is a fixed state )
I don’t know how the average_linear and sampling size works actually, maybe you are right, that that solution takes “normal” variations into account.
But i don’t see any point in starting my fan in the bathroom, if the humidity, raise above an “average” of i.e 40 to 42, Or 60, to 62. So i would add a “lower” fixed tress-hold
( Currently i only have “above 75 = evacuate” , beside another fan, switch(w. timer) when someone needs to “reduce the impact of their short visit”
Right, the current humidity-sensor will drop fast, from i.e 82% to i.e 74%, while the average might still be at 78 ( Don’t stop the Fan ! ) Well again i haven’t seen the “pattern” of your average sensor, in fact i have no average sensors(in use), not for humid, nor temp, nor electricity prices etc., not for “fun/interesting to look at” either
Lets say i drink an average of 20 beers in a month, do i get drunk ?, Indeed because i drank them all within 5 hours , well meaning i still haven’t found any valid use for average values
If i have a average electricity-cost of 0.10Euro/kwh , is that High or Low ? , If i Mainly used electricity during high-cost hours, it’s high , if i mainly used electricity during low-cost hours it’s low, which make an average of electricity cost somehow pointless
Shower is on, humidity rise and average rise also but slower.
Delay of 10 minutes
Wait template: wait until humidity - average is greater then threshold 2
When showers is off the humidity will go lower because of the fan.
Average goed also lower and when this is within the 2 then fan stop
I can change the threshold because in winter is better to have 2 and summer to have 3. Warm weather outside can make humidity rise also.
In specific if you live in a wooden house , as i do.
Today humid is 41% in the bathroom(temp 20.3), summer it’s normally around 60%, and as i find higher humidity more “comfortable” for my health, i prefer the latest, best with 65-70