We have moved at community.getvera.com

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

Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
@cmbeek: Thanks, but...does your gas meter work?

Offline cmbeek

  • Sr. Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
@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.....




Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
Attached new version. Reset of usage on plugin after tariff changes.

Offline hschenkelaars

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
@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

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@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
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten:

have installed your plugin and have the following querry;

is is possible to have the readings sent by email to a certail email adress at a certain interval; (ie every monday at 12 hrs or so)

the reason is to monitor the consumption and record it in a seperate program
with out having a second pc running 24/7

your respond is highly appriciated


- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten:

can you how i can find the data for the gas meter and the meter 1 and meter 2

if i read your I_dutchSmartMeter correctly the you save the data in "Gas" and "KWH"


at the moment i have created the scedule to sent once a week at monday at 1200 hrs an email to my self.

my idea is to sent the last taken value of the gas meter, e meter 1 and 2 at that moment

if i repeat the same event the next week i get the readigs from one week later

to get this we need to save the data from Gas en KWH (1&2) every time the data is taken from the serial port and every time overwritten.


can you advise and comment
thanks in advance


- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
@huib: You can use the gas value from the parent device and the kwh values from powermeter1 and powermeter2. You can read the values by using luup code:

local METER_DEV_ID = 139
local METER1_DEV_ID = 140
local METER2_DEV_ID = 141

local gas= luup.variable_get("urn:brutgrink-com:serviceId:dutchSmartMeter", "gas",  METER_DEV_ID )
local kwh1= luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "kwh",  METER1_DEV_ID )
local kwh2= luup.variable_get(" urn:micasaverde-com:serviceId:EnergyMetering1 ", "kwh",  METER2_DEV_ID )

I don't know how to get these values into a e-mail, because e-mail is something I don't use from the Vera.

Why don't you use the excelent dataMine plugin to collect all values? If you don't have storage space you can setup a schedule to ftp the data files to another server.

Thanks,
Bernard

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten:

i do not want to run  a second server, cause i am dutch, and i have the vera already running 24/7

i will try to fit in your comment in the luup for the mail and will post it here

one observation i faced that for the cable from antratek is is required to teke the driver from the supplier and install manually during the installation proces, otherwise it will not work



- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
@huib: you don't need a second server for dataMine. Just a usb memorystick where logging is stored. Works perfect.

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten;


i have on the verelite only one usb which is now used for the meterkast reading
 

at the moment i recieve the following email

== Meterstanden van Tue Jun 26 11:23:10 2012, gas = 0, kwh1 = 0, kwh2 = 0 ==

so i get no data from the meterkast

i took the id device from the powermeter (s) but it does not work
which id i have to take

rgds

== quote ==
local smtp = require("socket.smtp")

        local SMTP_SERVER = "xxx.xxx.xx"
        local SMTP_PORT = "25"
        local USER_SENDING = "<xxxx.xxx@xxxxx.xxx>"
        local USER_RECEIVING = "<xxxxxxxxx@xxxxx.xxl>"

        local METER_DEV_ID = 27
        local METER1_DEV_ID = 34
        local METER2_DEV_ID = 35

local gas= luup.variable_get("urn:brutgrink-com:serviceId:dutchSmartMeter", "gas",  METER_DEV_ID ) or "0"
local kwh1= luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "kwh",  METER1_DEV_ID ) or "0"
local kwh2= luup.variable_get(" urn:micasaverde-com:serviceId:EnergyMetering1 ", "kwh",  METER2_DEV_ID ) or "0"

        local from = USER_SENDING
        local rcpt = {USER_RECEIVING}

        local mesgt = {
            headers = {
                to = USER_RECEIVING,
                subject = "Meterstanden van " .. os.date("%c")
            },
            body = "Meterstanden van "  .. os.date("%c") .. ", gas = " .. gas .. ", kwh1 = " .. kwh1 .. ", kwh2 = " .. kwh2
            }

        local r, e = smtp.send{
            from = from,
            rcpt = rcpt,
            source = smtp.message(mesgt),
            server = SMTP_SERVER,
            port = SMTP_PORT,
          }

        if (e) then
            luup.log("Yikes " ..  e)
        end
« Last Edit: June 27, 2012, 04:43:14 pm by huib »
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
Yes...found the issue. The capitals are not correct. The code should be:

local gas= luup.variable_get("urn:brutgrink-com:serviceId:dutchSmartMeter", "Gas",  METER_DEV_ID ) or "0"
local kwh1= luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH",  METER1_DEV_ID ) or "0"
local kwh2= luup.variable_get(" urn:micasaverde-com:serviceId:EnergyMetering1 ", "KWH",  METER2_DEV_ID ) or "0"

About dataMine...why don't you use a USB hub?

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten;

i got it now working

== result of out punt ==
Meterstanden van Tue Jun 26 13:54:04 2012, gas = 268.509, kwh1 = 416.009, kwh2 = 379.405
on weekly bases i enter the data in to ECOHOME and see the results

thanks for the assistance
about the datamine will be next puzzle

the luup is now as follows;

== quote ==
local smtp = require("socket.smtp")

        local SMTP_SERVER = "xxx.xxx.xxl"    -- < local server
        local SMTP_PORT = "25"
        local USER_SENDING = "<veralite@xxx.xxx>"  --< from
        local USER_RECEIVING = "<xxx@xxxxxxl>"  -- < to

        local METER_DEV_ID = 27
        local METER1_DEV_ID = 34
        local METER2_DEV_ID = 35

local gas= luup.variable_get("urn:brutgrink-com:serviceId:dutchSmartMeter", "Gas",  METER_DEV_ID ) or "0"
local kwh1= luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH",  METER1_DEV_ID ) or "0"
local kwh2= luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH",  METER2_DEV_ID ) or "0"

        local from = USER_SENDING
        local rcpt = {USER_RECEIVING}

        local mesgt = {
            headers = {
                to = USER_RECEIVING,
                subject = "Meterstanden van " .. os.date("%c")
            },
            body = "Meterstanden van "  .. os.date("%c") .. ", gas = " .. gas .. ", kwh1 = " .. kwh1 .. ", kwh2 = " .. kwh2
            }

        local r, e = smtp.send{
            from = from,
            rcpt = rcpt,
            source = smtp.message(mesgt),
            server = SMTP_SERVER,
            port = SMTP_PORT,
          }

        if (e) then
            luup.log("Yikes " ..  e)
        end
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
@bfromdruten;
what i have to do to not show ''Powermeter ExportRate 1 & 2"

is it only modify the I_dutchSmartMeter and put --

            -- Create devices needed if not exist
            addPowerMeterDevice("ImportRate1")
            addPowerMeterDevice("ImportRate2")
         --   addPowerMeterDevice("ExportRate1")
         --   addPowerMeterDevice("ExportRate2")

or do i need todo more?

please advise

rgds
huib
- veralite UI5 - veralite UI7 - 9 fibaro dimmers - 7 fibaro switches - 2 eminent movement sensors - remote control - opentherm gateway - remote powermeter reading - control of whr930 unit - control of washing machine -

Offline bfromdruten

  • Jr. Member
  • **
  • Posts: 64
  • Karma: +0/-0
@huib
Yes..you are correct.

In a few days I will add this functionality as device setting, so you can configure the device to have import and/or export meters. I'm also planning to add an average use to the gas meter value (instead of only the total meter value).