PVOutput (input)  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
florisi
Posts: 78
Joined: Saturday 30 July 2016 10:14
Target OS: Linux
Domoticz version: 2020beta
Location: Arnhem
Contact:

PVOutput (input)

Post by florisi »

I have SolarEdge solarpanels.
Last february they were broken.
Now I want a dzVents that checks if the panels still produce power.

It has to check between 11 AM en 1 PM if they are working, if not I want to have a Pushover alert.
My script now is this:

Code: Select all

return {
   on = {
       timer = {"every 10 Minutes between 11:00 and 13:00"}},
   execute = function(domoticz, timer)
      if domoticz.devices('PVOutput') = 0 then
         domoticz.notify('Zonnepanelen!','De zonnepanelen leveren GEEN stroom',SOUND_MAGIC,domoticz.PRIORITY_LOW,domoticz.NSS_PUSHOVER)
      end
   end
}
But that gives me an error in the log. What is wrong?

Code: Select all

2019-07-12 12:50:00.475 Status: dzVents: Info: ------ Start internal script: Zonnepanelen:, trigger: every 10 minutes between 08:30 and 19:30
2019-07-12 12:50:00.494 Status: dzVents: Error (2.4.19): An error occured when calling event handler Zonnepanelen
2019-07-12 12:50:00.495 Status: dzVents: Error (2.4.19): ...oticz/scripts/dzVents/generated_scripts/Zonnepanelen.lua:5: attempt to compare number with table
2019-07-12 12:50:00.495 Status: dzVents: Info: ------ Finished Zonnepanelen
knielen
Posts: 46
Joined: Sunday 10 September 2017 9:45
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: PVOutput (input)

Post by knielen »

try:

Code: Select all

return {
   on = {
       timer = {"every 10 Minutes between 11:00 and 13:00"}},
   execute = function(domoticz, timer)
      if domoticz.devices('PVOutput').usage == 0 then
         domoticz.notify('Zonnepanelen!','De zonnepanelen leveren GEEN stroom',SOUND_MAGIC,domoticz.PRIORITY_LOW,domoticz.NSS_PUSHOVER)
      end
   end
}
florisi
Posts: 78
Joined: Saturday 30 July 2016 10:14
Target OS: Linux
Domoticz version: 2020beta
Location: Arnhem
Contact:

Re: PVOutput (input)  [Solved]

Post by florisi »

Thanks, it works.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest