What I'm doing wrong ?
Adding two values...
Code: Select all
return
{
on =
{
devices =
{
'Kookplaat_F1_(Rechts)',
'Kookplaat_F3_(Links_Flexzone)',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Adding F1 en F2',
},
execute = function(dz, devices)
targetDevice = dz.devices('Tot_Fornuis') -- define as virtual custom sensor
-- local ph1 = dz.devices.('Kookplaat_F1_(Rechts)')
local ph1 = dz.devices('Kookplaat_F1_(Rechts)') -- Fase meting L1 Kookplaat Rechts
local ph2 = dz.devices('Kookplaat_F3_(Links_Flexzone)') -- Fase neting L2 Links_Flexzone
local sumForn = ph1 + ph2
dz.log('Sum of phase1 en phase2' .. sumForn, dz.LOG_DEBUG)
targetDevice.updateCustomSensor(sumForn)
end
}