Page 1 of 2

No P1 gas usage read by Domoticz

Posted: Sunday 17 January 2016 12:21
by Sarion
Hi guys,

I hope you can help me get my gas meter readings in Domoticz.
I have a raspberry pi running a fresh install of Domoticz (2.3530), with a P1 converter cable from SmartMeterDashboard. Also using an RFXcom.

The P1 meter is shown under Hardware, and the power and gas meters are shown, and used, in Devices.

The power readings are coming through nicely, but for gas this always shows 0.

If I run "cu -l /dev/ttyUSB1 -s 9600 --parity=none" (thanks to http://gejanssen.com/howto/Slimme-meter-uitlezen/), I get the following output:

/KMP5 ZABF001551772711

0-0:96.1.1(205A4142463030313531373732373131)
1-0:1.8.1(05080.475*kWh)
1-0:1.8.2(05008.385*kWh)
1-0:2.8.1(00000.000*kWh)
1-0:2.8.2(00000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0000.68*kW)
1-0:2.7.0(0000.00*kW)
0-0:96.13.1()
0-0:96.13.0()
0-2:24.1.0(3)
0-2:96.1.0(3238313031353431303037313632343132)
0-2:24.3.0(160117120000)(00)(60)(1)(0-2:24.2.1)(m3)
(02025.003)
!

It seems to me that Domoticz should be showing the gas meter registering 2025 m3 of gas, per the last rule of the output above.

Any ideas on what is going wrong?

Thanks!

Re: No P1 gas usage read by Domoticz

Posted: Sunday 17 January 2016 12:25
by gizmocuz
Could be the software in your smart meter is bad (known problem, also posted here on the forum)
The gas meter is stopped at 1 jan 2016 duo a possible millennium bug
New software started rolling out since Friday evening, already received mine, and working good again
it will take 2 weeks before the meters affected (400.000) are all upgraded

In case you just connected it, then it could also be that you have to wait some hours

Re: No P1 gas usage read by Domoticz

Posted: Sunday 17 January 2016 13:48
by marcelr
It's not the millenium bug. This is a Kamstrup meter, which doesn't have the issue.

grtz,

marcelr

Re: No P1 gas usage read by Domoticz

Posted: Sunday 17 January 2016 14:03
by jovo
I bought the same cable also this week.
Mine is working fine, but I have a Landis+Gyr smartmeter.
I connect it over ser2net to a remote P1 LAN domoticz (ver 3784).

Re: No P1 gas usage read by Domoticz

Posted: Sunday 17 January 2016 18:03
by Sarion
gizmocuz wrote:Could be the software in your smart meter is bad (known problem, also posted here on the forum)
The gas meter is stopped at 1 jan 2016 duo a possible millennium bug
New software started rolling out since Friday evening, already received mine, and working good again
it will take 2 weeks before the meters affected (400.000) are all upgraded

In case you just connected it, then it could also be that you have to wait some hours
It was connected earlier in the week, so that should not be the issue.

The output from the P1 is now giving me in the last line
0-2:24.3.0(160117170000)(00)(60)(1)(0-2:24.2.1)(m3)
(02026.175)

So the P1 seems to be working fine, as it appears to show a higher gas meter reading than earlier in the day. But Domoticz still shows 0.000 for gas. Any ideas?

Re: No P1 gas usage read by Domoticz

Posted: Tuesday 19 January 2016 7:45
by Derik
From 22.00 yesterday.....


My P1 gas is running again... :-)

Re: No P1 gas usage read by Domoticz

Posted: Tuesday 19 January 2016 19:05
by Sarion
Good, Derik!

No such luck here though: 0.000 :-(

Re: No P1 gas usage read by Domoticz

Posted: Tuesday 19 January 2016 19:45
by Sarion
In fact, it has gotten a bit worse. The Power meter says it received the last data at 12:00 hrs today, almost 7 hours ago. But if I run cu as above, I get updates every 12 secs or so.

Does anyone know what could be going wrong here?

Re: No P1 gas usage read by Domoticz

Posted: Tuesday 19 January 2016 19:53
by Derik
The counter is working...
Only give no output:
.
ScreenShot025.jpg
ScreenShot025.jpg (35.27 KiB) Viewed 4600 times
My counter... is give this output after all these days
So do not worry..
You must pay......... :roll: :roll: :roll:

Re: No P1 gas usage read by Domoticz

Posted: Friday 29 January 2016 15:32
by NLRad
I have the same experience as Sarion.
I posted about it in this thread:
viewtopic.php?f=14&t=6511&p=72379#p72161

I did some analysis and proposed a solution, but no reactions yet. The gas meter and cable return correct values, but in the sourcecode is being matched against a different string in the output of the serial port.

Anybody who can help us with this issue?

Re: No P1 gas usage read by Domoticz

Posted: Friday 29 January 2016 17:01
by paulvha
I did a lot work on the smartmeter before looking at Domoticz. I wrote program in Python to read and parse, copy to OneDrive, read in Access and make visible in Excell + developed my own cable to read the P1 meter for a fraction of the cost of the available cables. Domoticz however provides an interesting way to combine different controllers and make the usage easier visible. I have been spending a couple weeks to understand the flow and source code. (Compliments to the creators !) and now working to add Zwave and X10 controller.

The code for parsing the P1 meter ( P1MeterBase.cpp) has its limitations. It assumes a certain amount of output (which varies a lot by smartmeter) and it does not check for the correct checksum that is sent right after the '!' character.

I saw the print-out of your meter. Is it correct that your GAS total is starting on a single line, or should I read that as being appended to the line above?
The OBIS code : 0-2:24.3.0 provides generic information about the Meter (device on MBus)
The OBIS code: (0-2:24.2.1) provide the value /counter of your meter.

if you can provide more clarity, I can see what i can do to help. It might require a recompile but that is easy..

Paul

Re: No P1 gas usage read by Domoticz

Posted: Friday 29 January 2016 23:31
by NLRad
paulvha wrote:I did a lot work on the smartmeter before looking at Domoticz. I wrote program in Python to read and parse, copy to OneDrive, read in Access and make visible in Excell + developed my own cable to read the P1 meter for a fraction of the cost of the available cables. Domoticz however provides an interesting way to combine different controllers and make the usage easier visible. I have been spending a couple weeks to understand the flow and source code. (Compliments to the creators !) and now working to add Zwave and X10 controller.

The code for parsing the P1 meter ( P1MeterBase.cpp) has its limitations. It assumes a certain amount of output (which varies a lot by smartmeter) and it does not check for the correct checksum that is sent right after the '!' character.

I saw the print-out of your meter. Is it correct that your GAS total is starting on a single line, or should I read that as being appended to the line above?
The OBIS code : 0-2:24.3.0 provides generic information about the Meter (device on MBus)
The OBIS code: (0-2:24.2.1) provide the value /counter of your meter.

if you can provide more clarity, I can see what i can do to help. It might require a recompile but that is easy..

Paul
Hi Paul, well executing

Code: Select all

cu -l /dev/ttyUSB1 -s 9600 --parity=none
gives exactly this dump:

Code: Select all

/KMP5 ZABF001521498011

0-0:96.1.1(205A414246303031353231343938303131)
1-0:1.8.1(23373.347*kWh)
1-0:1.8.2(16380.484*kWh)
1-0:2.8.1(00000.000*kWh)
1-0:2.8.2(00000.000*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0001.20*kW)
1-0:2.7.0(0000.00*kW)
0-0:96.13.1()
0-0:96.13.0()
0-2:24.1.0(3)
0-2:96.1.0(3238313031353431303034333539373131)
0-2:24.3.0(160129230000)(00)(60)(1)(0-2:24.2.1)(m3)
(09871.759)
!
So the gas value seems to be on the line below the OBIS code. Somehow strange as all the other OBIS codes start at the beginning of aline. But in other posts I've seen the same thing.

And a recompile would be great. Again, I'm a total newbie on compiling and stuff; I'm happy when I get things working via install-packages.

Re: No P1 gas usage read by Domoticz

Posted: Saturday 30 January 2016 9:14
by paulvha
the real issue is the OBIS code mismatch. In P1MeterBase.cpp the OBIS code expected for the GAS timestamp line is 0-1:24.3.0 and not 0-2:24.3.0 The 3rd character is expected to be a '1' instead of a '2' what your meter is providing. I did a test with your data and changed the line:
#define P1PGTS 0-1:24.3.0 =====> #define P1PGTS 0-2:24.3.0
recompiled Domotticz and then it all worked fine and picked up the gas value

Re: No P1 gas usage read by Domoticz

Posted: Saturday 30 January 2016 9:25
by paulvha
I had to look up the reason for the 2 instead of 1 : if more than one object is instantiated in the same physical device, the value group B shall
number the measurement or communication channels as appropriate, from 1...64. Seems your installation (Gas meter) is having more then one object. BUT it could still be related to the firmware issue that started begin January (as that seems to be applicable to some Landis+GYR as well)

Re: No P1 gas usage read by Domoticz

Posted: Saturday 30 January 2016 10:39
by Sarion
Great work. Is this something that Domoticz is supposed to pick up, but there is something going wrong there? Or is this a new phenomenon since the January bug in the meters?

What direction should we be looking for a solution? I don't know how to recompile, but if you could point me in the right direction, I could try and fix the issue myself.

Or should the developer adjust the code and bring out an update?

Re: No P1 gas usage read by Domoticz

Posted: Saturday 30 January 2016 11:05
by gizmocuz
Please check beta version #4349

Added support for this new timestamp, but as Paulvha said, maybe the class has to be rewritten

Re: No P1 gas usage read by Domoticz

Posted: Saturday 30 January 2016 13:32
by Sarion
It`s working! Thanks very much for all your efforts! :-)

Re: No P1 gas usage read by Domoticz

Posted: Friday 05 February 2016 18:59
by NLRad
Good to hear that is working!

But, I can only find a windows install-package for beta version #4349.
Can anyone help me to get a install-package for my RaspberryPI? Or can I update it from the commandline?
Any help appreciated.

Re: No P1 gas usage read by Domoticz

Posted: Friday 05 February 2016 19:02
by gizmocuz
for the raspberry pi this is on explained on the wiki, but here it goes

In the settings, set the release channel to beta, then from the setup menu issue -> check for update
If that does not work

Login with SSH with the 'pi' user

cd domoticz
./updatebeta

Re: No P1 gas usage read by Domoticz

Posted: Friday 05 February 2016 19:59
by NLRad
Thnx, I will give it a try!