Hi to all,
As i need a perfect visual handling of my energy ( solar pv production and general energy monitoring ), i choosed emoncms as visualisation mode.
I’m not familiar with lua programming, but i have some code running for a vera 3 ui5, and i try to tranpose, for the moment with no sucsess.
I have two owl cm160 plugs mesuring my pv and genral power thrue a rfxtrx, and this is running fine.
Here is the code i use for a scene wich is posting my data to emoncms every minute :
local id = 25
local type = “urn:schemas-micasaverde-com:device:PowerMeter:1”
local fields = {“Watts”, “KWH”}
local apikey = “95fe5bdb8f6f28cefdbdbbddd6c1315c”
local voltage = 225
for i,field in ipairs(fields) do
local value = luup.variable_get(type, field, id)
value = tostring(value)
luup.inet.wget(“http://emoncms/input/post.json?node=0&json={“..field..”:“..value..”}&apikey=”…apikey)
if field == “Watts” then
local iinst = tostring(luup.variable_get(type, field, id) / voltage)
luup.inet.wget(“http://emoncms/input/post.json?node=0&json={IINST:“..iinst..”}&apikey=”…apikey)
end
end
I have no error message, the scene is running fine, but i have no value stored in my emoncms acount…
Is it possible to have some help to find what is wrong in my code, or at least a debug feature ?
If someone can send me code for at least one variable, i could accomodate by running two scenes, one for watts and one for kwh, but for now, i’m in the fog ! ;D
I think emoncms is a very good solution to value energy data, so i will swap for another system if it is not possible to link with vera, but i think vera is also a good system, so i want best of both worlds. 8)
Thanks on advance for any help !