Power meter reset leads to incorrect historical records

Moderator: leecollings

Post Reply
zaphod
Posts: 3
Joined: Thursday 05 December 2019 18:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11551
Contact:

Power meter reset leads to incorrect historical records

Post by zaphod »

Hi,
Each time the MySensor power meter resets the power usage value (such as after a power cut, reboot or domoticz update), this causes a couple of glitches :
- the detailed hourly power usage histogram of the log goes flat after the reset time (even though the values in the Meter table are not null after the reset time, they are just shifted down):
Selection_220.jpg
Selection_220.jpg (30.08 KiB) Viewed 395 times
- the daily power usage over the last week histogram shows a spurious value on the day the reset took place (the histogram bar take the value of the last power usage measure before the reset):
Selection_221.jpg
Selection_221.jpg (29.03 KiB) Viewed 395 times
which corresponds to the reset seen here in the database meter table:

Code: Select all

sqlite> select * from Meter  where DeviceRowID=76 order by date desc limit 20 offset 285;
76|236|4778|2020-01-19 23:20:00
76|194|4244|2020-01-19 23:15:00
76|151|4297|2020-01-19 23:10:00
76|120|4445|2020-01-19 23:05:00
76|81|4601|2020-01-19 23:00:01
76|41|4664|2020-01-19 22:55:00
76|0|4414|2020-01-19 22:50:00
76|33029|22089|2020-01-19 22:45:00
76|33029|22089|2020-01-19 22:40:00
76|33029|22089|2020-01-19 22:25:01
76|32961|3997|2020-01-19 22:20:00
76|32925|4164|2020-01-19 22:15:00
76|32891|4087|2020-01-19 22:10:02
76|32857|3668|2020-01-19 22:05:00
76|32826|3669|2020-01-19 22:00:00
76|32794|4088|2020-01-19 21:55:00
76|32759|5203|2020-01-19 21:50:00
76|32718|4593|2020-01-19 21:45:01
76|32681|4435|2020-01-19 21:40:00
76|32644|4415|2020-01-19 21:35:00
It's very strange how the daily sum can end being set at the value at 22:45:00? I'm willing to look at the code, if someone can point me in the right direction (which class/methods might be involved in this calculation) as I've not got any experience in the domoticz code structure.

Any help or advice welcome !
Cheers,
User avatar
lemassykoi
Posts: 17
Joined: Saturday 11 March 2017 23:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2025.1
Location: France
Contact:

Re: Power meter reset leads to incorrect historical records

Post by lemassykoi »

I believe I'm having the same kind of problem.
I'm living in France, where National Electricity Company is replacing all Electricity Meter for everybody.
When it's done, the tech which does this has to inject old indexes into new meter.
I'm assuming this because of the value which has been added (85 MegaWatts).
I restored a backup thinking that if I can skip the first seconds of new meter, it would be ok, but no.

image attached

Is there a way to correct ? Or should I delete device, and create a new one, to handle the new meter ? If so, can I keep historical datas of old meter ?

thanks all
Attachments
domoticz_linky.PNG
domoticz_linky.PNG (231.36 KiB) Viewed 375 times
Post Reply

Who is online

Users browsing this forum: Doler and 1 guest