Author Topic: Dutch Smart meter additional plug in  (Read 19814 times)

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Dutch Smart meter additional plug in
« on: November 15, 2012, 03:18:46 pm »
update: new updated files attached (3rd update) after a few hickups

I have made an additional plugin working beside the Dutch Smart Meter as written by bfromdruten.

It will take the data from the plugin, i.e. Low, High and Gas readings.

It takes every minute the values and check's the time;

if the time is: just after midnight or begin of the month at midnight, or 1 jan just after midnight is it will safe the data
for the last 7 days, last 5 month and for the last 3 years the data is shown and the consumption is presented.

the database will be created in time, so the values are not know yet, to put all the data required i made a scene called reset and in the LUUP i have copied the reset luup in to here and run it

the "this device" in resetluup and I_dutchSmartMeterCounter.xml are the new device
the "LowMeter" & "HighMeter" & "GasMeter"in I_duchSmartMeterCounter.xml are the devices created by the DutchSmartMeter by bfromdruten
(ImportRate1 & ImportRate2 & dutchSmartMeter:1)

If somebody can add an grapical page to the D_dutchSmartMeterCounter.json I would appriciated it, cause that is way over my head


I will attach the luup reset next message

Regards
Huib



« Last Edit: February 05, 2013, 05:07:03 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 huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #1 on: November 15, 2012, 03:19:48 pm »
attached the luup reset file: see above

rgds
Huib
« Last Edit: February 05, 2013, 05:07:42 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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #2 on: December 17, 2012, 02:44:46 pm »
Huib, do I need to first deinstall the one from bfromdruten.
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #3 on: December 17, 2012, 03:33:17 pm »
No it is running next to the other
Make sure that you enter the ID of the devices correctly

Tomorow i will update the files for my last version

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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #4 on: December 17, 2012, 04:15:51 pm »
Maybe you can add some screenshots, or for me as newbie a bit more info how to....

Do I need to update the device ID's in the XML?
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #5 on: December 18, 2012, 12:09:14 pm »
@ScreamHouse;
In the I_ file you have to change the device numbers to your numbers;

Look in the ImportRate1 for the devicenummer for the LowMeter
Look in the ImportRate2 for the devicenummer for the HighMeter
Look in the dutchSmartMeter:1 for the devicenummer for the Gasmeter

Instalation of the plugin as indicated in
http://wiki.micasaverde.com/index.php/Install_LUUP_Plugins

Trust it will show it self
- 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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #6 on: December 18, 2012, 02:04:02 pm »
Almost there.......I see a lot of fields in the new device, but when I run a scene with your luupcode it is not filling the values.
In the I.xml i have changed the device ID's as well as the this device ID in the reset luup to my newly created device.
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #7 on: December 18, 2012, 03:50:33 pm »
@Screamhouse;

if you got a table with a lot of "0" and only the text Today and Yesterday than you got it
Time will fill the data
Every day at midnight a new set of data is taken en filled in
The same on the right side, but than monthly

have it running for a night and look tomorrow if the data from midnight is in the list

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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #8 on: December 18, 2012, 03:54:20 pm »
Huib, i was expecting that the tabke would be filled if i manually run the scene.
I did not schedule the scene yet. Rgs screamhouse
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #9 on: December 28, 2012, 03:03:22 pm »
@Screamhouse,

Trust that after running the additional plug for a couple of days the daily consumptions are being collected automatically

if you still want an email at a certain moment in time you can make a scene which runs every ..... and sent you an email with the data as you want

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 huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #10 on: January 19, 2013, 10:15:37 am »
I have updated the files at the beginning.
Now i have changed the timing function to reduce the load to the veralite

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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #11 on: January 19, 2013, 03:48:29 pm »
Huib, it now collects data really nicely,, any suggestion how i can mail the weekly usage to myself?

Rg Koen
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #12 on: January 19, 2013, 04:26:55 pm »
@screamhouse

to send the readings by mail i have done the following;

1 made a  scene and with the time i trigger one a month (or one every monday or so) to trigger a luup

Code: [Select]
local smtp = require("socket.smtp")

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

        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"
            },
            body = "Meterstanden van :\nGas\t\t\t= " .. gas .. "\nLaag\t\t\t= " .. kwh1 .. "\nHoog\t\t\t= " .. 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("Error " ..  e)
        end



the ID are the same as in the addtional plug in
you have to change the xxx@xxx.xx to your adress@whatever.com
the server is your own outgoing server (same as in your email account) mail@xxxx.  or pop@knp or so

Be advise to update the files of the additional plug in, due to a different interval timing protocol ,
the provious was having some hick ups

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 Crismaison

  • Sr. Member
  • ****
  • Posts: 451
  • Karma: +2/-0
Re: Dutch Smart meter additional plug in
« Reply #13 on: January 19, 2013, 04:48:24 pm »
Huib, thx i am using that one already. What i am after without any programming skills is to receive the usage (sunday - last sunday). So if last sunday my gas meter was 150m3 and this sundsy 220m3, i want to receive the value 70m3.

Reg koen
Vera lite - Everspring smoke & flood detectors - Fibaro doorsensors - 2 Foscams - Greenwave 6 node smartplug - Several Switches -Netatmo - PLEG - Twilio - DropBoxuploader - FindmyIphone user

Offline huib

  • Full Member
  • ***
  • Posts: 179
  • Karma: +0/-0
Re: Dutch Smart meter additional plug in
« Reply #14 on: January 19, 2013, 05:10:13 pm »
try the following luup

Code: [Select]
local smtp = require("socket.smtp")

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

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

local ADD_Plugin = 120    -- put the id of the additional plugin

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 last_gas = luup.variable_get("urn:Kuiper-com:serviceId:dutchSmartMeterCounter", "TodayGas_6",  ADD_Plugin ) or "0"
local last_kwh1= luup.variable_get("urn:Kuiper-com:serviceId:dutchSmartMeterCounter", "TodayLow_6",  ADD_Plugin ) or "0"
local last_kwh2= luup.variable_get("urn:Kuiper-com:serviceId:dutchSmartMeterCounter", "TodayHigh_6", Add_Plugin ) or "0"

local gas = gas - last_gas
local kwh1 = kwh1 - last_kwh1
local kwh2 = kwh2 - last_kwh2

        local from = USER_SENDING
        local rcpt = {USER_RECEIVING}

        local mesgt = {
            headers = {
                to = USER_RECEIVING,
                subject = "Meterstanden"
            },
            body = "Verbruik standen van :\nGas\t\t\t= " .. gas .. "\nLaag\t\t\t= " .. kwh1 .. "\nHoog\t\t\t= " .. 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("Error " ..  e)
        end

i did not yet tried it but if you look at the script it must work
do change the ID  of the different plugins

rdgs

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 -