P1 Smart Meter, Return value invalid, overflow error?

Moderator: leecollings

Post Reply
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

I have connected a serial to USB (FTDI) to my domoticz server since a year or so.
In the beginning the value for returned power (which is none existant) was 0 as it should be.

But since a half year or so, the value displays "18446744073709552.000 kWh, 0.015"
When I google "18446744073709552" I only find some errors about an overflow.
Power usage and logs are displayed normally.

I have had an RPI3 for the past year, I have played with it a lot so I thought I messed something up.
Viewed the database but no sign of errors.

Today I replaced the RPI with an old laptop, installed Ubuntu 20.04 and a fresh new installation of Domoticz.
Did not change any config, added the powermeter and immidiatly got the same problem.

Does anyone have a clue or tip for me to fix this?

Thank you in advance.

EDIT:
I also had a RS232 to LAN converter, so I connected this instead of the USB, added new HW without transfer (so blank) and still the same error.

My Telegram looks like this:
0-0:96.1.1(5A***************************************) (deleted identifier)
1-0:1.8.1(11915.069*kWh)
1-0:1.8.2(14983.100*kWh)
1-0:2.8.1(00000.007*kWh)
1-0:2.8.2(00000.015*kWh)
0-0:96.14.0(0002)
1-0:1.7.0(0001.39*kW)
1-0:2.7.0(0000.00*kW)
0-0:17.0.0(0999.00*kW)
0-0:96.3.10(1)
0-0:96.13.1()
0-0:96.13.0()
!

I have no solar nor ever returned anything.
Domoticz looks like this:
DomoticzP1.jpg
DomoticzP1.jpg (49.78 KiB) Viewed 2452 times
It is a DSMR 2.2 meter from 2012.
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Still having this issue.
I can edit the database manually and then the return today is 0, but like an hour or at most next day this strange value appears again.

I tried two interfaces and a DB cleanup but this strange value will not dissapear.

Anyone got a clue?
I would like to have this fixed before october 2nd before my solar system is installed...
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by waaren »

sanscorp wrote: Sunday 20 September 2020 20:16 Anyone got a clue?
Can you have a look in the database and share what you see with

Code: Select all

dz=/opt/domoticz # change to domoticz dir
smart=35 # change to device ID for your smartmeter
sudo sqlite3 -header $dz/domoticz.db "Select Name, ID, Svalue from DeviceStatus where id = $smart;Select * from multimeter where DeviceRowid = $smart and date = (select min(date) from multimeter where devicerowid = $smart and date(date) = date('now') );Select * from multimeter where DeviceRowid = $smart and date = (select max(date) from multimeter where devicerowid = $smart);Select max(Date),* from MultiMeter_Calendar where DeviceRowID = $smart"
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Above query gives an error.
Device ID in domoticz is 2, but smart 2 or smart 1 says "Error: no such table: DeviceStatus"

Here is a screenshot of the DB:
screenshotDB.jpg
screenshotDB.jpg (304.98 KiB) Viewed 2392 times
But it also happens with a complete new install.
Empty database, new added hardware and device, no other changes made to domoticz or system at all.

I have tried this on Raspberry Pi and Ubuntu 20.04 LTS server.
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Here is MultiMeter_Calender.
scnreesnhot2DB.jpg
scnreesnhot2DB.jpg (368.52 KiB) Viewed 2391 times
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by waaren »

sanscorp wrote: Monday 21 September 2020 13:54 Above query gives an error.
Device ID in domoticz is 2, but smart 2 or smart 1 says "Error: no such table: DeviceStatus"
Sorry but the screenshots do not help.
Did you change the directory and smartmeter id to the right values without spaces around the '=' ?
If you see "Error: no such table: DeviceStatus" you did not open the domoticz database
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

This is the data I got on my primary system.

Verbruik|1|11981634;15017030;7;16;250;0
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11980868|7|160|0|15015501|16|2020-09-21 00:00:00
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|220|0|15017028|16|2020-09-21 16:05:00
max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
2020-09-20|1|10566|6|2830|1|0|15|11980868|7|15015501|16|2020-09-20


I just for the heck of it installed the RPI (raspberry OS) and freshly installed Domoticz.
First few hours are OK, then the same problem.

This is the data on the test RPI:

Name|ID|sValue
Verbruik|1|11981634;15017053;7;16;220;0
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|170|0|15016663|16|2020-09-21 13:15:00
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|230|0|15017048|16|2020-09-21 15:10:00
max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
||||||||||||
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Last one, deleted the device on the test RPI and added it again.
Then the counter is 0 as it should be.
Just after a few seconds, return shows: 18446744073909552.000

When zero:
Name|ID|sValue
Power|1|11981634;15017124;7;16;300;0
max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
||||||||||||

After few seconds with strange value:
Name|ID|sValue
Power|1|11981634;15017132;7;16;300;0
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|310|0|15017130|16|2020-09-21 15:30:00
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|310|0|15017130|16|2020-09-21 15:30:00
max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
||||||||||||
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by waaren »

sanscorp wrote: Monday 21 September 2020 16:06 This is the data I got on my primary system.

Code: Select all

Verbruik|1|11981634;15017030;7;16;250;0
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11980868|7|160|0|15015501|16|2020-09-21 00:00:00
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|220|0|15017028|16|2020-09-21 16:05:00
max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
2020-09-20|1|10566|6|2830|1|0|15|11980868|7|15015501|16|2020-09-20
You don't mention the domoticz version you are on. If not on the latest version the rounding errors that cause this behavior might have already been solved in a later version.

devicestatus:
This is the row containing current data from smartmeter.
first two numbers in Svalue is total energy from the grid (high tariff + low tariff) ==>> 11981634 + 15017030 = 26998.664 kWh
3rd and 4th number in Svalue is total energy to the grid (high tariff + low tariff) ==>> 7 + 16 = 0.023 kWh
5th number in sValue is current usage in Watt
6th number in sValue is current return in Watt

Code: Select all

Name|ID|sValue 
Verbruik|1|11981634;15017030;7;16;250;0
multimeter (every 5 minutes) :
Value1: High Tariff from the grid
Value2: High Tariff to the grid
Value3: Usage from the grid (Watt)
Value4: Delivery to the grid (Watt)
Value5: Low Tariff from the grid
Value6: Hig Tariff to the grid

Code: Select all

DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11980868|7|160|0|15015501|16|2020-09-21 00:00:00   -- first sample of today
DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Date
1|11981634|7|220|0|15017028|16|2020-09-21 16:05:00 -- last sample of today until now


multimeter_calendar (daily):
value1 used low on date
value2 returned low on date
value3 max value usage from the grid on date (Watt)
value4 min value usage from the grid on date (Watt)
value5 used high on date
value6 returned high on date
counter1 High Tariff from the grid
counter2 High Tariff to the grid
counter3 Low Tariff from the grid
counter4 Low Tariff to the grid

Code: Select all

max(Date)|DeviceRowID|Value1|Value2|Value3|Value4|Value5|Value6|Counter1|Counter2|Counter3|Counter4|Date
2020-09-20|1|10566|6|2830|1|0|15|11980868|7|15015501|16|2020-09-20
For your device Verbruik the display on the utility page tries to show the total return from yesterday ( 6 + 15 ) minus what it gets from the smartmeter ( 7 + 16 ) but it can only show positive numbers and the way C++ handles this is what you see on the utility page (it turns it into a very large number. The difference between 0.006 and 0.007 and 0.015 and 0.016 are probably rounding errors

The good part is that this large number is not in the database and when you start sending to the grid it will solve itself. Until then there is not much you can do about it because even if you correct it in the database it will return the next day
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

I am on the latest stable, but updating to beta didn't help either.

1 year ago the problem did not exist.
A rounding problem sounds like what I expected.
Wiljums
Posts: 28
Joined: Sunday 11 February 2018 21:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by Wiljums »

I might see similar wrong values with my smart meter. It worked fine for several months, since then random strange readings:

Image
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

My datase is allright. It's something else then what you are experiencing as far as I can see.
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Now, since a few days, 24h log is gone.. not even visable.
Just got a new meter installed, SMR 5.0.

Data integrity check (downloaded backup, checked with DB Browser) does not give any error.
Which columb or table is for the 24h data?

Was just running Version 2020.2 (April 26th 2020) and updated once to allow the latest BETA.

Cleaned up database (removed false 0,016 kwh) and tried again, no difference.
Also deleted the hardware and added it again, starts counting again (from 0) but no 24H visable.
Restored database to before changes.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by waaren »

sanscorp wrote: Wednesday 30 September 2020 12:09 Which columb or table is for the 24h data?
table MultiMeter

Did you clear cache and appcache (different things) after installing different domoticz version?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
sanscorp
Posts: 11
Joined: Thursday 20 June 2019 19:42
Target OS: -
Domoticz version:
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by sanscorp »

Forgot to mention, but yes, I cleared the cache in Google Chrome.
Same problem with IE and Edge, which I never use.

Table Multimeter is filled from 23-09 till today.

After removing HW en thus all previous logs.
When I look at the Domoticz interface and the Power log, I see 4 graphs:
- Last 7 days
- Last week
- Last month
- Last year

:lol:
gropi
Posts: 13
Joined: Thursday 26 April 2018 20:03
Target OS: Linux
Domoticz version: 4.11786
Location: Germany
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by gropi »

I experience similar/same issue. As long as I draw power from the net everything is displayed correctly. As soon as I supply power back (negative value), it will be display as a very high positive number.

I have read out over the API the content:
http://your-ip:8080/json.htm?type=devices&rid=YOUR-IDX

The data shows negative (-79)
"Data": "1091530.2;0;2217.5;0;-79;0",
Usage shows wrong values:
"Usage": "18446744073709551537 Watt",

I assume this is an overflow topic, because if You add the 2 (positive) numbers You get exactely 2^64.
Spoiler: show
{
"ActTime": 1607856670,
"AstrTwilightEnd": "18:22",
"AstrTwilightStart": "06:13",
"CivTwilightEnd": "17:04",
"CivTwilightStart": "07:32",
"DayLength": "08:18",
"NautTwilightEnd": "17:44",
"NautTwilightStart": "06:51",
"ServerTime": "2020-12-13 11:51:10",
"SunAtSouth": "12:18",
"Sunrise": "08:09",
"Sunset": "16:27",
"app_version": "4.11786",
"result": [
{
"AddjMulti": 1.0,
"AddjMulti2": 1.0,
"AddjValue": 0.0,
"AddjValue2": 0.0,
"BatteryLevel": 255,
"Counter": "1091.530",
"CounterDeliv": "2.217",
"CounterDelivToday": "0.169 kWh",
"CounterToday": "3.616 kWh",
"CustomImage": 0,
"Data": "1091530.2;0;2217.5;0;-79;0",
"Description": "",
"Favorite": 1,
"HardwareID": 2,
"HardwareName": "Dummy",
"HardwareType": "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal": 15,
"HaveTimeout": false,
"ID": "14136",
"LastUpdate": "2020-12-13 11:51:01",
"Name": "Stromz\u00e4hler",
"Notifications": "false",
"PlanID": "14",
"PlanIDs": [
14
],
"Protected": false,
"ShowNotifications": true,
"SignalLevel": "-",
"SubType": "Energy",
"SwitchTypeVal": 0,
"Timers": "false",
"Type": "P1 Smart Meter",
"TypeImg": "counter",
"Unit": 1,
"Usage": "18446744073709551537 Watt",
"UsageDeliv": "0 Watt",
"Used": 1,
"XOffset": "371",
"YOffset": "286",
"idx": "230"
}
],
"status": "OK",
"title": "Devices"
}
Domoticz Version: 2023.1
Platform: Openmediavault 6; Docker; HP Microserver Gen8
Plugin/Hardware: MySensors Gateway; Philips HUE Bridge; OMG; ZigBee;
gropi
Posts: 13
Joined: Thursday 26 April 2018 20:03
Target OS: Linux
Domoticz version: 4.11786
Location: Germany
Contact:

Re: P1 Smart Meter, Return value invalid, overflow error?

Post by gropi »

Domoticz Version: 2023.1
Platform: Openmediavault 6; Docker; HP Microserver Gen8
Plugin/Hardware: MySensors Gateway; Philips HUE Bridge; OMG; ZigBee;
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest