OK, been giving it more thought and realise there is a "hopefully simple" change needed here/
The Aeon has a master device and 3 slaves in Vera, the slaves being the 3 individual clamps and the master "already having a calculation in it" which is the sum of the 3 clamps.
This is designed for 3 phase systems where the total power is that calculation.
In my case everything is going through clamp 1 and then 2 and 3 cover individual large loads.
If I can simply modify this sum in the master device to be
clamp 1 - clamp 2 - clamp 3
Instead of 1 + 2 + 3
I can achieve what I am after without major coding.
Has anyone any idea where the master device calculation takes place?? I can't see a lua file associated with the Aeon in the plugins directory, where would it be located??
Many thanks
Nick
You can create you own device and setting the value on a watching method
I do something like this with my 2 clamp version:
I create a virtual device type urn:schemas-micasaverde-com:device:PowerMeter:1 with device file D_PowerMeter1.xml
and in my startup script:
HEM_GEN is my first clamp ,HEM_PV my second clamp and HEM_CALC is my virtual device
luup.variable_watch("calcPowerKwh","urn:micasaverde-com:serviceId:EnergyMetering1","KWH",HEM_GEN)
luup.variable_watch("calcPowerWatts","urn:micasaverde-com:serviceId:EnergyMetering1","Watts",HEM_GEN)
function calcPowerKwh()
--kwh
local kwhGen = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", HEM_GEN)
local kwhPv = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "KWH", HEM_PV)
local s=kwhGen-kwhPv
luup.variable_set("urn:micasaverde-com:serviceId:EnergyMetering1","KWH",s,HEM_CALC)
end
function calcPowerWatts()
--Watts
local wattsGen = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "Watts", HEM_GEN)
local wattsPv = luup.variable_get("urn:micasaverde-com:serviceId:EnergyMetering1", "Watts", HEM_PV)
local s=wattsGen-wattsPv
luup.variable_set("urn:micasaverde-com:serviceId:EnergyMetering1","Watts",s,HEM_CALC)
end