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
}
Code: Select all
Error: dzVents: Error: /home/pi/domoticz/scripts/dzVents/runtime/Domoticz.lua:408: attempt to call local 'filter' (a table value)
I tried re-installing domoticz but the problem remains
