The purpose is to apply a small change to the sensor value so that when the device communicates the temperature again, HA will consider that to be a change. And that change will then become a trigger for an automation.
However the above did not have the desired effect (I suppose because value_template only indicates how the value will be set when a variable is updated - so the code should apply the template immediately when the method is not applied to a var)
I propose to not limit the update to the
var
entities, but allow updating any state, including sensors.I tried the following:
The purpose is to apply a small change to the sensor value so that when the device communicates the temperature again, HA will consider that to be a change. And that change will then become a trigger for an automation.
However the above did not have the desired effect (I suppose because value_template only indicates how the value will be set when a variable is updated - so the code should apply the template immediately when the method is not applied to a
var
)