We have moved at community.getvera.com

Author Topic: New plugin for reading the gas and electricity usage from a Dutch Smart meter  (Read 103817 times)

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
You can see if the gas is linked by cycling through the electricity meter (via button on meter).

I Also still don't have gas reading. It worked for some time (see also other post in this thread)

Verstuurd vanaf mijn Nexus 5 met Tapatalk


Offline informatie

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
Dutch Smart meter download
« Reply #166 on: July 20, 2014, 12:58:38 pm »
Waar ik nu een complete set van software voor mijn vera3 downloaden.

Offline Sender

  • Hero Member
  • *****
  • Posts: 973
  • Karma: +552/-467
  • Sr. manager of my Vera
Good firmware is more important than good karma. (and this costed me lots of Karma)

Offline informatie

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
dank je voor de tip.
De bestanden in de ZIP-file zijn van 12 mei.
Ik ben gewoon op zoek naar de laatste juiste, want er zijn wat aanpassingen geweest.
Dat vind ik terug op het forum.
 
Oke I read in english. It's a pitty but I go for it thx.
« Last Edit: July 20, 2014, 03:37:03 pm by informatie »

Offline Sender

  • Hero Member
  • *****
  • Posts: 973
  • Karma: +552/-467
  • Sr. manager of my Vera
The forum is English... Vera as well... everyone running this plugin managed to get this working via this forum. Just start at post 1 and read till the last one. Then decide what to use.
Good firmware is more important than good karma. (and this costed me lots of Karma)

Offline wimlem

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
installed the P1 cable today on my vera lite. Had it already working with domoticz, but now with vera! :)

have DSMR4.0 and used serial port 115200 8N1.

Many thanx guys for the app.

Offline edraket

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
@tyfoon -used the attached I_DutchSmartmeter.xml of your recent post. After uploading to the vera lite en reload, it could actually read a gas value. But it directly stopped reading the electra values .. and messed up the Datamine logging. I was comparing this version with the orgininal version of the file -which showed electra but no gas- and noticed there are some difference.

What to do to get the code working?  And any ideas why a change of code could mess up Datamine? (BTW - only reason why I still using Datamine is because of the nice integration of its graphical support in ImperiHome, an Android app).

-edraket-

Offline edraket

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
I solved the problem in the code, I couldn't get the string.match code to work, so I decided to use the string.sub function, since the offset of the gasstring is always the same. And because the data is a string, you have to convert the string to an number.
The code "0-1:24.2.1" is actually the line containing the gasvalue: if you get that, you know that your smartmeter works: I have a L+G wireless connected to the Kaifa and the Kiafa is connected to my Vera Lite. You can use the luup.log function to check what your data content actually is.

        function dutchSmartMeterIncoming(data)
            if (string.len(data) > 0) then
                 if (string.sub(data, 1, 10) == "0-1:24.2.1") then
                    luup.log("Gas meter reading in next line")
      -- formaat 0-1:24.2.1(140828150000S)(00048.320*m3)
        -- luup.log(data)
      gasstring = string.sub(data,27, -6)
      gasvalue = tonumber(gasstring)
      -- luup.log(string.match(string.match(data, "(%d+.%d+*m3)"), "%d+.%d+"))


                    indGasComming = 1
                else
                    ---------------------------------------------------------------------------------------------
                    -- Check if we have to process gas meter
                    ---------------------------------------------------------------------------------------------
                    if (indGasComming == 1) then
         
         luup.log("Gas meter: [" .. gasstring .. "]")
                        luup.variable_set("urn:brutgrink-com:serviceId:dutchSmartMeter", "Gas", gasvalue, THIS_DEVICE)

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Hi Edraket, cool; Do I understand correctly that this both is working fine now for you both gas and electra? If yes, can you post the total file so I'm sure nothing is going wrong with copy-paste.

Offline edraket

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
Right! Works with both gas and electricity. Attached the whole set of the plugin, since I've noticed that they all seem to belong together. That's why you have to do some prep's before using them:

First, check that you have the same D_dutchSmartMeter (xml and json), I_dutchSmartMeter.xml and S_dutchSmartMeter.xml as in the attachment. E.g by comparing date stamps, filesizes and do some code verifications. In the attachment there's a 5th file, that's the original ("old") I_dutchSmartMeter.xml which I took to change into the new I_dutchSmartMeter.xml.

If your plugin is the same as I have in the attachement, you can simply replace your I_dutchSmartMeter.xml  with the code in my one. Big advantage of this approach is that you don't have to delete the device and you don't loose your Datamine data. But be absolutely sure: the first time I did it this way, I had a plugin that wouldn't work anymore and I lost all of my Datamine data!

If your plugin is not the same, than you have to save your Datamine data first (if using that plugin). Then, remove the device of the plugin, restart your vera (take the powerplug off and on) and reload all the four files of the plugin from the attachment. I've noticed that a simple reload doesn't work all the time...

Create the new device. Since the device will probably get a new device ID, you have to reassign the variables in Datamine (and other Luup code if you have). And of course, make sure that you've set the serial port configuration settings to match : 115200b-nonep-8db-1sb.

Note that I haven't found a way to reload the saved Datamine data. Maybe there are ways, I just haven't tried them. Bollocks!

Offline tyfoon

  • Full Member
  • ***
  • Posts: 167
  • Karma: +0/-0
Super! All is working  now!! p.s. I had the same version so only had to update one file

Offline hinod

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Being a newby I experienced that Vera has a steep learning curve.
In general I have my Vera working.

I want to connect my P1 ( I do have it and have used it already with BeNext en HomeWizzard)
Could one of you give me a hint regarding the upload of the plugin and the programming adjustments to make.

1. Downloaded the zip-file from the message by EdRaket of September 4th; is that the plugin?
2. What do I then
2a have looked at apps --> develop apps --> create design (have just installed Ui7)
2b but there is so much to fill in ....

3. have started looking at http://gathering.tweakers.net/forum/list_messages/1533251

Offline C4Vette

  • Full Member
  • ***
  • Posts: 157
  • Karma: +3/-8
Thanks for the plugin.
Since two days I have a KFM5 KAIFA DSM4 and connected it with a PL2303 via an usb-hub to my VeraLite. To get this working as a second ttyusb it took some time, to say the least  ;D. But I now have an Arduino on ttyusb0 and the smartmeter on ttyusb1.
No gas readings yet but I know this can take a few days. Already 'connected' the readings to DataYours for the graphs.

@hinod, sorry have never seen UI7 and not many others did yet I think.
« Last Edit: February 28, 2015, 03:51:32 pm by C4Vette »
VeraLite UI7 1.7.649
Fan of: PLEG, DataYours, dutchSmartMeter, MySensors

Offline wimlem

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Being a newby I experienced that Vera has a steep learning curve.
In general I have my Vera working.

I want to connect my P1 ( I do have it and have used it already with BeNext en HomeWizzard)
Could one of you give me a hint regarding the upload of the plugin and the programming adjustments to make.

1. Downloaded the zip-file from the message by EdRaket of September 4th; is that the plugin?
2. What do I then
2a have looked at apps --> develop apps --> create design (have just installed Ui7)
2b but there is so much to fill in ....

3. have started looking at http://gathering.tweakers.net/forum/list_messages/1533251

1. Yes it is.
2. Check robbshop (http://www.robbshop.nl/over-z-wave/z-wave-projecten/slimme-meterkabel-installeren). Create the device with "D_dutchSmartMeter.xml".

After that, you need to open the "serial port configuration" and i don't think that page works with UI7, it stays empty. I contacted support and the fixed this for me.

That is all and after that there will be 5 new instances on the dashboard.

Offline C4Vette

  • Full Member
  • ***
  • Posts: 157
  • Karma: +3/-8
Does everyone have both counters running for high/low-tariff (dag en nacht)?
I noticed that I have just one of the devices counting and yesterday-evening thought that would be the night-tariff, but today there is still only one device updating. Will check the meter itself tonight after work but in luup.log I see a lot of messages with "not processed":

Code: [Select]
50      09/18/14 10:39:54.663   luup_log:130: Meter data (not processed): "0-0:96.13.1()" <0x2f315680>
50      09/18/14 10:39:54.723   luup_log:130: Meter data (not processed): "0-0:96.13.0()" <0x2f315680>
50      09/18/14 10:39:54.783   luup_log:130: Meter data (not processed): "1-0:31.7.0(000*A)" <0x2f315680>
50      09/18/14 10:39:54.843   luup_log:130: Meter data (not processed): "1-0:51.7.0(000*A)" <0x2f315680>
50      09/18/14 10:39:54.904   luup_log:130: Meter data (not processed): "1-0:71.7.0(000*A)" <0x2f315680>
50      09/18/14 10:39:54.935   luup_log:130: Meter data (not processed): "1-0:21.7.0(00.043*kW)" <0x2f315680>
50      09/18/14 10:39:54.965   luup_log:130: Meter data (not processed): "1-0:22.7.0(00.000*kW)" <0x2f315680>
50      09/18/14 10:39:55.013   luup_log:130: Meter data (not processed): "1-0:41.7.0(00.080*kW)" <0x2f315680>
50      09/18/14 10:39:55.023   luup_log:130: Meter data (not processed): "1-0:42.7.0(00.000*kW)" <0x2f315680>
50      09/18/14 10:39:55.053   luup_log:130: Meter data (not processed): "1-0:61.7.0(00.077*kW)" <0x2f315680>
50      09/18/14 10:39:55.083   luup_log:130: Meter data (not processed): "1-0:62.7.0(00.000*kW)" <0x2f315680>
50      09/18/14 10:39:55.084   luup_log:130: Meter data (not processed): "!4D20"

Is that normal?
« Last Edit: September 18, 2014, 05:40:02 am by C4Vette »
VeraLite UI7 1.7.649
Fan of: PLEG, DataYours, dutchSmartMeter, MySensors