Looks like this:
Code: Select all
return {
on = {
timer = {
'every 1 minutes'
},
},
execute = function(domoticz, device, timer)
local vandaagKwhzon = domoticz.devices('Zonnepanelen carport').counterToday -- Replace everywhere between ' ' with the name of your solar panel device or put -- in front of it if you don't use it
local vandaagKwhzon2 = domoticz.devices('Zonnepanelen garage').counterToday -- Zonnepanelen S0 device
local vandaagKwhzon3 = domoticz.devices('Zonnepanelen dak 1').counterToday -- Zonnepanelen S0 device
local vandaagKwhzon4 = domoticz.devices('Zonnepanelen dak 2').counterToday -- Zonnepanelen S0 device
local vandaagKwhzon5 = domoticz.devices('Zonnepanelen dak 3').counterToday -- Zonnepanelen S0 device
local vandaagKwhzon6 = domoticz.devices('Zonnepanelen kantoor').counterToday -- Zonnepanelen S0 device
local zonTotaal = domoticz.devices('Zon opbrengst totaal vandaag') -- Create a customsensor with Kwh as variable and replace the name with your device name
-- Kosten berekenen
local kwhOpbrengst = tonumber(domoticz.utils.round((vandaagKwhzon + vandaagKwhzon2 + vandaagKwhzon3 + vandaagKwhzon4 + vandaagKwhzon5 + vandaagKwhzon6),2))
-- Kosten updaten
zonTotaal.updateCustomSensor(kwhOpbrengst)
end
}