The Vera Community forums have moved!

General => Power Management => Topic started by: huib on November 15, 2012, 03:18:46 pm

Title: Dutch Smart meter additional plug in
Post by: huib 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



Title: Re: Dutch Smart meter additional plug in
Post by: huib on November 15, 2012, 03:19:48 pm
attached the luup reset file: see above

rgds
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on December 17, 2012, 02:44:46 pm
Huib, do I need to first deinstall the one from bfromdruten.
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison 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?
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison 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.
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison 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
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison 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
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison 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
Title: Re: Dutch Smart meter additional plug in
Post by: huib 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
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 19, 2013, 06:16:36 pm
Great!!!!

One small thing: it works for Gas and Low Electricity. For High Electricity I only get the total usage.

(If you could add Year to date as well, it would be great, I did try myself, but messed it up)
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 22, 2013, 01:02:28 pm
@screamhouse

i do not see any error in the script
the only thing i can think of is that in the line
local last_kwh2= luup.variable_get("urn:Kuiper-com:serviceId:dutchSmartMeterCounter", "TodayHigh_6", Add_Plugin ) or "0"
some thing is not correct and the value of "0" is taken

further the value _6 has to be _7 to take the reading from one week a go

what do you mean of (If you could add Year to date as well, it would be great, I did try myself, but messed it up)

pls advise

rgds
huib

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 22, 2013, 01:13:28 pm
Huib,

I think because I run it in a weekend the High tarif is 0 is the reason. Let me run it during the week.

What I would like to have send as well is the year consumption in a same mail. This way I know when I get the mail how much my total consumption was up till now. Just a nice to have, really happy with the plugin as is
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 28, 2013, 01:41:38 am
Huib, after installing the new files, the data does not get updated, since last week no data was written to the database anymore at 0:00
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 29, 2013, 10:51:01 am
@screamhouse,

please find attached a print screen of today
i still get the data in place

be advised that the trigger is 00:00:00 every day, so at the first line only the date seems to change

please advise

regards
huib
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 29, 2013, 02:30:56 pm
Huib, see screenshot, nothing happened after the 19th of Jan.

I will load all files once more, see if at 0:00 something is triggered
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 30, 2013, 11:49:38 am
@screamhouse
i think i have found the reason why it has been stopped working cause one viable is not set correctly, so the inside the luup log it will give an error, so the plug in stops
i will have to see which one it is and put it by a (temp) scene to "0"


make a scene with the attached file as luup
check the id numer of the plug in
with this you set all vaule to "0"
rgds
huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on January 31, 2013, 09:57:25 am
@huib
I have downloaded the files. I changed the id's of:
LowMeter = 41  -- ImportRate1
HighMeter = 40 -- ImportRate2
GasMeter = 33   -- dutchSmartMeter1

I then uploaded the four Luup files, restarted luup, but nothing happens? No new device is created.
What am i doing wrong?

Thank You!
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 31, 2013, 10:21:47 am
@screamhouse
i think i have found the reason why it has been stopped working cause one viable is not set correctly, so the inside the luup log it will give an error, so the plug in stops
i will have to see which one it is and put it by a (temp) scene to "0"


make a scene with the attached file as luup
check the id numer of the plug in
with this you set all vaule to "0"
rgds
huib

Huib, but then I loose all my history right?
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 31, 2013, 02:11:51 pm
@screamhouse
If you put all value to "0" you will loose the data

If you enter the data instead of the zero you will safe old data
Option is to use only timelog and leave the low, high, gas value for day, month, year, cons out

If you upload the files you do not create a new device, but only update the program

I do not know if you have acces to the log file to  see which variable it is blocking

Rgds
Huib

Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on January 31, 2013, 02:45:18 pm
I can see the logfiles. I do not however see any of the luup code (such as "urn:Kuiper-com:serviceId:dutchSmartMeterCounter") in the logfiles.

The I_dutchSmartMeterCounter file states:       

-- id numner this device
this_device = 94

To which device is this code reffering??

Am I right when I expect a new device with the energy statistics when this code is running as it should?
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 31, 2013, 03:00:07 pm
@cmbeek
The device is running parallel to the dutch smart meter
You have to upload the filesand create a device
The number of the new device is this_device
If you are starting from zero you need to put all the vafiable to 0

Advise if working, or not working
Rgds
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 01, 2013, 04:20:31 am
@Huib
I found where i can create a new device.

Have I filled the fields correctly?

Device type= [empty]
Internal ID = [empty]
Description = [whatever name you want the device te have]
Upnp Device Filename [D_dutchSmartMeterCounter.xml]
Upnp Implementation Filename [I_dutchSmartMeterCounter.xml]
Ip Address [empty]
MAC [ empty]
Room [whatever]
Parent device [leave empty]

What do you mean by "If you are starting from zero you need to put all the vafiable to 0". Which variables should be put to 0?
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 01, 2013, 08:29:10 am
@cmbeek

to create the new device is correct

if you run it just like this you get an error message in the luup.log file and the plugin stops working.

To have all variable set to "0" to allow the plug in to work i have created a scene what i run once.

In the luup of the scene i put the data as mentioned in message a fw back in  this post (luup.reset 2) and all data is put to zero and the plug in runs


goog luck
rgds
huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 03, 2013, 01:34:28 am
@Huib
I keep getting a table full of zero's.
I checked the logging and found this error:

50   02/03/13 7:14:06.834   luup_log:33: CurrentActiveTariffExport: [1] <0x2dc73680>
06   02/03/13 7:14:06.835   Device_Variable::m_szValue_set device: 42 service: urn:micasaverde-com:serviceId:EnergyMetering1 variable: Watts was: -0 now: -0 #hooks: 0 upnp: 0 v:0xa892b8/NONE duplicate:1 <0x2dc73680>
01   02/03/13 7:14:06.835   GetLuaInterface can't find device type: 3/0xa6abd8 str: -43 <0x2dc73680>
01   02/03/13 7:14:06.835   luup_variable_set interface 0xa6dd68 args 4 <0x2dc73680>
50   02/03/13 7:14:06.853   luup_log:33: Meter data (not processed): "0-0:17.0.0(999*A)" <0x2dc73680>
50   02/03/13 7:14:06.873   luup_log:33: Meter data (not processed): "0-0:96.3.10(1)" <0x2dc73680>

But I do not know if this has anything to do with your devicecode....

Another thing is that I could only find "luup.reset 2", I used "luup reset 1.xml" instead. Might this be the problem?

Thanks (again)!!
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 04, 2013, 01:43:54 pm
@cmbeek

do you see at the dashboard the minutes changing every minute (max delay is one minute)

try reboot; if the minutes are changing the plug in is running
if no the plug in is not running

if yes ; if it stops after midnight it is an error in the variables

if yes and it keeps on runnig after midnight it is getting no data from the dutchg smart meter

possible you checked it a dozen times; the device numbers are correct?

pls advice
rgds
huib

Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 05, 2013, 12:21:32 am
The minutes and date are not changing, not even after reboot.
So, plugin is not running. I will investigate that tonight....

Device nummers are 100% correct.....

Another thing I noticed:
When opening the  S_dutchSmartMeterCounter.xml file straight from the forum in my xml-editor, it says:
"Error at line 944, column 5: mismatched tag". Could this be the reason?
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 05, 2013, 01:54:18 pm
@cmbeek

had a look
in the version on my laptop i got an error

try this version now:

Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 05, 2013, 03:59:52 pm
No better result than before:
Luup files are uploaded, device is created, ID's are set (and file is uploaded again). Luup code is run to set all variables to zero. This all results in minutes and everything else staying on zero's.

Reboot of device didn't help either....

Luupcode is definitly not running. Checked \etc and could not find any of files created by code in "I_dutchSmartMeterCounter".

If your vera is working, is it an idea to download your files from your vera and post those files?
Just looking for a solution since I love the idea of your plugin. And if its is working on one vera.......

Thanks again.

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on February 05, 2013, 04:04:12 pm
Mine is also not updating anymore. Could you upload the original version?
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 05, 2013, 04:31:08 pm
@screamhouse
@cmbeek

pls find attached the files downloaded from the veralite a few minutes ago
try it and let me know, cause i am puzzled

after uploading pls check if you see any information with the following link in your brouser
http://ip:3480/data_request?id=status&output_format=xml&DeviceNum=xx

ip = ip adess of your vera
xx = device number

rgds
huib
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on February 05, 2013, 04:47:41 pm
I think we are back in business:

<root LoadTime="1360100730" DataVersion="9" UserData_DataVersion="" TimeStamp="1360100811" ZWaveStatus="1" LocalTime="2013-02-05 22:46:51 N">
<Device_Num_205 status="-1">
<states>
<state id="185" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Day" value="5"/>
<state id="186" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TypeDay" value="Tuesday"/>
<state id="187" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Month" value="2"/>
<state id="188" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TypeMonth" value="February"/>
<state id="189" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Year" value="0"/>
<state id="190" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Minutes" value="46"/>
<state id="191" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Hours" value="22"/>
<state id="192" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TimeStamp" value="Tue Feb 5 22:46:45 2013"/>
<state id="193" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Low" value="234.318"/>
<state id="194" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="High" value="184.857"/>
<state id="195" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="Gas" value="424.247"/>
<state id="196" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TodayLow_7" value="0"/>
<state id="197" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TodayLow_6" value="0"/>
<state id="198" service="urn:Kuiper-com:serviceId:dutchSmartMeterCounter" variable="TodayLow_5" value="0"/>
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 05, 2013, 04:53:51 pm
@screamhouse

is the value of the minutes at the dashboard changing / updating

pls advise
rgds
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on February 05, 2013, 04:57:44 pm
Yes!
Thanks for the support!
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 05, 2013, 05:03:18 pm
@screamhouse
let me know if the information is updated after 00:00 and that information is moving downwards

at my end the updating of the month works ok and till now i did not yet had the update of 1 jan but the principe is the same

pls advise
rgds

Huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 06, 2013, 12:57:08 pm
@huib
No luck here. I get the same response of the device as Screemhouse but time keeps displaying zero's........
When opening the S_dutchSmartMeterCounter.xml  file I get the same error as mentioned a few posts ago.....


Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 06, 2013, 01:04:03 pm

@cmbeek
Did you update all 4 file as sent on 5 feb?
What do you get if you check the variable through the brouwser?
Pls advise
Rgds
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 06, 2013, 04:12:04 pm
@huib

See attachement for result of http://ip:3480/data_request?id=status&output_format=xml&DeviceNum=xx
Looks ok to me, but that doesn't mean much ;-)
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 07, 2013, 11:10:36 am
@cmbeek

be so kind to advice

1) did you update the files as sent on 5 feb
2) the smart meter it self is running good?
3) did you run the scene with the luup.reset1?

pls advise
rdgs
huib
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 07, 2013, 03:40:22 pm
@ Huib

1) did you update the files as sent on 5 feb --> Yes, but only after changing Id numbers
2) the smart meter it self is running good? --> Yes
3) did you run the scene with the luup.reset1? --> Yes

Strange isn't it?

Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 07, 2013, 03:57:52 pm
@cmbeek

can you look at the luup.log file by using WinSCP
special look for
\etc\chm\AAASmartMeter.log

do you see the message ..
2013-01-28 22:01:39 dutchSmartMeterCounter: Start Up Completed

and or
2013-01-29 00:00:00 Started = EoD TimeLog =
2013-01-29 00:00:00 Started = Tue Jan 29 00:00:00 2013
2013-01-29 00:00:00 Started = EoD Start of Data Process TimeLog =
2013-01-29 00:00:00 Started = Tue Jan 29 00:00:00 2013
2013-01-29 00:00:00 Started = EoD End of Data Process TimeLog =
2013-01-29 00:00:00 Started = Tue Jan 29 00:00:00 2013


and also look in
\var\log\chm\LuaUPnP.log after rebooting
look for luup_log: ID
and for
_dutchSmartMeterCounter.xml error message

pls advise
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on February 13, 2013, 03:49:53 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

Huib, I found the error where I did not get the High figure correct:

local last_kwh2= luup.variable_get("urn:Kuiper-com:serviceId:dutchSmartMeterCounter", "TodayHigh_6", Add_Plugin ) or "0"

the Add_Plugin must be ADD_Plugin, now it works perfectly, thx again
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 17, 2013, 01:05:15 am
@Huib

Finally I figured out what the problem was!!
I looked at different logs (thanks Huib) and could only draw one conclusion: The plug-in was not running at all.

Before I changed the I_dutchSmartMeterCounter.xml file using a free XML editor found on the internet.
This time I tried good old notepad to change the Id-numbers in the code and now the plugin works!!!!
(apparently the free XML -editor messes up the code.....)

Thanks again for all the support!
Title: Re: Dutch Smart meter additional plug in
Post by: huib on February 17, 2013, 11:53:31 am
@cmbeek
A decent tool for writing in xml or json file is, for me, notepad++
Others might have other programs, but i like this one

I am happy it is now running
Rgds
Huib
Title: Re: Dutch Smart meter additional plug in
Post by: joost1981 on February 21, 2013, 06:26:00 am
Hello to you all,

I'm the proud owner of a Vera 2 and still an newbee. I would like to measure electricity and gas using the P1 port on the electric meter.

Just want to make sure I understand the information in this topic.

When I order a cable (http://www.wirelesswonen.nl/Webwinkel-Product-22714125/Kabel-tbv-Slimme-meter.html) and plug it via USB in my Vera 2 and install the application "Dutch Smart Meter", then I am able to log my electric and gas usage? I could not find any information if this works with Vera2 (UI5)?

For now I am using a Youless Energy Monitor (only for measuring electricity).

Thank you for helping me out.

Joost Poulissen
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on February 22, 2013, 05:03:50 am
I think it should work.
Firmware is same as on veralite or vera3 units.
Plugin is the same.
I cannot think of a reason why it shouldn't work.....
Title: Re: Dutch Smart meter additional plug in
Post by: joost1981 on February 23, 2013, 07:48:46 am
I think it should work.
Firmware is same as on veralite or vera3 units.
Plugin is the same.
I cannot think of a reason why it shouldn't work.....

I order the cable and tested it today. Works like a charm!  ;D
Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on April 18, 2013, 08:06:51 am
Huib, once more thanks for this plugin, it gives me great visibility of my daily, weekly and monthly usage. Although with the cold weather I sometimes did not dare to look.
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on June 05, 2013, 04:11:51 pm
Huib, your plugin has been running smoothly for the past 3 months now.
Sun has finally started to shine and I was wondering if the plugin could easily(?) be expanded to include the exportrates (1 and 2) of my dutch meter in order to also monitor the production of solar electricity.

I looked at the code, but is far to complicated for me to even try expanding the code.  ???
Title: Re: Dutch Smart meter additional plug in
Post by: mr leaver on June 06, 2013, 06:09:49 am
cmbeek

please remind that readings of exportrate1 en exportrate2 are likely values that are lower than the actual production.
Your own consumption during production of solar energy is not going back into the grid.

That is why i already asked for some help on making a plugin for my piko kostal solar converter
Title: Re: Dutch Smart meter additional plug in
Post by: cmbeek on June 06, 2013, 02:42:26 pm
@rpleever

I am aware that export rates are not equal to the solar energy produced.
There are actually two parameters that I am really interested in to monitor:

1) Electricity consumption which wil effect the height my electricity bill = Importrate1 + importrate2 - exportrate1 -exportrate2

and

2) My actual electricity consumption = Importrate1 + importrate2 - exportrate1 -exportrate2 + solar production

My solar production is measured by a zwave power clamp (AEON; accuracy could be better).
I would be very pleased if i could  monitor the two proposed parameters in a plugin like the "Dutch Smart meter additional plug in".


Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 12, 2014, 11:01:52 am
I have modified my plug in with the following additional item

every dat at midnite in a separete file the following data is added;

date; high, low, gas;

resulting in the following table;

2014-01-01 , 3608.3, 3380.5, 1112.4
2014-01-04 , 3633.8, 3401.6, 1118.2
2014-01-05 , 3633.8, 3414.6, 1121.0
2014-01-06 , 3633.8, 3431.6, 1124.6
2014-01-07 , 3648.8, 3435  , 1125.5
2014-01-08 , 3659.6, 3437.7, 1126.2
2014-01-09 , 3669.2, 3441, 1130.1
2014-01-10 , 3679.8, 3444, 1131.1
2014-01-11 , 3688.3, 3447.3, 1132.3
2014-01-12 , 3688.3, 3462.5, 1135.1

the location of the file is;
 /etc/chm/

name is
AAsmartMeterDataDailyLog

regards
Huib
Edit  will add files tomorrow

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on January 18, 2014, 03:43:21 am
Will installing this effect my data I already have gathered from your plugin? I do not want to loose my history
Title: Re: Dutch Smart meter additional plug in
Post by: huib on January 18, 2014, 04:14:37 am
No when you update the files you dont loose the data
I have been updating / playing with it and did not the last info

Rgds
Huib

Verstuurd van mijn GT-P3110 met Tapatalk

Title: Re: Dutch Smart meter additional plug in
Post by: svaleb on February 27, 2014, 08:58:13 am
@Huib
Do you know if this Dutch powermeter is in anyway related to the Danish Kamstrup powermeter for the kamstrup 382 meter.
Because then I would hope your software is in english (would prefer danish but...).
We are some who have the kamstrup z-wave module 6840001 and we would like to know more.
Regards
           CE

http://www.kamstrup.dk/media/21659/file.pdf
 
Title: Re: Dutch Smart meter additional plug in
Post by: huib on March 02, 2014, 10:09:43 am
@svaleb
To be onest i have no idea
My power meter is an iskra and has an outgoing gate which gives the data

How your meter is working i do not know
I have made an additional plug in for reading the power consumption over a period of time
I use the dats from the original plugin is as on the forum

Sorry to say i can not assist
Rgds  Huib

Verstuurd van mijn GT-P3110 met Tapatalk

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on March 02, 2014, 01:33:01 pm
I have a Kamstrup and am using this plugin
Title: Re: Dutch Smart meter additional plug in
Post by: svaleb on March 02, 2014, 05:00:42 pm
Thanks Huib and Crismaison.
I dont know how to make my kamstrup work properly. Right now it shows kwh ok, but w x 1000 i think.
A friend of mine has a solar system and would like to have his powermeter to work too, but ther is not mutch help to get.
I once saw a picture of a dutch meter and it was a kamstrup type so I thougt you might be on to something.
I have tried to have MCV to look at it put no luck yet.
Thanks
      CE

Title: Re: Dutch Smart meter additional plug in
Post by: Crismaison on March 02, 2014, 05:31:32 pm
Do you connect it via a cable to the vera?
Title: Re: Dutch Smart meter additional plug in
Post by: svaleb on March 03, 2014, 03:09:36 am
No, the device is put in a slot in the main meter and zwave opperated.
Routing slave.
CE