P1 meter shows actual but no history

Moderator: leecollings

Post Reply
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

P1 meter shows actual but no history

Post by rdas »

Hi all,

Last week the P1 meter stopped showing the history.
I have no idea why.

Values are still getting in, and as far as I can tell they are correct.
I also see the history before the 18th, but not after the 18th of oct at 19:10 it seems like it just stopped logging.

Tile showing actual value:
2021-10-26 09_59_19-Domoticz P1 tile.png
2021-10-26 09_59_19-Domoticz P1 tile.png (27.71 KiB) Viewed 1709 times

The history not showing after 18th:
2021-10-26 08_49_54-Domoticz P1 log 2.png
2021-10-26 08_49_54-Domoticz P1 log 2.png (338.21 KiB) Viewed 1709 times

Any ideas what could be the issue here?
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter shows actual but no history

Post by waltervl »

Clear browser cache. Use CTRL-F5 first See also wiki page.
What theme are you on? Try to change to default theme.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

waltervl wrote: Tuesday 26 October 2021 15:32 Clear browser cache. Use CTRL-F5 first See also wiki page.
What theme are you on? Try to change to default theme.
CRTL+F5 and manually cleared cache, not solved.
I use "dark-th3me" and switching to default did not solve the issue.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter shows actual but no history

Post by waltervl »

Strange...
If you click on the menu icon in the empty graph, can you download the CSV file and do you get the expected values?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

last rows of CSV for "usage last 7 days":
"2021-10-18 17:50:00";0;0;0;0
"2021-10-18 17:55:00";0;12;0;0
"2021-10-18 18:00:00";0;132;0;0
"2021-10-18 18:05:00";0;216;0;0
"2021-10-18 18:10:00";0;156;0;0
"2021-10-18 18:15:00";0;144;0;0
"2021-10-18 18:20:00";0;168;0;0
"2021-10-18 18:25:00";0;144;0;0
"2021-10-18 18:30:00";0;228;0;0
"2021-10-18 18:35:00";0;180;0;0
"2021-10-18 18:40:00";0;168;0;0
"2021-10-18 18:45:00";0;168;0;0
"2021-10-18 18:50:00";0;168;0;0
"2021-10-18 18:55:00";0;156;0;0
"2021-10-18 19:00:00";0;156;0;0
"2021-10-18 19:05:00";0;228;0;0
"2021-10-18 19:10:00";0;156;0;0

CSV for "usage last week" is as empty as the graph.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter shows actual but no history

Post by waltervl »

Ah Ok, this is somewhat more fundamental issue.
It seems that your smart meter is not sending, or Domoticz is not receiving the data. It also does not show actual does it?
What is in the logging about the smart meter (menu Setup-Log)? It could give some hints.
Check the cables and/or communication with the smart meter.
Try to restart your Pi and see if it reconnects.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

waltervl wrote: Wednesday 27 October 2021 16:51 Ah Ok, this is somewhat more fundamental issue.
It seems that your smart meter is not sending, or Domoticz is not receiving the data. It also does not show actual does it?
What is in the logging about the smart meter (menu Setup-Log)? It could give some hints.
Check the cables and/or communication with the smart meter.
Try to restart your Pi and see if it reconnects.
Yes, seems like it.
Domoticz is receiving data, I can see the actual values.
The log also shows that its receiving data:

Code: Select all

2021-11-02 07:37:42.267 Slimme meter 1: P1 Smart Meter (Slimme meter)
2021-11-02 07:37:42.275 Slimme meter 1: General/Voltage (Voltage L1)
2021-11-02 07:37:42.281 Slimme meter 1: General/Voltage (Voltage L2)
2021-11-02 07:37:42.285 Slimme meter 1: General/Voltage (Voltage L3)
2021-11-02 07:37:42.290 Slimme meter 1: Usage (Usage L1)
2021-11-02 07:37:42.294 Slimme meter 1: Usage (Usage L2)
2021-11-02 07:37:42.299 Slimme meter 1: Usage (Usage L3)
2021-11-02 07:37:42.303 Slimme meter 1: Usage (Delivery L1)
2021-11-02 07:37:42.308 Slimme meter 1: Usage (Delivery L2)
2021-11-02 07:37:42.312 Slimme meter 1: Usage (Delivery L3)
Restarted the PI several times the last week to no avail.

I think there is something wrong with logging the data or showing the data from the log.
Could there be some reason why Domoticz is not capable of storing the data of this meter in the log?
Of could it be that one faulty value in the meter log causes the log to not show beyond this faulty value?
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter shows actual but no history

Post by waltervl »

Can you attach a telegram that is sent from the smart meter?
I do not have this device so not sure what is going wrong or what should be normal behavior.
Perhaps add debug to the log (you will have to restart Domoticz)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
HansieNL
Posts: 957
Joined: Monday 28 September 2015 15:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter shows actual but no history

Post by HansieNL »

I had some strange behavior when a SD-card was corrupt (read-only). I could run Domoticz, but new data could not be saved to the SD-card.
Maybe you can check?
You can check by trying in a PC to write a text file to the boot partition of the SD-card.If you get a message that your SD-card is read-only you know that’s the problem.
Blah blah blah
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

@waltervl
I don't know how to do that.
I just discovered that in the general domoticz log "ALL" does not mean all log messages, some errors are shown in ALL and other are only mentioned in ERROR.
I now see that Domoticz is complaining about a malformed database :shock:

Code: Select all

2021-11-03 17:15:00.275 Error: SQL Query("INSERT INTO MultiMeter (DeviceRowID, Value1, Value2, Value3, Value4, Value5, Value6) VALUES ('187', '246880', '52464', '1567', '0', '184703', '147276')") : database disk image is malformed
2021-11-03 17:15:00.286 Error: SQL Query("DELETE FROM Temperature WHERE strftime('%s',datetime('now','localtime')) - strftime('%s',Date) > (SELECT p.nValue * 86400 From Preferences AS p WHERE p.Key='5MinuteHistoryDays')") : database disk image is malformed
2021-11-03 17:15:00.287 Error: SQL Query("DELETE FROM Meter WHERE strftime('%s',datetime('now','localtime')) - strftime('%s',Date) > (SELECT p.nValue * 86400 From Preferences AS p WHERE p.Key='5MinuteHistoryDays')") : database disk image is malformed
2021-11-03 17:15:00.287 Error: SQL Query("DELETE FROM MultiMeter WHERE strftime('%s',datetime('now','localtime')) - strftime('%s',Date) > (SELECT p.nValue * 86400 From Preferences AS p WHERE p.Key='5MinuteHistoryDays')") : database disk image is malformed
2021-11-03 17:15:00.287 Error: SQL Query("DELETE FROM Percentage WHERE strftime('%s',datetime('now','localtime')) - strftime('%s',Date) > (SELECT p.nValue * 86400 From Preferences AS p WHERE p.Key='5MinuteHistoryDays')") : database disk image is malformed
As I also see "temperature" in the SQL errors, so I have checked my temperature senors and see that one of them also does not record any history.
So some logging is broken and some is not.

So this seems like the database is corrupted somehow?
I did not update/upgrade anything. Even no restart at the moment of the last data point.
Can I fix that or do I need a new database?
Unfortunately my PI backup only goes back a few days.
I also have automatic backup enabled, but all three files are just 4096 bytes, so these seem useless.
Will check the oldest backup of the PI to check if there is a useful backup.

@HansieNL, Good point, also have had that. Now running a 120GB SSD that seems to be functioning OK.
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: P1 meter shows actual but no history

Post by waltervl »

As mentioned by hansieNL it could also be a full SD card or failure on the SD card. See also the troubleshooting page of the wiki https://www.domoticz.com/wiki/Troubleshooting
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

waltervl wrote: Wednesday 03 November 2021 21:59 As mentioned by hansieNL it could also be a full SD card or failure on the SD card. See also the troubleshooting page of the wiki https://www.domoticz.com/wiki/Troubleshooting
As mentioned in my previous post, I'm using an USB SSD.
This is without any SD card in the PI.
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

I found this post in another thread about malformed database.
I've just run this very conveniënt script to fix this an it seems to have worked.
No more malformed database error in the log.
Now waiting to see whether the meter/temp history is written again.
rdas
Posts: 12
Joined: Tuesday 13 August 2019 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: The Netherlands
Contact:

Re: P1 meter shows actual but no history

Post by rdas »

Yes, I have a new value in the history.
This is now officially fixed.

Thanks for guiding me in the right direction!
It helps to have another angle on issues like this.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests