Is there a way to rund an automation only when sensor value is e.g. +5 from value of the same sensor in the last run of the same automation?
Background is, that I want to limit updates to a epaper tag and so only trigger if temperature changes 5 degrees in this example.
Of course I can setup a template sensor as helper which “rounds” to such steps and then use a trigger on them instead of the source, but as always I would like to avoid several additional helper template sensors.
Is there a way without such helper and/or I only miss the tree in the woods in this use case?
No, you’ll need to record the temperature at each trigger into a separate entity. That could be done manually as part of the action (writing to an input_number) or automatically with a trigger-based template sensor that copies the temperature to itself when the automation is run (trigger off the last_triggered attribute of the automation, which is mis-named as it actually only updates if the action is run).
Then the automation would be triggered from the temperature sensor state but have a template condition to check if the difference from the prior run temperature recorded in your new entity is 5°C or more.
Thanks for your ideas and the fast reply. But in this idea, I still have a helper entity. Then I would still prefer to have the “rounded” template sensor from my idea to have less trigger of the automation.
I just hoped that there is an obvious solution without a helper.