I have created a template sensor (history_stats) to record time / day that my heater is on. The data in the sensor looks good and is correct but…
If I use either the build-in statistics graph card or a custom card and use the statistics data, it does not calculate the max/day correctly.
If I use a custom card and use group by the calculations and data/chart is correct.
raw data view from sensor history attached plus the chart using statistic graph card. In the config for the graph card, I have daily max in the config.
Good question! I think so. I just followed the instructions for the creation of the sensor template (history_stats). If I go to developer tools > statistics I can see all three that I have created.
If I use a custom card (e.g. RomRider apexcharts-card) and use the statistics function, it works but is incorrect data. The built-in Statistics Graph Card also returns incorrect data
If I use apexcharts-card but use group_by function, I can get the right data to display but will need to test how far back in time the data goes…
Thanks for helping by the way. Many of your posts have helped me get started with HA so big thanks!
Ok that’s definitely proved that it does generate LTS.
My guess is that it may be a time zone issue. i.e. the daily maximum may be using UTC time for the day instead of your local time.
Have you set up your time zone in Settings → Sysyrem → General ?
Also what installation method do you use?
If it is a VM of any type the system time zone has to be correct too.
The time zone of the system you are running your web browser/app on may have an effect too. There is now a setting in your profile (circle icon bottom left menu) to set the display to the server time rather than the web browser time.
Check out my heating dashboard - very proud of it. The wife thinks i’m crazy haha.
Took a load of work as the heater is basic but has a remote control with on/off so I use an IR blaster and created a template switch that turns it on and off. Limitation is that it’s not possible to get the actual state of the switch but I found a solution to that too!
Hi,
It looks like the daily reset of your sensor is after midnight. Therefore you have the old max value on the next day, if the next day is not higher. You see, that August 4 and August 5 is correct, because the max of August 5 is higher than August 4. But August 6 is wrong because the value for that day is lower.
I have the same issue with an entity that comes from Homematic which is there reset at 0:00 but until it arrives in HA it can be 0:00:30 and then you have the old value in the next day…
I am also still looking for a good solution for this problem.
I am using my own template sensors using the The history_stats sensor platform so I can do what I like within the scope of the platform. I think it will be more challenging for you but you might be able to take a similar approach.
I have changed the start variable by converting it to a time stamp and removing 60 seconds
By the way, if you are using history stats for an entire month you need to adjust your recorder purge keep days setting. It is only 10 days by default.