local switch1 = 'touch 1' -- change the name to your domoticz switch local switch2 = 'touch 2' -- change the name to your domoticz switch local switch3 = 'touch 3' -- change the name to your domoticz switch local switch4 = 'touch 4' -- change the name to your domoticz switch return { on = { devices = { switch1, switch2, switch3, switch4 } }, --Do not change anything below this line execute = function(dz, device, triggerInfo) if (dz.EVENT_TYPE_TIMER == triggerInfo.type) then dz.log( 'timer event: '..tostring(triggerInfo.trigger)..'.', dz.LOG_INFO) elseif (dz.EVENT_TYPE_DEVICE == triggerInfo.type) then if (device.name == switch1) then if (device.state ~= dz.devices(switch2).state and device.state ~= dz.devices(switch3).state and device.state ~= dz.devices(switch4).state) then dz.devices(switch2).setState(device.state) dz.devices(switch3).setState(device.state) dz.devices(switch4).setState(device.state) end elseif (device.name == switch2) then if (device.state ~= dz.devices(switch1).state and device.state ~= dz.devices(switch3).state and device.state ~= dz.devices(switch4).state) then dz.devices(switch1).setState(device.state) dz.devices(switch3).setState(device.state) dz.devices(switch4).setState(device.state) end elseif (device.name == switch3) then if (device.state ~= dz.devices(switch1).state and device.state ~= dz.devices(switch2).state and device.state ~= dz.devices(switch4).state) then dz.devices(switch1).setState(device.state) dz.devices(switch2).setState(device.state) dz.devices(switch4).setState(device.state) end elseif (device.name == switch4) then if (device.state ~= dz.devices(switch1).state and device.state ~= dz.devices(switch2).state and device.state ~= dz.devices(switch3).state ) then dz.devices(switch1).setState(device.state) dz.devices(switch2).setState(device.state) dz.devices(switch3).setState(device.state) end end end end }