Page 1 of 1

Correcting database month total value

Posted: Friday 13 February 2026 14:53
by hans1612
Last year february 12 I moved house. Now these values are in the database causing a huge usage in feb 2025:

Code: Select all

sqlite> SELECT * FROM Meter_calendar WHERE DeviceRowID=8 AND Date>='2025-01-28' AND Date<'2025-03-08';
DeviceRowID|Value|Counter|Date
8|2534|3087874|2025-01-28
8|1387|3089261|2025-01-29
8|2728|3091989|2025-01-30
8|2265|3099687|2025-02-03
8|2912|3102599|2025-02-04
8|1616|3104215|2025-02-05
8|1983|3106198|2025-02-06
8|3332|3109530|2025-02-07
8|2014|3113587|2025-02-09
8|3627|3117214|2025-02-10
8|1126|3654334|2025-02-13   <<<
8|4587|3658921|2025-02-14
8|4498|3663419|2025-02-15
8|2373|3665792|2025-02-16
8|2933|3668725|2025-02-17
8|2762|3671487|2025-02-18
8|3337|3674824|2025-02-19
8|4906|3679730|2025-02-20
8|798|3680528|2025-02-21
8|2299|3682827|2025-02-22
8|363|3683190|2025-02-23
8|2116|3685306|2025-02-24
8|2492|3687798|2025-02-25
8|975|3688773|2025-02-26
8|1184|3689957|2025-02-27
8|879|3690836|2025-02-28
8|3994|3694830|2025-03-01
8|1689|3696519|2025-03-02
8|589|3697108|2025-03-03
The actual usage is around 60 m3 and not 600 m3 that is in the graph. To get an idea how the month total is calculated I shift-clicked removed a few day -totals. That did not make a difference in the month total.
My question is: Can the feb month value be corrected by changing Counter -numbers? Without touching the January and March month totals. Probably the '2025-02-03' ?

Thanks.

Re: Correcting database month total value

Posted: Friday 13 February 2026 17:01
by willemd
The second field is the daily usage, the third field is the counter. In order to keep the dbase consistent those values should normally match from day to day. But I know even a domoticz error in the daily closing routine makes those values inconsistent (last 5 minutes is missing in the second field), so I think you can correct them.

I would make a dbase backup before doing so.

I am wondering how you did not get more deviating values than this. Did the P1 meter in your new house show values close to the P1 meter in your old house?

Re: Correcting database month total value

Posted: Friday 13 February 2026 19:40
by hans1612
Yes, I know that I can correct the database, my question is which entry should be changed? The 'Counter' number is (I think) the total of m3 gas * 1000 that the P1 picks up from the meter. So in my old house the number was 3117.214 m3 and in the new house 3654.233 on date 2025-02-13.
537 m3 difference.

Re: Correcting database month total value

Posted: Friday 13 February 2026 20:41
by willemd
So the actual counter values are both correct.

I know I am not answering your question (you can easily find out the answer by making some changes), but I would personally put the old house values on a separate device and keep that for history.

And start building up new data for the new house on a new device. That is a good representation of reality.