Code: Select all
return {
on = {
timer = { 'every 1 minutes' }
},
execute = function(domoticz, item)
local bhPower = domoticz.devices(30) -- replace the numbers with the idx numbers from your devices or put -- in front of it to disable
local fhPower = domoticz.devices(8)
local ahPower = domoticz.devices(21)
local chPower = domoticz.devices(18)
local dhPower = domoticz.devices(24)
local ghPower = domoticz.devices(38)
local totalPower = domoticz.devices(56) --create a customsensor with "watt" as variable and replace 56 with that devices idx
local totalPowerupdate = tonumber(domoticz.utils.round((bhPower.WhActual + fhPower.WhActual + ahPower.WhActual + chPower.WhActual + dhPower.WhActual + ghPower.WhActual),2))
totalPower.updateCustomSensor(totalPowerupdate)
end
}