Uses ha-historical-sensor for correct historical statistics#410
Uses ha-historical-sensor for correct historical statistics#410root0x wants to merge 2 commits intoHandyHat:mainfrom
Conversation
|
@root0x I've been testing this for a few weeks --- it seemingly fixes the bug with missing data due to API failures/timeouts etc... i.e. the 'Energy Dashboard' seemingly shows the correct data throughout the day - however - if I want to now query the actual values - when looking at 'sensor.electric_consumption_today' for example - HA says the current value is 'Unknown' I've seen a few things about using a 'repair' to fix data sources etc. - but that doesn't seem to affect or fix this. Have you seen this ? or any guidance |
|
@adequatelyrusty regarding the unknown current state that is unfortunately part of using ha-historical-sensor. I would recommend reading their documentation as to why this is done. https://github.com/ldotlopez/ha-historical-sensor
|
@root0x - is it possible to set the 'current' state to be the last retrieved daily total though (appreciating that it could be somewhat behind timewise)? i.e. based on the question that follows the one you quoted?
|
I would say that it is possible to create a second sensor to just store that data. Feel free to raise a PR on my repo for this. |
|
@root0x so with your changes mentioned here are you able to get accurate hourly usage in home assistant similar to what is shown in the Bright app's hourly view? As in usage per hour, not a total accumulation updating every hour? |
|
Yes that's correct, it now shows usage for that period not an accumulated usage. If you use the energy dashboard you can get those totals if you want them. |
Description
As suggested by #389 this pull request uses ha-historical sensor.
Motivation and Context
If your smart meter fails to report usage data for some time (1 hour+) the integration currently will sum up all of the missing data points into one statistic. This means that potentially multiple hours usage data is logged as one which is incorrect. This pull request uses the ha-historical-sensor to retroactively add the (previously) missing data points and allow for correct statistics
How Has This Been Tested?
Has been running on my home assistant instance for 1 month now
Notes
For this pr to function you need some other fix pr's to be merged so i suggest running from my main branch https://github.com/root0x/ha-hildebrandglow-dcc/tree/main
Types of changes