You’re correct, I’ve used time_pattern for testing, but the sensor isn’t showing up in HA.
I’ve created a template.yaml and made a referal to that file in my configuration.yaml (template: !include includes/template.yaml), my template.yaml starts with sensor: (the other sensors in template.yaml work).
For testing I’ve used the following and I hoped it would increment the value of sensor.levering_elektra with one every 10 seconds.
Initially your sensor is undefined so the int filter does not work (there are probably errors about this in your logs). Supplying a default of 0 will fix this.
I wanted to add a fixed daily value for grid consumption and found this solution helpful.
For resetting to 0 I just check for value and set accordingly.
Thanks Tom for the link. I have data on my off-grid solar and only some household grid appliances going into HA. I also have energy data for the past 6 years and grid consumption is fairly consistent. Just wanted a simple means to reflect this unmeasured usage in the Energy tab.
My post was really on a solution to the initial sensor value if someone else happened upon this thread. I’ve only used it for a day but data is being incremented and saved and it survives a reboot.