HandyHat / ha-hildebrandglow-dcc

Home Assistant integration for UK SMETS (Smart) meters pulling data from the DCC via the Hildebrand Glow API
MIT License
230 stars 33 forks source link

Invalid Reading? #227

Closed Meatballs1 closed 1 year ago

Meatballs1 commented 2 years ago

I received an erroneous reading:

image

Statistics table now contains a big jump between 0800 and 0900:

sqlite> select * from statistics where metadata_id = 131 order by created DESC limit 24
   ...> ;
id|created|metadata_id|start|mean|min|max|last_reset|state|sum
538628|2022-05-22 14:00:10.397682|131|2022-05-22 13:00:00.000000|||||529.06|442.549
538520|2022-05-22 13:00:10.486244|131|2022-05-22 12:00:00.000000|||||528.869|442.358
538412|2022-05-22 12:00:10.387409|131|2022-05-22 11:00:00.000000|||||528.827|442.316
538304|2022-05-22 11:00:10.400448|131|2022-05-22 10:00:00.000000|||||528.825|442.314
538196|2022-05-22 10:00:10.393659|131|2022-05-22 09:00:00.000000|||||528.796|442.285
538088|2022-05-22 09:00:10.310056|131|2022-05-22 08:00:00.000000|||||528.796|442.285
537980|2022-05-22 08:00:10.427848|131|2022-05-22 07:00:00.000000|||||516.444|429.933
537872|2022-05-22 07:00:10.340629|131|2022-05-22 06:00:00.000000|||||516.444|429.933
537764|2022-05-22 06:00:10.830822|131|2022-05-22 05:00:00.000000|||||516.443|429.932
537656|2022-05-22 05:00:10.453906|131|2022-05-22 04:00:00.000000|||||516.287|429.776
537548|2022-05-22 04:00:10.428892|131|2022-05-22 03:00:00.000000|||||516.139|429.628
537440|2022-05-22 03:00:10.422583|131|2022-05-22 02:00:00.000000|||||515.948|429.437
537332|2022-05-22 02:00:10.396159|131|2022-05-22 01:00:00.000000|||||513.724|427.213
537224|2022-05-22 01:00:10.405518|131|2022-05-22 00:00:00.000000|||||513.724|427.213
537116|2022-05-22 00:00:10.403130|131|2022-05-21 23:00:00.000000|||||513.724|427.213
537008|2022-05-21 23:00:10.414657|131|2022-05-21 22:00:00.000000|||||513.724|427.213
536900|2022-05-21 22:00:10.411994|131|2022-05-21 21:00:00.000000|||||513.724|427.213
536792|2022-05-21 21:00:10.378476|131|2022-05-21 20:00:00.000000|||||513.724|427.213
536684|2022-05-21 20:00:10.413584|131|2022-05-21 19:00:00.000000|||||513.724|427.213
536576|2022-05-21 19:00:10.459376|131|2022-05-21 18:00:00.000000|||||513.137|426.626
536468|2022-05-21 18:00:10.468323|131|2022-05-21 17:00:00.000000|||||512.447|425.936
536360|2022-05-21 17:00:10.451888|131|2022-05-21 16:00:00.000000|||||512.446|425.935
536252|2022-05-21 16:00:10.484327|131|2022-05-21 15:00:00.000000|||||512.446|425.935
536144|2022-05-21 15:00:10.418397|131|2022-05-21 14:00:00.000000|||||512.445|425.934

Not 100% if fixing the value and all those above would work? Would I just get another large jump later on?

My actual usage according to the bright app is (I have solar):

0800 - 0 0830 - 0 0900 - 0 0930 - 0.03 1000 - 0.0

HandyHat commented 2 years ago

Interesting - the only way I can see this occuring is if data from previously in the year that wasn't in Hildebrand systems got added to them. Did you by any chance recently look back at historic data in the app?

To fix this, rather than directly editing the database you can edit the long term statistics via the Home Assistant UI - details here: https://www.home-assistant.io/blog/2022/04/06/release-20224/#adjusting-long-term-statistics

Meatballs1 commented 2 years ago

Coincidentally I had another erroneous spike today (10kWh) at 0800-0900 on the graph (0600-0700 in table) but not on any of the interim days:

545944|2022-05-25 09:00:10.764244|131|2022-05-25 08:00:00.000000|||||566.648|480.137
545834|2022-05-25 08:00:10.831118|131|2022-05-25 07:00:00.000000|||||566.581|480.07
545724|2022-05-25 07:00:10.786395|131|2022-05-25 06:00:00.000000|||||556.319|469.808
545614|2022-05-25 06:00:10.737544|131|2022-05-25 05:00:00.000000|||||556.319|469.808

Bright seems to be fairly up to date without big periods of missing readings 1703 and I have values up to 1600 in the app. Had a new meter on 4th April so shouldn't have additional data coming in as far as I can tell and not had any significant gaps but could be wrong.

I need to find time to upgrade HA to get to the editing statistics feature..!

ColinRobbins commented 2 years ago

The spikes are ‘usual’ sadly, The reading provided is the reading is the delta since the last success. It seems from your stats, that some data points were not read (quite common sadly), so when it finally starts working, you get a spike.

HandyHat commented 1 year ago

v1.0.0 of the integration improves the stability of retrieving the data from the API and so spikes like this should no longer occur.