Page 1 of 1

Issue with reading smart meter P1 in Home assistant

Posted: Thursday 14 November 2019 17:28
by Richo999
Hello Everyone! hopefully anyone is able to help me with a issue I am having with reading out my smart meter.
I own a Landis E350 with a smart meter cable from https://www.sossolutions.nl/slimme-meter-kabell its a verified cable for my smart meter. It is connected to my ESXI server in the basement (I extended the RJ-11). on the ESXI I have a Ubuntu64 with Home assistant for logging the data. I had some issues setting up home assistant, because of a known bug with Nginx in the configurator which I resolved by editing the config.yaml through SSH.
I used the following code:

sensor:
- platform: dsmr
port: /dev/ttyUSB0
dsmr_version: 4

group:
meter_readings:
name: Meter readings
entities:
- sensor.power_consumption_low
- sensor.power_consumption_normal
- sensor.power_production_low
- sensor.power_production_normal
- sensor.gas_consumption

As far as I can tell there is a connection, I verified this in SSH with the following command line:
cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q

At first I got a Permission denied but with this following code I resolved the issue.

chmod 666 /dev/ttyUSB0

At this point I am able to establish a connection however not much more beside the following:

cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q
Connected.

it should output data but it times out after some time. Anyone got a idea how to resolve this issue?

Re: Issue with reading smart meter P1 in Home assistant

Posted: Thursday 14 November 2019 18:39
by FireWizard
Hi,

It is good to know that this forum supports Domoticz and so it might be, that active users here, have less knowledge about Hass then active users in the Hass forum. However this topic is not only a Hass issue.

First.
Since, at least, 2017, the Landis & Gyr E350 supports DSMR 5. So maybe you have to change your config file to dsmr_version: 5.

Second.

You said
(I extended the RJ-11)
This is a serial cable and you cannot extend this cable unlimited.
The RS-232 standard has been specified in 1960.The RS-232C dates from 1969. The maximum length has been specified as 15 meters (50 feet) for transmission speeds of up to 19.200 Bd. The standard has been developed for speeds up to 20kbps.
However it is often used for higher speeds, but this has effect on the maximum length.
In this case you should use the following maximum cable length:

Bit Rate Bus Length
115200 bit/s 2.5 m
57600 bit/s 5.0 m
38400 bit/s 7.5 m
19200 bit/s 15 m
9600 bit/s 30 m

So check the connection first, with a laptop and a terminal program, within 2.5m from your smart meter. If this works you can continue.
The serial connection might work on longer distances, but there is no guarantee.
Please post your results,

Regards

Re: Issue with reading smart meter P1 in Home assistant

Posted: Thursday 14 November 2019 20:19
by Richo999
FireWizard wrote: Thursday 14 November 2019 18:39First.
Since, at least, 2017, the Landis & Gyr E350 supports DSMR 5. So maybe you have to change your config file to dsmr_version: 5.

Second.

You said
(I extended the RJ-11)
This is a serial cable and you cannot extend this cable unlimited.
The RS-232 standard has been specified in 1960.The RS-232C dates from 1969. The maximum length has been specified as 15 meters (50 feet) for transmission speeds of up to 19.200 Bd. The standard has been developed for speeds up to 20kbps.
However it is often used for higher speeds, but this has effect on the maximum length.
In this case you should use the following maximum cable length:

Bit Rate Bus Length
115200 bit/s 2.5 m
57600 bit/s 5.0 m
38400 bit/s 7.5 m
19200 bit/s 15 m
9600 bit/s 30 m

The cable itself is 1.8m and the extension RJ-11 is 2,5m
So check the connection first, with a laptop and a terminal program, within 2.5m from your smart meter. If this works you can continue.
The serial connection might work on longer distances, but there is no guarantee.
Please post your results,

Regards
connected directly to a laptop with the smart meter cable (without the extension), I get proper read out. can I presume the cable just doesn't like to get extended? It borrowed this laptop from a friend some time ago to do some other stuff. the only thing I changed to was plug in the smart meter cable and used:
chmod 666 /dev/ttyUSB0
cu -l /dev/ttyUSB0 -s 115200 --parity=none -E q

Re: Issue with reading smart meter P1 in Home assistant

Posted: Thursday 14 November 2019 22:29
by FireWizard
Hi,

I understand that without the extension cable, you see the P1 smart meter protocol.
So let' s focus on the extension cable.

You cannot assume that the smart meter cable cannot be extended.

Check your extension cable, regarding the following:
1. Is the RJ-11/12 extension cable a straight cable and are all 6 wires connected?
2. The Landys & Gyr E350 requires a 1 kohm pull-up resistor, between Vcc and RxD.
Your P1 cable will have that, but if your extension cable is incomplete, you have a problem.

Measure the RJ-11/12 cable with a multimeter.
See: https://www.google.com/search?q=P1+smar ... Kj2uUrM%3A

Regards

Re: Issue with reading smart meter P1 in Home assistant

Posted: Friday 15 November 2019 18:55
by Richo999
FireWizard wrote: Thursday 14 November 2019 22:29 Hi,

I understand that without the extension cable, you see the P1 smart meter protocol.
So let' s focus on the extension cable.

You cannot assume that the smart meter cable cannot be extended.

Check your extension cable, regarding the following:
1. Is the RJ-11/12 extension cable a straight cable and are all 6 wires connected?
2. The Landyd & Gyr E350 requires a 1 kohm pull-up resistor, between Vcc and RxD.
Your P1 cable will have that, but if your extension cable is incomplete, you have a problem.

Measure the RJ-11/12 cable with a multimeter.
See: https://www.google.com/search?q=P1+smar ... Kj2uUrM%3A

Regards
after reading this I figured that the 1kohm resistor might be a possible culprit so I went through my old cable "storage" (garbage) pile and discovered a 2m usb 2.0 extender, this solved my whole issue. thanks for the help!

Re: Issue with reading smart meter P1 in Home assistant

Posted: Tuesday 26 January 2021 11:39
by PA5UL
Hi, similar challenge here. My E350 has an 8-pin P1 port. I need to connect it (either via USB or via the home network) to the NUC PC running Home Assistant, which is situated at a distance of some 5m in a straight line or about 10m if I run a cable in a way my wife will accept. What options do I have?
2021-01-26 11.29.36.jpg
2021-01-26 11.29.36.jpg (84.1 KiB) Viewed 1574 times

Re: Issue with reading smart meter P1 in Home assistant

Posted: Tuesday 26 January 2021 13:05
by erem
@PA5UL

one option is using a Wemos D1 in combination with ESPEasy to move the data to domoticz via wifi/ethernet

https://www.pe1rqm.nl/slimme-meter-uitl ... a-systeem/

it's dutch, but google translate is your friend if you do not speak dutch