Energy Monitor - How to setup periodic KW/h notifications?

I have installed the whole house energy meter and can read via login the KW/h. But instead logging into my account I like to setup that at 2 times a day the KW/h usage is send by email. The notification tab for the meter allows only 'notification by high or low watt usage" and not a periodic sending of the KW/h readings. Can this be done by a code? Any help is very appreciated. I am trying to setup a system for vacation rentals where guests have to pay for their power usage without the need of the property manager to drive out and read the meters.

You can certainly read the meter periodically. Presumably your meter presents a standard energy metering service within Vera, so the following:

local kWh = luup.variable_get( "urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", device)

placed in the Luup tag of a scene which is scheduled to run twice a day should do half of the trick (with “device” set to the appropriate device number for the meter.)

I’m not much into notifications, but there are several mechanisms, including additional plugins, which enable this. HTH.

Once you step away from the standard Vera Notifications this gets more complicated.

There are two parts to this problem.

[ol][li]Automating the collection of the data.
This can be done with a schedule input for a Scene.[/li]
[li]Reporting the result via email.
You will need to decide on a Plugin to forward a notification, Vera Alerts, Push, SMTP …
You will need to place the data that you access per @akbooer post into the message you send.
This will all be done via LUUP code for the Scene. The details of which are dependent on which plugin you use.
[/li][/ol]

[hr]
This can be done without LUA code if you use the Vera Alerts Plugin. But the Vera Alerts and SMTP have similar, but complicated, email configuration process.

Note also the discussion about this on the following thread:

[url=http://forum.micasaverde.com/index.php/topic,14680.0.html]http://forum.micasaverde.com/index.php/topic,14680.0.html[/url]

See my answer to a previous similar post:

First of all, please install and setup [url=https://apps.mios.com/plugin.php?id=2498]the SMTP Notification plugin[/url]. Then, create a scheduled scene, and insert the following code in the luup section :

[code]
local powerDeviceId =
local smtpDeviceId =

local kwatts = luup.variable_get(“urn:micasaverde-com:serviceId:EnergyMetering1”, “KWH”, powerDeviceId)
luup.call_action(“urn:upnp-org:serviceId:SmtpNotification1”, “SendEmail”, { Recipient_Name=“Rental #42”, Recipient_eMail="rental@mybusiness.com", Subject= “Energy from Rental #42”, Message=“Power Meter=”…kwatts }, smtpDeviceId)
return true
[/code]

Personnaly, I wanted to have a KWH meter device on my UI, but resetted every day. To do so, I manually created a 2nd energy meter (virtual), and two scenes:

Scene #1 “Save daily KWH”, running everyday at midnight:

local realDeviceID = 63
-- get current KWH
local kw = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", realDeviceID )
-- and save it in a user created variable
luup.variable_set(realDeviceID, "KWH24", kw, realDeviceID)
return true

Scene #2 “Update Virtual Power Meter”, scheduled every 15min :

local realDeviceID = 63
local virtualDeviceID = 65

-- get the current KWH
local kw = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", realDeviceID)
-- get the previous KWH value at midnight
local kw24 = luup.variable_get(realDeviceID, "KWH24", realDeviceID)

-- update virtual device
if kw24 == nil then -- may be true the very first time
    luup.variable_set(realDeviceID, "KWH24", kw, realDeviceID)
    kw24 = kw
end

luup.variable_set("urn:micasaverde-com:serviceId:EnergyMetering1", "Watts", 1000*(kw-kw24), virtualDeviceID)
luup.variable_set("urn:micasaverde-com:serviceId:EnergyMetering1", "KHW", kw, virtualDeviceID)

return true

Hi nono240

I’m found very interesting the option of create a virtual energy meter. (I’m uploading watt info into plotwatt and bidgely web sites )

I was trying to do it, but I only found info of virtual switches dimmers, thermostat… but not energy meters.

Please can you share the xml file :slight_smile:

Thanks in advance

Did you ever got further info to setup a virtual energy meter device. I’m interested in this too such that my data from the French EDF Teleinfo read by Arduino shield can be stored in Vera.
Rgds
Dick

I haven’t installed mine as of yet, but this is interesting and shows promise…