Use a dimmer as a master dimmer

This example reads the name of the event that has triggered the macro ( and decides according to the devices name, to modify the level of all dimmers in the same zone (see 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 == "masterLight" then
         -- set all the dimmers of the room to the same level .. "/" .. .. "/DIMMER/*/SET?LEVEL=" .. event.get_string("LEVEL") )