2 identical scripts, one works on doesn't?
Posted: Sunday 03 May 2020 8:04
Hello,
I'm still starting with DzVents, but I have a light script working:
So I copied it and only changed the devices names (Checked them on mistakes) but now it doesn't work:
I get the following error:
2020-05-03 07:27:24.027 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 07:27:24.027 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with nil
2020-05-03 07:27:24.125 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 07:27:24.126 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:9: attempt to compare nil with number
So the problem is in the lux comparation
I use the Neo Coolcam pir and the Fibaro Dimmer 2 on both settings.
What can the problem be?
I tried to put the value in a local,
but then I get another error:
2020-05-03 08:01:13.621 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 08:01:13.621 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with table
2020-05-03 08:01:13.719 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 08:01:13.719 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with table
I'm still starting with DzVents, but I have a light script working:
Code: Select all
return {
on = {
devices = {'Lux Zithoek', 'Motion Zithoek'
}
},
execute = function(dz, item)
if dz.devices('Motion Zithoek').active and
item.lux < 25 then
dz.devices('Light Wand Voor').setLevel(50)
end
if dz.devices('Motion Zithoek') == Off or
item.lux > 70 then
dz.devices('Light Wand Voor').switchOff()
end
end
}Code: Select all
{
on = {
devices = {'Lux Bijkeuken', 'Motion Bijkeuken'
}
},
execute = function(dz, item)
if dz.devices('Motion Bijkeuken').active and
item.lux < 25 then
dz.devices('Light Bijkeuken').setLevel(50)
end
if dz.devices('Motion Bijkeuken') == Off or
item.lux > 70 then
dz.devices('Light Bijkeuken').switchOff()
end
end
}2020-05-03 07:27:24.027 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 07:27:24.027 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with nil
2020-05-03 07:27:24.125 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 07:27:24.126 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:9: attempt to compare nil with number
So the problem is in the lux comparation
I use the Neo Coolcam pir and the Fibaro Dimmer 2 on both settings.
What can the problem be?
I tried to put the value in a local,
Code: Select all
return {
on = {
devices = {'Lux Bijkeuken', 'Motion Bijkeuken'
}
},
execute = function(dz, item)
local LuxBijkeuken = dz.devices('Lux Bijkeuken')
if dz.devices('Motion Bijkeuken').active and
LuxBijkeuken < 35 then
dz.devices('Light Bijkeuken').setLevel(50)
end
if dz.devices('Motion Bijkeuken') == Off or
LuxBijkeuken > 55 then
dz.devices('Light Bijkeuken').switchOff()
end
end
}but then I get another error:
2020-05-03 08:01:13.621 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 08:01:13.621 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with table
2020-05-03 08:01:13.719 Error: dzVents: Error: (3.0.2) An error occurred when calling event handler Licht Bijkeuken DzVents
2020-05-03 08:01:13.719 Error: dzVents: Error: (3.0.2) ...ts/dzVents/generated_scripts/Licht Bijkeuken DzVents.lua:13: attempt to compare number with table