I want to calculate also how much time during last hour sensor was on. I use helper with “Average step” for that. This one does not work as expected. Why the graph looks so strange?
Gaps in the graph can occur when HA is reloaded/restarted, when source sensors or devices are unavailable or unknown, or when the underlying math of the sensor produces errors (for example, division by 0).
I thought that Statistics are suitable for my case but I will try with your suggestion. After creation (in UI) as helper can I see it’s “code” somewhere? I will observe its graph now to see if it shows what I expect.
In fact I assumed that I can but hoped that even those from UI are in some config file and can be used as a base. However, they probably are stored in some database which is not so easily accessible.
Probably I have to put something in “state” (“stan” on my screenshot). However, I do not know what. Probably value that my sensor reports as on but where can I find exact value/string?
I am also not so sure about this config: