Page 1 of 1

Switching on PV Power

Posted: Thursday 17 July 2025 10:09
by TeamKleijn
Hello all,

i've implemented the Domotics Energy view by using P1 data from my 'slimme meter'
Some virtual devives are added by the installation script for a 3phase environment i have the device "kWh Delivery L3 (Calculated)"
Ill gives the Power wich sended back at the grid when there is enough sun on the panels. The value = 0 or positive in watts

So i want to us the script below to switch ON a Tasmota device if Power > 1000 Watt and switch off when it come's below 500 watt

below my script :

Code: Select all

return {
    active = true,
    on = {	
    		devices = {"kWh Delivery L3 (Calculated)"}
        },
    execute = function(domoticz, device)
    
    if (domoticz.devices("Tas76-ZonneStroom").state == 'Off' and
        domoticz.devices("kWh Delivery L3 (Calculated)").Watt ~= nil and
    	domoticz.devices("kWh Delivery L3 (Calculated)").Watt > 1000 )
    then
    	domoticz.devices("Tas76-ZonneStroom").switchOn()
     end
  end
  }
The problem is "Tas76-ZonneStroom" don't switch on when there is enough sunpower.
Can somebody help me with this script ?

Thanks a lot

Rob

Re: Switching on PV Power

Posted: Thursday 17 July 2025 10:36
by waltervl
For a kWh, general device there is no Watt attribute, there is a actualWatt attribute. See the wiki for the proper attributes per device
https://wiki.domoticz.com/DzVents:_next ... _scripting

The script probably should shown errors in the log as "domoticz.devices("kWh Delivery L3 (Calculated)").Watt" is not known. That error should have warned you already.

You asked AI to generate this script?