Use a dimmer as a master dimmer

This example reads the name of the event that has triggered the macro (event.name()) and decides according to the devices name, to modify the level of all dimmers in the same zone (see event.fire(string) where the string is a concatenation of the events area, zone and level with /DIMMER/*/ that selects all dimmers regardles of their name).

function(event, engine) 
   -- If the event corresponds to a dimmer
   if event.type() == "DIMMER" then
      -- if the dimmer is named masterLight
      if event.name() == "masterLight" then
         -- set all the dimmers of the room to the same level
         engine.fire(event.area() .. "/" .. event.zone() .. "/DIMMER/*/SET?LEVEL=" .. event.get_string("LEVEL") )
      end
   end
end