When I use it, Click and Double Click toggles my devices on and off.
When i do the Long Click nothing happens. And i get the error:
2019-09-01 22:55:30.983 Error: dzVents: Error: (2.4.26) An error occurred when calling event handler Dzvents SingleSw woonkamer
2019-09-01 22:55:30.983 Error: dzVents: Error: (2.4.26) ...dzVents/generated_scripts/Dzvents SingleSw woonkamer.lua:15: attempt to index local 'group' (a nil value)
Code: Select all
return {
on = {
devices = {'Switch_Single'} -- Name of your button
},
execute = function(dz, item, device, group)
if item.state == 'Click' then
dz.devices('Plafondspot').toggleSwitch() -- Name of your light
dz.log(device.state, dz.LOG_INFO)
elseif (item.state == 'Double Click') then
dz.devices('Woonkamer_Lamp2').toggleSwitch() -- Name of your light
dz.log(device.state, dz.LOG_INFO)
elseif item.state == 'Long Click' then
dz.groups('Alles_Uit').switchOff() -- Name of your group
dz.log(group.state, dz.LOG_INFO)
end
end
}
When I put the 'Long Click'part in a single script it works with the same lines.
Code: Select all
return {
on = { devices = { 'Switch_Single'} -- Name of your button
},
execute = function(dz, item, group)
if item.state == 'Long Click' then
dz.groups('Alles_Uit').switchOff() -- Name of your group
dz.log(group.state, dz.LOG_INFO)
end
end
}