DIY cheap USB-cable to read P1 port of Dutch smart meter

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby ThinkPad » Thursday 29 October 2015 20:40

Good to hear.
Yes it will keep measuring now. When clicking on the 'Log' button at the meter, in the top right corner you have the 'Report' button, there the high and low tariff will come back. And in the graphs ofcourse.
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

User avatar
sincze
Posts: 629
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.6833
Location: Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby sincze » Friday 06 November 2015 19:37

So first my neighbour had a working setup with FTDI -> RJ11 and inverted signals.
After one year his smartmeter died and was replaced by Landis Gyr E350.

So to have domoticz receive the data again we only need to solder a 10k resistor right, between data rx and 5v??
http://www.quassi.nl/2015/01/03/read-data-from-the-landis-gyr-e350-smart-meter/

Earlier posts in this topic say:

"The colored rings of the resistor translate the value: http://www.weerstandcalculator.nl/
brown - black - orange - gold = 10K / 10 kilo Ohm"


Link above shows a 2k resistor, So I'm a bit confused.

As current cable is 9600 maybe modify the settings to:

Code: Select all

The communication should be set-up with the following settings: (115200 8N1)
– Baudrate:  115200
– Data bits: 8
– Parity: none
– Stop bits: 1


And that will ensures all is working again :D ?
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Sensors: You name it I probably got 1.

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby ThinkPad » Friday 06 November 2015 20:36

I don't know, i have a totally different meter.

viewtopic.php?f=14&t=4970#p31345 says 1k.... i don't think it is really critical, just try something between 1k and 10k and you will be fine. The port of the meter is protected against user abuse i thought, so very small chance of wrecking it ;)
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

User avatar
sincze
Posts: 629
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.6833
Location: Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby sincze » Monday 09 November 2015 19:53

A well just followed these exact instructions.
http://www.quassi.nl/2015/01/03/read-data-from-the-landis-gyr-e350-smart-meter/

Just changed to red cable for permanent 5V.

Image

Domoticz is seeing the Smartmeter again.
:D
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Sensors: You name it I probably got 1.

Kohen
Posts: 28
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Kohen » Friday 13 November 2015 23:18

I've bought this chip
http://www.ebay.com/itm/311424300824?_trksid=p2060353.m2749.l2648&ssPageName=STRK%3AMEBIDX%3AIT

connected like the picture above. have a Kamstrup smartmeter and connected the cable to my synology.
When i add the component in Domoticz i see 2 USB ports i guess i need to use /dev/ttyUSB0 because my ZWaveStick is connected to the other port /dev/ttyACM0
I pressed Setup and set it to 115200. But i don't see any modules in Domoticz under Devices. What am i doing wrong?

Image

And I did not add the resistor, is it needed in my case?

I'm still new in the Domoticz scene.
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.

User avatar
bbqkees
Posts: 405
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby bbqkees » Friday 13 November 2015 23:41

Did you do the following:

-Enable hardware for 5 minutes in the Settings?
-Check 'Unused devices'?
-Tested with the the other baud rate?
RPi 2, Philips Hue GU10 / E27 / LivingWhites, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub,
P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / relays / I2C display via Arduino/ESP8266, Xiaomi Flora, BS440.

User avatar
sincze
Posts: 629
Joined: Monday 02 June 2014 22:46
Target OS: Linux
Domoticz version: 3.6833
Location: Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby sincze » Saturday 14 November 2015 11:01

My kamstrup uses 9600.
And indeed allow new hardware is a good tip.

I don't know if invert signals is necessary for your board.
But as long as 5v is send to kamstrup is should send you back data every 10 seconds
Running Domoticz since 2013 with Cubietruck
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave
WIFI: Mi-light Wifi-Bridge, Sonoff, ESP8266
Sensors: You name it I probably got 1.

Kohen
Posts: 28
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Kohen » Sunday 15 November 2015 19:33

bbqkees wrote:Did you do the following:

-Enable hardware for 5 minutes in the Settings?
-Check 'Unused devices'?
-Tested with the the other baud rate?


Yes did all of that, to bad .. no result.

sincze wrote:My kamstrup uses 9600.
And indeed allow new hardware is a good tip.

I don't know if invert signals is necessary for your board.
But as long as 5v is send to kamstrup is should send you back data every 10 seconds


What did you use? And how did you configure it?
Did you use the drivers from domoticz for the synology?
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.

User avatar
bbqkees
Posts: 405
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby bbqkees » Monday 16 November 2015 12:17

Please check the module on a laptop and see (with f.i. Putty) if there is valid data coming out.
If not, the module is not wired correctly, and if you see the datagrams the problem is likely with the Synology drivers.
RPi 2, Philips Hue GU10 / E27 / LivingWhites, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub,
P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / relays / I2C display via Arduino/ESP8266, Xiaomi Flora, BS440.

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby ThinkPad » Monday 16 November 2015 12:21

I would start by connecting it to a PC, opening putty and then perform a so called, 'loopback-test'.
A loopback-test consists of connecting the RX & TX pins together. If you open putty and type a character, it should echo that character like this:
hheelloo

If you get double characters, you know that the module is good.
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

Kohen
Posts: 28
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Kohen » Monday 16 November 2015 22:18

ThinkPad wrote:I would start by connecting it to a PC, opening putty and then perform a so called, 'loopback-test'.
A loopback-test consists of connecting the RX & TX pins together. If you open putty and type a character, it should echo that character like this:
hheelloo

If you get double characters, you know that the module is good.


When i try that i get strange characters ... but can't type anything. Not on 9600 or 115200.
With a laptop there is no data from the kamstrup. But if it won't work i will buy another cable... will make me poor but ok :lol:
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.

Kohen
Posts: 28
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Kohen » Tuesday 08 December 2015 22:09

Now I bought this one and connected a plug like this diagram

Image

What will be next to do? Plug it in and add what to domoticz?
If it works I will make a manual for the wiki.

And I used this settings
Image
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.

User avatar
bbqkees
Posts: 405
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby bbqkees » Wednesday 09 December 2015 10:10

That should be all if you wired the plug correctly and have the right chip.

But first test the cable it with f.i. putty on a laptop. If you see the P1 datagrams in the serial port log then you know it will work in Domoticz.
If you only see gibberish, you might need either a pull up resistor or you need to reprogram the chip to invert the data.
If you do not see anything, the wiring is probably wrong.
RPi 2, Philips Hue GU10 / E27 / LivingWhites, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub,
P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / relays / I2C display via Arduino/ESP8266, Xiaomi Flora, BS440.

User avatar
ThinkPad
Posts: 1754
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby ThinkPad » Wednesday 09 December 2015 10:18

PL2303 can't be reprogrammed like FTDI to invert the data. You will need a transistor (like BS170) and a resistor to do that. Not very difficult if you have handled a soldering iron before :)
See also the first post of this topic.

Testing it with putty first is a good advice. Baudrate is 9600 or 115200 for newer meters.
ThinkTheme - theme for Domoticz
My (Dutch) blog: http://thinkpad.tweakblogs.net - My Domoticz scripts: Bitbucket
I'm not (very) active anymore on this forum as i don't use Domoticz anymore.

Kohen
Posts: 28
Joined: Monday 12 October 2015 12:05
Target OS: NAS (Synology & others)
Domoticz version:
Location: Veldhoven, The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby Kohen » Wednesday 09 December 2015 20:05

But still, when I add it to Domoticz i should get the interface into my devices... right? There are no changes.

I will look at the first post. I have a BS170 so that wouldnt be the problem also have a soldering iron. will try it tonight.
Synology NAS 412+, Aeotec stick V5, Aeotec recessed door sensor, Aeotec micro double smart switch, Fibaro Dimmer, iPad 2 with own 3d printed wall mount.

snadwich
Posts: 1
Joined: Friday 08 January 2016 22:56
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby snadwich » Friday 08 January 2016 23:00

Kohen wrote:But still, when I add it to Domoticz i should get the interface into my devices... right? There are no changes.

I will look at the first post. I have a BS170 so that wouldnt be the problem also have a soldering iron. will try it tonight.


Did it work? I just created a page with info about how to create the PL2303 chip. It's in dutch but i guess that's not a problem for you.

(on the RJ11 side, it's not about colour but about the wire location)
Image
Last edited by snadwich on Friday 22 January 2016 16:02, edited 2 times in total.

gordonb3
Posts: 383
Joined: Friday 22 January 2016 11:15
Target OS: Linux
Domoticz version: custom
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby gordonb3 » Friday 22 January 2016 12:33

Hi,

My first post here. Many thanks for the tip on the HL 340. Bought mine for € 1,73 including shipping. Did have a hard time to get it working though and wanted to share my experience to prevent other people loosing their hair as well.

The post by bbqkees from may 7, 2015 was very informative and I had the cable assembled in no time. It didn't work though. I received no signal whatsoever. Since the resistor shown in the posted images did not match the value in the post and there were other questions about it, I started experimenting with the value in between the range 1k to 10k. With no result. It took me two days to figure out that the colour coding on the telephone cable I cut in half for this project was in fact reversed. So yellow = black, black = yellow, and red = green. Which turns out to be a 50-50 chance on which half of the cable you use.

Regarding the resistor value. The last one I tried was a 5.6k and I left it in there. I don't think the value is really critical and the only issue one may have is the power consumption form the USB port (which I presume to be lower with the higher resistor value).
Excito B3 running Gentoo Linux, P1, Rfxtrx433 to read and control TFA, KaKu, EvoHome RFG100
Custom patched Domoticz v3.7153

User avatar
bbqkees
Posts: 405
Joined: Sunday 17 August 2014 21:01
Target OS: Raspberry Pi
Domoticz version: 3.5x
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby bbqkees » Friday 22 January 2016 14:40

I originally checked the pinout of both a cut off telephone cable and the original D-Sub connector on the PCB and soldered them according the the right pinout.
So indeed the wire colors may differ from cable to cable.

The resistor value is not critical, it is just a pull up resistor.
RPi 2, Philips Hue GU10 / E27 / LivingWhites, Aeon Zwave stick V2, Qubino, Fibaro, Everspring, Philio, RFXCom, X10, Harmony Hub,
P1 / Resol VBus / Nefit EMS bus / DHT21 / DS18B20 / relays / I2C display via Arduino/ESP8266, Xiaomi Flora, BS440.

gordonb3
Posts: 383
Joined: Friday 22 January 2016 11:15
Target OS: Linux
Domoticz version: custom
Location: The Netherlands
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby gordonb3 » Friday 22 January 2016 18:12

Hi Kees,

I should probably have been clearer in my original post. The cable I used does in fact have the same colour coding. The problem however is that it is a straight flat cable and both connectors have the lock pin on the RJ11 connector on the same side of the flattened cable. As a result, one end of the cable matches the colour sequence from your images and the other end does not. Hence the 50-50 chance I mentioned. If I had grabbed the other half it would have worked straight out of the box.

In any case: anyone building that cable should verify the colours by matching them with the schematic from the gejanssen.com link in the first post. You'll get a good idea from identifying the colour of the unused (N/C) wire. If it's red, you got the wrong end.
Excito B3 running Gentoo Linux, P1, Rfxtrx433 to read and control TFA, KaKu, EvoHome RFG100
Custom patched Domoticz v3.7153

mdewit
Posts: 1
Joined: Sunday 31 January 2016 16:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: DIY cheap USB-cable to read P1 port of Dutch smart meter

Postby mdewit » Sunday 31 January 2016 17:22

I wrote a unix daemon to read out slimme meters that support the DSMR standard via the P1 port.
It should support Linux, Ubuntu as well as Raspberry Pi, and FreeBSD.

I posted the source on Github, you can find the latest release here:
https://github.com/dsmrd/dsmrd/releases/latest

Let me know if it works for you!

Groetjes,

Maarten


Return to “Meters”

Who is online

Users browsing this forum: No registered users and 2 guests