P1 meter results are not showing

Moderator: leecollings

Post Reply
geoffrey
Posts: 6
Joined: Tuesday 10 February 2015 0:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

P1 meter results are not showing

Post by geoffrey »

Hi,

I have a P1 DIY cable... which after some tweaking in python I got working to read out..
also the commandline nicely shows my output...

cu -l /dev/ttyUSB0 -s 9600 --parity=none
Connected.
<COMMENTED OUT>

0-0:96.1.1(39373936353532302020202020202020)
1-0:1.8.1(06389.574*kWh)
1-0:1.8.2(08383.062*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.53*kW)
1-0:2.7.0(0000.00*kW)
0-0:17.0.0(999*A)
0-0:96.3.10(1)
0-0:96.13.1()
0-0:96.13.0()
0-1:96.1.0(3238303131303038323033333632313132)
0-1:24.1.0(03)
0-1:24.3.0(150210000000)(00)(60)(1)(0-1:24.2.0)(m3)
(04293.080)
0-1:24.4.0(1)
!

so I know the cable is working... however in domoticz I only get 0 values for both my gas and electricity.

I added hardware
P1 Smart Meter USB Setup
(on the right USB port)

and activated the devices...

however all the returned values are 0.

I checked the json interface:

Code: Select all

{
5MinuteHistoryDays: 1,
ActTime: 1423523747,
AllowWidgetOrdering: true,
DashboardType: 0,
Latitude: <COMMEnteD OUt>,
Longitude: <COMMEnteD OUt>,
MobileType: 0,
TempScale: 1,
TempSign: "C",
WindScale: 1,
WindSign: "m/s",
dontcachehtml: true,
result: [
{
BatteryLevel: 255,
Counter: "0.000",
CounterDeliv: "0.000",
CounterDelivToday: "0.000 kWh",
CounterToday: "0.000 kWh",
CustomImage: 0,
Data: "0;0;0;0;0;0",
Favorite: 0,
HardwareID: 5,
HardwareName: "Smartmeter",
HaveTimeout: false,
ID: "1",
LastUpdate: "2015-02-10 00:15:45",
Name: "Smartmeter - Electro",
Notifications: "false",
PlanID: "0",
Protected: false,
SignalLevel: 12,
SubType: "Energy",
SwitchTypeVal: 0,
Timers: "false",
Type: "P1 Smart Meter",
TypeImg: "counter",
Unit: 1,
Usage: "0 Watt",
UsageDeliv: "0 Watt",
Used: 1,
XOffset: "0",
YOffset: "0",
idx: "17"
}
],
status: "OK",
title: "Devices"
}
and

Code: Select all

{
5MinuteHistoryDays: 1,
ActTime: 1423523841,
AllowWidgetOrdering: true,
DashboardType: 0,
Latitude: "51.994260",
Longitude: "4.469550",
MobileType: 0,
TempScale: 1,
TempSign: "C",
WindScale: 1,
WindSign: "m/s",
dontcachehtml: true,
result: [
{
BatteryLevel: 255,
Counter: "0.000",
CounterToday: "0.000 m3",
CustomImage: 0,
Data: "0",
Favorite: 0,
HardwareID: 5,
HardwareName: "Smartmeter",
HaveTimeout: false,
ID: "1",
LastUpdate: "2015-02-10 00:14:15",
Name: "Smartmeter - Gas",
Notifications: "false",
PlanID: "0",
Protected: false,
SignalLevel: 12,
SubType: "Gas",
SwitchTypeVal: 1,
Timers: "false",
Type: "P1 Smart Meter",
TypeImg: "counter",
Unit: 2,
Used: 1,
XOffset: "0",
YOffset: "0",
idx: "18"
}
],
status: "OK",
title: "Devices"
}
Any help on how to troubleshoot this?
I could create my python script to call the json and create virtual devices.... but would be great if it worked out of the box :)
antwan
Posts: 116
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: P1 meter results are not showing

Post by antwan »

Did you try to change the baudrate in hardware setup?
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
geoffrey
Posts: 6
Joined: Tuesday 10 February 2015 0:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter results are not showing

Post by geoffrey »

Yes I did... It should be the default 9600 but I also tried the larger value.
pwhooftman
Posts: 75
Joined: Monday 11 November 2013 18:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter results are not showing

Post by pwhooftman »

geoffrey wrote:Yes I did... It should be the default 9600 but I also tried the larger value.
Are you sure? Mine only works when i set baudrate 115200 in Dmomoticz
Domoticz v 1.16xx
1X RFXtrx433 USB 433.92MHz Transceiver Firmware version: 71
1X Synology Nas DS918+ DSM 7 (12Gb RAM mod)
geoffrey
Posts: 6
Joined: Tuesday 10 February 2015 0:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter results are not showing

Post by geoffrey »

unfortunately yes...

switching to 15200 gives me:
Tue Feb 10 23:10:30 2015 Error: Smartmeter hardware (5) nothing received for more then 1 Minute!....
Tue Feb 10 23:10:31 2015 Error: Restarting: Smartmeter

while switching to 9600 gives:
Tue Feb 10 23:12:09 2015 (Smartmeter) P1 Smart Meter (Electra)
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: P1 meter results are not showing

Post by bbqkees »

Can you try to connect to the serial port with PuTTY?

It will show you the raw data of the P1 port. You should see the complete datagrams. If it is OK there, your hardware is fine.
If it shows gibberish or nothing than the problem is in your hardware setup.

You maybe have not correctly connected the RTS line to 5V.
I assume you followed click
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
geoffrey
Posts: 6
Joined: Tuesday 10 February 2015 0:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter results are not showing

Post by geoffrey »

Yeah the terminal shows the right results... As does the python script....
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: P1 meter results are not showing

Post by bbqkees »

What system are you using it on? A Pi with the latest stable?
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
geoffrey
Posts: 6
Joined: Tuesday 10 February 2015 0:06
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: P1 meter results are not showing

Post by geoffrey »

Yeah correct.... RPi with DomoticzV2.2025
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: P1 meter results are not showing

Post by bbqkees »

And how did you make the cable?

If you use the correct hardware it should work out of the box in domoticz.
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
User avatar
bbqkees
Posts: 407
Joined: Sunday 17 August 2014 21:01
Target OS: Linux
Domoticz version: 4.1x
Location: The Netherlands
Contact:

Re: P1 meter results are not showing

Post by bbqkees »

Maybe a stupid question: did you click on 'Allow hardware for 5 minutes" before adding the hardware?
Bosch / Nefit / Buderus / Junkers / Worcester / Sieger EMS bus Wi-Fi MQTT Gateway and interface boards: https://bbqkees-electronics.nl/
CrashHouse
Posts: 3
Joined: Sunday 03 July 2016 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Contact:

Re: P1 meter results are not showing

Post by CrashHouse »

Found the solution? I'm experiencing exactly the same.

Although I had to set te permissions for ttyUSB0 first, but now 'sudo cu -l /dev/ttyUSB0 -s 9600 --parity=none' gives me the right information, just does't show in Domoticz.

Output:

Code: Select all

Connected.
/XMX5XMXABCD100003654

0-0:96.1.1(4B383257303039373435393037343131)
1-0:1.8.1(08871.778*kWh)
1-0:1.8.2(07177.896*kWh)
1-0:2.8.1(02150.857*kWh)
1-0:2.8.2(05204.918*kWh)
0-0:96.14.0(0001)
1-0:1.7.0(0002.75*kW)
1-0:2.7.0(0000.00*kW)
0-0:96.13.1()
0-0:96.13.0()
0-1:96.1.0(3238303131303038323333313532373132)
0-1:24.1.0(03)
0-1:24.3.0(160703100000)(08)(60)(1)(0-1:24.2.0)(m3)
(07056.183)
!
CrashHouse
Posts: 3
Joined: Sunday 03 July 2016 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Contact:

Start at the beginning...

Post by CrashHouse »

Well I made a cable as described at viewtopic.php?f=14&t=4970&hilit=p1+cable. After some fiddling I got the cable working in puTTY. After that I tried to install the cable on my Pi3. But after:

Code: Select all

sudo cu -l /dev/ttyUSB0 -s 9600 --parity=none


I got this message:

Code: Select all

Line in use
Only after I changed permissions

Code: Select all

sudo chmod 666 /dev/ttyUSB0
I got the output as mentioned earlier.

But after a reboot all is adjusted to the prior settings.

So I thought I would set the permissions persistent as described in http://ask.xmodulo.com/change-usb-devic ... linux.html so after a reboot Domoticz could see and connect the USB0 serial adapter.

Domoticz does see my P1 as hardware and I can add devices (Gas and Power) but values are stuck at 0.
If I run

Code: Select all

sudo cu -l /dev/ttyUSB0 -s 9600 --parity=none
on my Pi3 I get reading which is adjusting constantly.

So what am I doing wrong?
CrashHouse
Posts: 3
Joined: Sunday 03 July 2016 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.4834
Contact:

Little update...

Post by CrashHouse »

Just installed Domoticz on my spare Windows laptop and...

Cable works just fine in Domoticz. Perfect readings...

So why not on the Pi3?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest