I would like my Vera3 (UI5) to email me the value contained in a device variable on a regular basis. Is this possible?
Thanks, JohnK
I would like my Vera3 (UI5) to email me the value contained in a device variable on a regular basis. Is this possible?
Thanks, JohnK
Sure. Use a scheduled scene or PLEG to retrieve the value and Vera Alerts, documented here, to email it out.
Thanks Z-Waver. I’ll look at your pointers.
JohnK.
I have been thinking about this and rather than emailing me the variable I would like to store the data in a non-volatile file on the Vera3 (UI5). I would like to store the data as a CSV file in the format “date/time, variable_contents” and I guess the place to put it would be on the USB drive that I use for logging. Can someone give me some clues or examples?
JohnK.
To answer my own question ;D
This turned out to be quite straight-forward with a bit of digging in the lua reference material.
This code reads the cumulative energy consumption and the instantaneous consumption from a Aeon Labs HEM and puts the resultant data in a file (xkwh.log) on the USB drive. This code is placed in a scene that is scheduled to run as you require.
Not elegant code but it does what I want.
[code]local file = io.open(“/tmp/log/cmh/xkwh.log”, “a+”)
local humantime = os.date(“%d/%m/%Y %H:%M:%S”)
local kwhrs = luup.variable_get( “urn:micasaverde-com:serviceId:EnergyMetering1”, “KWH”, 32)
local instwatts = luup.variable_get( “urn:micasaverde-com:serviceId:EnergyMetering1”, “Watts”, 32)
file:write(humantime)
file:write(“, “)
file:write(kwhrs)
file:write(”, “)
file:write(instwatts)
file:write(”\n”)
file:close()
return true
[/code]
Best Home Automation shopping experience. Shop at Ezlo!
© 2022 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules