New plugin for reading the gas and electricity usage from a Dutch Smart meter

I just finished a basic plugin for Vera to read electricity and gas usage using the P1 port found on the new Dutch smart meters.

To use the plugin you have to connect the P1 port to your Vera. This can be done with a 5 Volt cable from FTDI (TTL-232R-5V-WE) which can he bought here [url=http://www.antratek.nl/USB-adapter.html]http://www.antratek.nl/USB-adapter.html[/url]

The P1 port uses a reversed serial protocol so your need to reverse the RX pin. This can be done using the FTDI tool known as FT_PROG found here [url=http://www.ftdichip.com/Support/Utilities.htm]http://www.ftdichip.com/Support/Utilities.htm[/url] (thanks to Verkenner on the domoticaforum). Don’t forget to Cycle port after programming.

Connect a RJ11 plug to the FTDI cable using the layout:
pin2=Red(Request=+5Volt)
pin3=black (GND)
pin5=Yellow(Data)

Upload the following files using the UI5 GUI (apps=>develop apps=>Luup files):
- D_dutchSmartMeter.json
- D_dutchSmartMeter.xml
- I_dutchSmartMeter.xml
- S_dutchSmartMeter.xml
Create a new device using apps=>develop apps=>Create device. Use D_dutchSmartMeter.xml as Upnp Device Filename and enter the device name at the field Description (e.g. meterkast). Click create device and wait till the device shows on the dashboard.

After the device is created you have to configure the serial port. First attach the cable. Go to apps=>develop apps=>serial port configuration and select the correct USB device. Set the serial parameters to 9600,even,7bits,1stop bit
In the dropdown box select the name you used creating your device.

After a short while the plugin should show the electricity and gas meter values and actual usage.

For more information see:
[url=http://www.maartendamen.com/2012/04/new-smart-meter-installed-iskra-me382-and-landis-gyr-gasmeter-e06140/]http://www.maartendamen.com/2012/04/new-smart-meter-installed-iskra-me382-and-landis-gyr-gasmeter-e06140/[/url]
[url=http://www.domoticaforum.eu/viewtopic.php?f=71&t=6104&hilit=smart+meter+p1&start=30]Reading the P1 port of a NTA8130 Dutch Smart Meter - Page 3 - Home Automation Domotica Forum Europe, Bwired Forum

Awesome work. (I wish the smart meters here were as easy to interface with!)

This looks like a Linux tool that you might be able to use to configure the Invert RXD bit in the EEPROM of the FTDI chip.

Nice work!

I already read the post on the blog, now all i have to do is wait for a new smartmeter to be installed :wink:

This sounds very promissing. So I can connect the dutch smartmeter to my veralight usb-port?
RJ11 usually has 4 wires. How can I connect it to pins 2,3 and 5?
Is in/reverting the RX pin difficult? Manual looks complicated for a non-electrician…

Thanks for sharing this feature!!!

Two questions that crossed my mind:
How does the plugin handle production of (solar) energy?
How does the plugin handle Dutch double meters?

@cmbeek:
You have to make one-end of the cable yourself, but using the cable mentioned this is an easy job. You only need 3 wires because nothing is done with tx

Besides the gas meter, the plugin actualy reads four different electric meter values. The amount used and the amount delivered back to the net. Both the low-rate values and high-rate values (so four in total). Currently the plugin creates one total and displays/stores this value. In future versions it would be nice to split the four meters. The plugin currently also knows if it is using the low-rate or high-rate, but nothing is done with it. If the plugin would know the kwh price, it could calculate your electricity bill.

Now only have to wait for the new UI5 datamine plugin to make some nice charts!

@bfromdruten: You have convinced me!. I have just ordered the required cable. Hopefully by next week i will be abel to see my electricity and gas meter values on my vera. Can’t wait…

Received cable today…Works Great…

This is a cheaper and more accurate solution than my Envir.

Any chance modifying the plugin to show the 4 individual values instead of 1 total?

Thanks

I received the cable today. Reversing serial protocol was easy. The plugin is now showing watts and kWh’s.
The gas value is still showing zero m3’s.

To be clear: The plugin is showing the sum of to values of electricity intake from the net. It does not subtract(or show) the (solar)electricity delivered to the net.

A plugin showing the 4 seperate values of take-in and production would indeed be a welcome improvement.
I studied the code myself, but I could not make anything of it.

@cmbeek I will try this week to modify the plugin by creating child devices for each value.
Is your gas meter connected to your electrical meter? Can you send me your plugin logging?

@bfromdruten The gas meter is not connected to the electrical meter by wire, but they “communicate” wireless.
As soon as a I figure out how to get tot the logfiles i will send you my plugin logging.

@bfromdruten
Below is the data I finally found in de logfiles. The current plugin displays de sum of the two values in bold.
I would be very pleased if there would be a plugin creating device(s) displaying all available values.

50 " 06/13/12" 8:59:12.07 “3 luup_log:60: MeterType: [XMX5XMXABCE000018061] <0x2e935680>”
50 " 06/13/12" 8:59:12.12 “3 luup_log:60: Meter data: ““0-0:96.1.1(39373936353039382020202020202020)”” <0x2e935680>”
50 " 06/13/12" 8:59:12.16 “4 luup_log:60: Power meter import rate 1: 180.577000 <0x2e935680>”
50 " 06/13/12" 8:59:12.17 “3 luup_log:60: Power meter import rate 2: 122.484000 <0x2e935680>”
50 " 06/13/12" 8:59:12.21 “0 luup_log:60: Power meter export rate 1: 133.324000 <0x2e935680>”
50 " 06/13/12" 8:59:12.23 “3 luup_log:60: Power meter export rate 2: 232.075000 <0x2e935680>”
50 " 06/13/12" 8:59:12.25 “3 luup_log:60: Currently active tariff: [0002] <0x2e935680>”
50 " 06/13/12" 8:59:12.27 “3 luup_log:60: CurrentWatts: [00000.00] <0x2e935680>”
50 " 06/13/12" 8:59:12.32 “2 luup_log:60: Meter data: ““1-0:2.7.0(00000.00kW)“” <0x2e935680>"
50 " 06/13/12" 8:59:12.32 "4 luup_log:60: Meter data: ""0-0:17.0.0(999
A)”” <0x2e935680>”
50 " 06/13/12" 8:59:12.33 “3 luup_log:60: Meter data: ““0-0:96.3.10(1)”” <0x2e935680>”
50 " 06/13/12" 8:59:12.35 “3 luup_log:60: Meter data: ““0-0:96.13.1()”” <0x2e935680>”
50 " 06/13/12" 8:59:12.37 “3 luup_log:60: Meter data: ““0-0:96.13.0()”” <0x2e935680>”
50 " 06/13/12" 8:59:12.37 “3 luup_log:60: Meter data: “”!”" <0x2e935680>"

@cmbeek: looking at your log, it looks like the gas reading is not send to your meter. I will create a new plugin version with more logging.

Hi all,

Attached a new version. With this version separate PowerMeter devices are created for each tariff (import / export). Using the active tariff the current usage is distributed. Gas usage is still registered at the ’ master’ device. Good luck.

@bfromdruten: Thanks a million!! Works the way I want it to work. Excellent job!!
I spend half of yesterday studying the code myself, but it would have taken weeks before I would have gotten as far a you did.

@cmbeek: Thanks, but…does your gas meter work?

@bfromdruten: My gasmeter is still not showing up in vera. I 've searched my logfiles but cannot find any "gas"values.

A bit off topic, but maybe a explanation of the gasmeter not showing:
This is the link to the manual of my smart meter: http://www.stedin.net/SiteCollectionDocuments/Consumenten_en_kleinzakelijk/Slimme%20meter/Handleiding%20slimme%20meter%20ZCF120ABd%20of%20ZMF120ABd.pdf .
I was told that the gasmeter communicates with the smartmeter, whereas the smartmeter communicates with the “netbeheerder”.
The meter has been installed only 7 weeks ago. Maybe installation was not 100% succesfull?
My new provider (Greenchoice) also seems to have problems getting meterreadings from the “netbeheerder”.
I will give it some time…

Attached new version. Reset of usage on plugin after tariff changes.

@bfromdruten : Hi I’m just stepping into Domotica and wants to start measuring my power consumption. I was thinking to go for the NUON E-Manager but after investigating Vera it was clear that this is a better solution. I was convinced to go for vera when reading your post of measuring the dutch smart meter. My question is if the gas value can be read now, not a showbreaker for me, and if charting works on UI5? I want to buy the vera3 but am not sure it can be downgraded to UI4. Thx in advance for your reply.

regards
Hans Schenkelaars

@bfromdruten:

could you be so kind to make a step by step instruction for maken the correct cable and especialy the redirecting / reprogramming of the cable

thanks for your advice