error using this script
Posted: Thursday 28 November 2019 19:24
hi all,
the basic functions of this script work but i get the following error:
this is the script, what am i doing wrong?
the basic functions of this script work but i get the following error:
Code: Select all
2019-11-28 19:22:42.439 Error: dzVents: Error: (2.5.0) An error occurred when calling event handler Licht hal beneden
2019-11-28 19:22:42.439 Error: dzVents: Error: (2.5.0) .../scripts/dzVents/generated_scripts/Licht hal beneden.lua:18: attempt to compare string with tableCode: Select all
return {
on = {
devices = {
'PIR hal beneden'
}
},
execute = function(dz, device)
dz.log('Device ' .. device.name .. ' was changed', dz.LOG_INFO)
local pir = dz.devices("PIR hal beneden")
local lamp = dz.devices("Lamp hal beneden")
local lux = dz.devices("LUX hal beneden").lux
local tijd = dz.time
if pir.state == "On" and lux < 20 then
lamp.cancelQueuedCommands()
lamp.switchOn().forMin(1)
if tijd > '23:00' and tijd < '06:00' then
lamp.dimTo(30)
elseif tijd > '06:00' and tijd < '23.00' then
lamp.dimTo(100)
end
end
end
}