attempt to call local 'filter' (a table value)

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

Moderator: leecollings

Post Reply
Deluka
Posts: 19
Joined: Thursday 03 March 2016 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

attempt to call local 'filter' (a table value)

Post by Deluka »

I have this small script

Code: Select all

return 
{
	on = { timer = { "every minute" }}, 
	    
	execute = function(domoticz, switch)

	    local x = {59,56,47,4,1}
	    local MyDevices = domoticz.devices().filter(x)
	    local CurrentLux = domoticz.devices("Lux Living").lux
	    local Geo = domoticz.devices('Geofence')
	    
	    if (Geo.state == 'Off') and (Geo.lastUpdate.minutesAgo == 5) then
	        domoticz.notify('Qbert Says:','I turned everthing Off for you',domoticz.PRIORITY_HIGH)
	        
		MyDevices.forEach(function(mydevice)
                 mydevice.switchOff().checkFirst()
		end)

    
 	    elseif (Geo.state == 'On') and (Geo.lastUpdate.minutesAgo == 2) then
		domoticz.notify('Qbert Says:','I turned everything On for you',domoticz.PRIORITY_LOW) 
		
		MyDevices.forEach(function(mydevice)
		    
		 if mydevice.description == 'light' and CurrentLux < 15 then
	            mydevice.switchOn().checkFirst()
	         elseif mydevice.description == 'switch' then
	            mydevice.switchOn().checkFirst()
	         end

                end)
    end
    end

}
and i get the following error

Code: Select all

Error: dzVents: Error: /home/pi/domoticz/scripts/dzVents/runtime/Domoticz.lua:408: attempt to call local 'filter' (a table value)
On the beta latest beta everything works but this error i get under the stable version
I tried re-installing domoticz but the problem remains :oops:
SweetPants

Re: attempt to call local 'filter' (a table value)

Post by SweetPants »

Deluka wrote: Sunday 18 March 2018 18:54 On the beta latest beta everything works but this error i get under the stable version
I tried re-installing domoticz but the problem remains :oops:
Maybe this is not implemented in stable version? There where some major changes in dzVents since stable release
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: attempt to call local 'filter' (a table value)

Post by dannybloe »

Yes. That’s because you need a younger version of dzVents that’s only in the beta.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Deluka
Posts: 19
Joined: Thursday 03 March 2016 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: attempt to call local 'filter' (a table value)

Post by Deluka »

Oke but this comes direct of the DZvents wiki

Code: Select all

local livingLights = {
        'window',
        'couch',
        33, -- kitchen light id
    }
    local lights = domoticz.devices().filter(livingLights)
    lights.forEach(function(light)
        -- do something
        light.switchOn()
    end)
and also gives the same error
If its on the wiki sure its in the stable version, right ?
Deluka
Posts: 19
Joined: Thursday 03 March 2016 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: attempt to call local 'filter' (a table value)

Post by Deluka »

Oke found out i'm using version 2.2 and the wiki was for 2.4
Can i just upgrade DZvents to 2.4 in a stable version ?
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: attempt to call local 'filter' (a table value)

Post by dannybloe »

No. It goes hand in hand with Doniticz.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest