Im trying to setup a dzvents script to toggle some lights on a button press
but i keep gettings errors on my ends...
is anyone able to review where im up to and direct me the correct way?
error is as below, with code below that
2019-11-16 17:12:12.949 Status: dzVents: Error (2.4.19): error loading module 'Lounge button' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/Lounge button.lua':
2019-11-16 17:12:12.949 ...ticz/scripts/dzVents/generated_scripts/Lounge button.lua:13: 'end' expected (to close 'function' at line 6) near 'else'
Code: Select all
return {
on = {
devices = { 35
},
execute = function(dz, item)
local lights = dz.devices('fan light 1', 'fan light 2')
if lights.state == 'On' then
lights.switchOff()
end
else
lights.switchOff()
end
}