Get return power value from P1 meter
Posted: Wednesday 14 July 2021 16:57
I'm a starter related to Domoticz and lua/DzVents... But with some help from the board and some Googling I did manage to make everything work like I wanted. I have 67 solarpanels at home which totally generates 21.000wp. Because I have 4 different brands of inverters I wanted to use Domoticz to monitor and provide an overview for my entire houshold (and company together) energy consumption and delivery. With this code you also can use it to calculate your actual household use at this very moment when you also use my other code for the solarpanels power generation added up.
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
Also made monthly return code which I will share later on.
The device will look like this:
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
}