Page 1 of 1
Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Friday 11 November 2016 15:01
by rjblake
Stedin replaced both my electric and gas meters today. As a result, the counter have all been reset to 0. Now if I check the data, I have some strange values (very large negative numbers, or in case of gas 18446744949882800m3

). Can I assume that this will catch up/be reset at the end of the day, or is there something else I need to do (i.e. delete and recreate) all my devices in Domoticz?
Re: RE: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Sunday 13 November 2016 16:10
by stlaha2007
rjblake wrote:Stedin replaced both my electric and gas meters today. As a result, the counter have all been reset to 0. Now if I check the data, I have some strange values (very large negative numbers, or in case of gas 18446744949882800m3

). Can I assume that this will catch up/be reset at the end of the day, or is there something else I need to do (i.e. delete and recreate) all my devices in Domoticz?
Whas the current status? As the readings should continue with the new values, basicly starting over.
Else, create new gas and electricity by hand, replace them with the current P1 versions to save your history. And restart your P1 (Hardware tab) or restart Domoticz or Your whole Pi. As this should recreate new gas and electricity with the current meters near zero. After that is recoring correctly +/- 1 hour, you can replace your manually created meters and have your meters including history and started as if you just got your smartmeter and P1 cable installed.
But do backup first !!!! It gives you a starting point in case you messed up

Re: RE: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Monday 14 November 2016 14:06
by rjblake
stlaha2007 wrote:rjblake wrote:Stedin replaced both my electric and gas meters today. As a result, the counter have all been reset to 0. Now if I check the data, I have some strange values (very large negative numbers, or in case of gas 18446744949882800m3

). Can I assume that this will catch up/be reset at the end of the day, or is there something else I need to do (i.e. delete and recreate) all my devices in Domoticz?
Whas the current status? As the readings should continue with the new values, basicly starting over.
Else, create new gas and electricity by hand, replace them with the current P1 versions to save your history. And restart your P1 (Hardware tab) or restart Domoticz or Your whole Pi. As this should recreate new gas and electricity with the current meters near zero. After that is recoring correctly +/- 1 hour, you can replace your manually created meters and have your meters including history and started as if you just got your smartmeter and P1 cable installed.
But do backup first !!!! It gives you a starting point in case you messed up

I looked at editing the database to fix/correct the issue; but in the end I decided to simply delete the devices and recreate with a new starting point. As I only had around 2 weeks of history, not a big loss. I would prefer an easier option to address this if anything like this should happen in the future (unlikely for next 10 years, but not impossible given my 3 year old smart meters had to be replaced already)
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Monday 14 November 2016 14:12
by stlaha2007
Replacing is added for a long time. For instance those wireless temp-hum-baro sensors, when battery dies, they generate a new id and will be discovered as a new one. Which you use to replace the one with the id of the dead battery.
Created myself dummy smartmeters, pushes readings into it through scripts, for gas and electricity and used this trick a few times to save history of almost a year now.
Had the same issue beginning this year, they finally replaced my watermeter and so started at zero. Done it nearly the same way.
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Monday 07 June 2021 18:47
by rolandbreedveld
My smart P1 meter was replaced, here is what I did to correct the values:
yes, you can simply delete that day, but, this is the better way.
Do it the morning after the day of replacement.
If not, keep a backup of the database from that moment for query, otherwise the needed values are gone!
you need these values:
- the latest values from the date before replacement
- the latest values from just before the old meter is removed
- the last values of the replacement day
In my example, the replacement date is 2021-06-04, my gas meter is IDX 116, Electric IDX=115
For Gaz:
sqlite3 domoticz.db "select * from meter where devicerowid='116' and date >='2021-06-03';"
116|12767679|0|2021-06-03 23:55:00 <<< Last value the day before
116|12768252|0|2021-06-04 14:50:00 <<< Last sign of life of the old meter
116|204|0|2021-06-04 23:55:00 <<< End of the first day of the bright new meter
Calculate the correct day value:
echo $((12768252-12767679+204))
Result: 777
Update the database:
sqlite3 domoticz.db "update meter_calendar set value='777' where devicerowid='116' and date ='2021-06-04';"
Same for electricity, you only need the values 1,2,5 and 6:
sqlite3 domoticz.db "select * from multimeter where devicerowid='115' and date >='2021-06-03';"
115|16764879|5455636|920|0|13979487|12856944|2021-06-03 23:55:00
115|16768485|5455636|0|1050|13981591|12858326|2021-06-04 11:50:00
115|783|1806|818|0|7503|4683|2021-06-04 23:55:00
Calculate the real usages:
echo $((16768485-16764879+783))
echo $((5455636-5455636+1806))
echo $((13981591-13979487+7503))
echo $((12858326-12856944+4683))
Results: 4389 1806 9607 6065
Update the database:
sqlite3 domoticz.db "update multimeter_calendar set value1='4389', value2='1806', value5='9607', value6='6065' where devicerowid='115' and date ='2021-06-04';"
I choose to keep the latest counter values from the old meter, in case the administration of my electricity company need them.
regards, Roland
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Friday 06 January 2023 9:56
by BitfullByte
Thanks @rolandbreedveld ! Managed to update my history thanks to your queries.
It was a bit of a puzzle, since I didn't manage to do it directly the day after. I exported some of the metrics to influx, but only for gas was I able to accurately recalculate the exact values... ah well
Tip: the devicerowid can be found in the URL (in case anyone else wonders how to get it)
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Thursday 22 February 2024 14:40
by njlammerts
Does this mean the readings in the diagram(s) just continue from the old meter to the new meter?

- Domo7.JPG (63.88 KiB) Viewed 900 times
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Thursday 22 February 2024 14:55
by HvdW
One thing you could consider is to export all gas data and import those into mindergas.nl
It gives you a lot of insight and nice graphs.
The other way around other people could consider to export their gas readings from mindergas.nl into domoticz.
My data go back to 2013 and I imported just the last 2 years.
This renders nice and easy understandable bar graphs in Domoticz.
BTW Is there a site that can collect all electricity data?
Like pvputput for pv panels with electricity consumption and return added.
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Posted: Saturday 02 March 2024 14:23
by rolandbreedveld
njlammerts wrote: ↑Thursday 22 February 2024 14:40
Does this mean the readings in the diagram(s) just continue from the old meter to the new meter?
Domo7.JPG
yes, if you follow the instructions