For this I wanted to share some codes with you. Are they 100% fault free? No way! As i'm only a starter and trial and errored my way trough the code... But it works and thats whats most important. At first I wanted to share with you my return value for the P1 meter code. I found it nowhere on the internet, probably nobody cares about the power returned to the grid in a separate overview... But I do

The device will look like this:
Code: Select all
return {
on = {
timer = {
'every 1 minutes'
},
},
execute = function(domoticz, device, timer)
local yhPower = domoticz.devices(1).usageDelivered -- Change the 1 for your own P1 meter idx
local zzhPower = domoticz.devices(62) --Create a customsensor with "watt" as variable and change 62 into that idx
local totalPowerupdate1 = (yhPower)
zzhPower.updateCustomSensor(totalPowerupdate1)
end
}