I’m trying to create a template sensor that only updates when I use the update entity service. The issue is that the attributes for the sensor are changing frequently and these changes are making the sensor update.
What i need is for the sensor to only update on demand and at this point update the attributes from the source. See below from template.yaml. Any ideas appreciated.
I think I need to take a different approach to setting the attributes from within the script (or probably there is a much better way)…
For context - below is a chart that shows the issue. Source GPS data updates frequently and screws up the speed calculations - I need to fix this - but I can’t control the source sensor update frequency. It automatically starts high frequency GPS updates when I get within 1km of my house.
Create a triggered template sensor with a trigger that never occurs, or triggers when something you cause happens, like your current automation frequency triggers (whatever they are), then you would need one less automation.
As I said you can use the always false trigger and the entity update service or replace that trigger with whatever trigger(s) you are using in the automation now that calls the entity update service.
Looks like the trigger is working correctly. One last question. I am trying to add the last time the script ran - see below. It is working but in wrong timezone. Is there a better way?