OK guys - I’ve figured out why it’s not working.
There are two temperatures here:
And we have two automations for this
First:
platform: numeric_state
entity_id: sensor.oczyszczacz_powietrza_biuro_temperature
value_template: '{{ state.state|float(0) - 1 }}'
below: sensor.outdoor_temperature
for:
hours: 0
minutes: 1
seconds: 0
and second:
platform: numeric_state
entity_id: sensor.oczyszczacz_powietrza_biuro_temperature
value_template: '{{ state.state|float(0) - 1 }}'
above: sensor.outdoor_temperature
for:
hours: 0
minutes: 1
seconds: 0
Of course this are only triggers for those two automations - not whole automiation but that doesn’t matter. Problem is with trigger.
Thing is when I was testing those automations I used Developer Tools → States and was changing state of ROOM TEMP (here as oczyszczacz_powietrza_biuro_temperature
). And it worked
But… I was blindly assuming that this part:
platform: numeric_state
entity_id: sensor.oczyszczacz_powietrza_biuro_temperature
value_template: '{{ state.state|float(0) - 1 }}'
above: sensor.outdoor_temperature
Will trigger automation whenever oczyszczacz_powietrza_biuro_temperature
will change or outdoor_temperature
will change. In reality tho this trigger is based on checking of oczyszczacz_powietrza_biuro_temperature
AGAINST outdoor_temperature
so it will not trigger if outdoor_temperature
will change. It will only trigger when oczyszczacz_powietrza_biuro_temperature
will change.
Now let’s look at some graph, shall we:
(this peak at the end of chart is a result of testing via changing entity value manually - ignore it)
As you can see here ROOM TEMP barely change while OUTSIDE TEMP change a lot. So to make this automation work I have to compare outdoor_temperature
AGAINST oczyszczacz_powietrza_biuro_temperature
. Not the other way around. Because while it is at is is this automation will trigger only when oczyszczacz_powietrza_biuro_temperature
will change (and all other conditions are met as well). So my automation have to look like this:
platform: numeric_state
entity_id: sensor.outdoor_temperature
value_template: '{{ state.state|float(0) - 1 }}'
below: sensor.oczyszczacz_powietrza_biuro_temperature
THEN SOMETHING… doesn’t matter what.
Maybe it will help other people in feature.
COMPARISION: Making trigger based on IF A > B
won’t run if B
has changed it’s value but not A
. It will only run if A
has changed it’s value.
Other thing is “why do I even care about opening / closing window during summer if it doesn’t affect room temperature in the manner of cooling it”. Well - it actually doesn’t as I see it now on the graph but there’s sollution for that. Simple fan mounted in the wall in the ventilation flue (ventilation vent chimney) will do the job. It will start based on HA automations sucking air from room outside. Because opened window is the only source of fresh air it will speed up sucking cool air from window. Simple.
For example my room has 22 cubic meters while such fan can transfer 100 cubic meters of air per hour. So if it starts when temp. in room is higher than temp outside and window is opened (checked by ZIGBEE sensor) then it will force air movement from window - across the room - to chimney up to the roof. When temperatures will change or window will be closed fan will power off. Simple as that. Additionally HA will tell me (based on temperatures differences) when to open / close window and will automatically start fan based on that.
Hope this explanation is clear.
I didn’t mount this fan yet but will do in upcomming days. Will let you know about results if someone is interested. Will connect it to some ZIGBEE plug and automate all this as desribed above. Should actually cool down my room very quick once temperature outside will be lower than temperature in room. For now as you see opening window does almost nothing.