
Replacement Electric/Gas meters - meter reading reset and usage?
Moderators: leecollings, remb0
-
- Posts: 142
- Joined: Friday 21 October 2016 9:25
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Netherlands
- Contact:
Replacement Electric/Gas meters - meter reading reset and usage?
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?

-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: RE: Replacement Electric/Gas meters - meter reading reset and usage?
Whas the current status? As the readings should continue with the new values, basicly starting over.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?
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

-
- Posts: 142
- Joined: Friday 21 October 2016 9:25
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Netherlands
- Contact:
Re: RE: Replacement Electric/Gas meters - meter reading reset and usage?
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)stlaha2007 wrote:Whas the current status? As the readings should continue with the new values, basicly starting over.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?
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
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
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.
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.
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
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
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
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
-
- Posts: 2
- Joined: Wednesday 12 January 2022 11:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
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)
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)
-
- Posts: 145
- Joined: Wednesday 12 August 2020 17:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.2
- Location: Fryslan
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
Does this mean the readings in the diagram(s) just continue from the old meter to the new meter?
-
- Posts: 601
- Joined: Sunday 01 November 2015 22:45
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2023.2
- Location: Twente
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
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.
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.
Bugs bug me.
- rolandbreedveld
- Posts: 156
- Joined: Wednesday 09 March 2016 11:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2021.1
- Contact:
Re: Replacement Electric/Gas meters - meter reading reset and usage?
yes, if you follow the instructionsnjlammerts 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
Raspberry Pi(SSD)+UPS HAT,Dashticz on WallTablet,HomeBridge, P1, HarmonyHub,FritzBox,API to 123Solar+ABB-PowerOne+SMA,ESP-Leds(flashed LSC),Tasmota,Shelly,MQTT,Mosquito,Node-Red,http://wiki.breedveld.net/index.php?title=RPiWaterMeter, Mercedes-Me
Who is online
Users browsing this forum: No registered users and 1 guest