I'm fairly new to dzvents and its driving me crazy. I followed the wiki for my script and I get the following error when I run my script.
this is my scriptattempt to call field 'forSec' (a nil value)
Code: Select all
return {
on = {
devices = { 'Wireless Switch Round1' }
},
execute = function(domoticz,switch)
-- Lamp aan
if (switch.state == 'Click' and domoticz.devices('Lamp Wand 1').state) == 'Off' then
domoticz.devices('Lamp Hal').switchOn().forSec(2).repeatAfterSec(1,3)
domoticz.devices('Lamp Wand 1').switchSelector(40)
domoticz.devices('Lamp Wand 2').switchSelector(40)
domoticz.devices('Lamp Eettafel').switchSelector(40)
domoticz.devices('Lamp Staand').switchSelector(40)
end
-- Lamp uit
if (switch.state == 'Click' and domoticz.devices('Lamp Wand 1').state) == 'On' then
domoticz.devices('Lamp Hal').switchOn().forSec(2).repeatAfterSec(1,3)
domoticz.devices('Lamp Wand 1').switchOff()
domoticz.devices('Lamp Wand 2').switchOff()
domoticz.devices('Lamp Eettafel').switchOff()
domoticz.devices('Lamp Staand').switchOff()
end
end
}