I can not get it myself.
I have stairs with 6 lamps (on / off) and a motion detector (sends ON / OFF after 2min)
the button can be ignored
Thanks
Code: Select all
return {
active = true,
on = {
devices = {
'Zigbee Stick - BWM1',
'Zigbee Stick - Taster'
}
},
execute = function(domoticz, device)
local Taster = domoticz.devices('Zigbee Stick - Taster')
local BWM = domoticz.devices('Zigbee Stick - BWM1')
local lamp1 = domoticz.devices('Zigbee Stick-treppe1')
local lamp2 = domoticz.devices('Zigbee Stick-treppe2')
local lamp3 = domoticz.devices('Zigbee Stick-treppe3')
local lamp4 = domoticz.devices('Zigbee Stick-treppe4')
local lamp5 = domoticz.devices('Zigbee Stick-Flur OG1')
local lamp6 = domoticz.devices('Zigbee Stick-Flur OG2')
if (device.name == 'Zigbee Stick - BWM1' and device.state == 'On'
or device.name == 'Zigbee Stick - Taster' and device.state == 'Click') then
if (lamp1.state == 'Off' or lamp2.state == 'Off' or lamp3.state == 'Off' or lamp4.state == 'Off' or lamp5.state == 'Off' or lamp6.state == 'Off') then
lamp1.switchOn()
lamp2.switchOn()
lamp3.switchOn()
lamp4.switchOn()
lamp5.switchOn()
lamp6.switchOn()
else
lamp1.switchOff()
lamp2.switchOff()
lamp3.switchOff()
lamp4.switchOff()
lamp5.switchOff()
lamp6.switchOff()
end
end
end
}