return { on = { devices = {'Przycisk'} }, logging = { level = domoticz.LOG_DEBUG, marker = 'Multi Przycisk', }, execute = function(domoticz, device) local Dom1 = domoticz.groups('Parter') local Dom2 = domoticz.groups('Piętro') if (device.name == 'Przycisk') then if (Dom1.state == 'Off' and Dom2.state == 'Off') then Dom1.switchOn() elseif (Dom1.state == 'On' and Dom2.state == 'Off' and Dom1.lastUpdate.secondsAgo <= 3) then Dom2.switchOn() elseif (Dom1.state == 'On' and Dom2.state == 'Off' and Dom1.lastUpdate.secondsAgo > 3) then Dom1.switchOff() elseif (Dom1.state == 'On' and Dom2.state == 'On') then Dom1.switchOff() Dom2.switchOff() end end end }