I have an input_number sensor that gets a number manually added. This sensor feeds a Template Sensor and this Template Sensor then feeds a Utility Meter so it can calculate the running total. Each time the Template Entities is reloaded (e.g. I’m testing a new template sensor), it adds whatever value was last in the input_number sensor (and therefore the Template Sensor) to the Utility Meter, even though the value has not changed. Is it possible to prevent this from happening with the Template Sensor or the Utility Meter?
My current workaround is to change the input_number to log the change and then immediately set it back to 0. This appears to work, but it seems like there should be a smarter way to accomplish this. Any suggestions?
I’m inputting the delta values. It’s my monthly bill. I’m using this data point to see what I’m paying out of pocket versus what my costs would have been without solar.
via the Helper UI, the dropdown only allows selecting “sensor.” entities. I haven’t tried to create this utility meter in YAML to see if it’ll take.
While it’s not ideal, inputting the monthly bill total and then immediately changing the input number to zero appears to work. It’d be great if it didn’t require this extra step…and even better if my energy company had an API to pull in this balance automatically…
This will trigger whenever the input number changes and will set the sensor to the input number value. It shouldn’t trigger when templates are reloaded. But as I said, it is untested.
Thanks for this. I did just try the triggered template sensor, and at first it made both the sensor and utility meter report unavailable values until I changed the input number to 1. I then tested reloading template entities and it continued to increase the utility meter by 1 with each reload of Template Entities.
In the UI - I open the sensor either from a dashboard or search. Then enter the new a value and let it save/register. And then enter the new value (0) and let it save/register.