Introduction
This tutorial explains how to create a simple BeoLiving Intelligence macro to toggle the mute state of a Bang & Olufsen Mozart product, such as a Beosound Balance or Beosound Emerge. This can be useful for connecting a mute button on a keypad or third-party remote to your Mozart product.
How to set it up
To set up the mute toggle macro, follow these steps:
- Open the BeoLiving Intelligence admin panel.
- Go to the Macro tab.
- Create a new Macro.
- Add a trigger for this macro, such as a button press on your keypad or third-party remote, as an event.
- Press the “Convert to code” button in the commands table.
- Copy the entire code in “The code” section below.
- Paste the code into the code text area of the Macro.
- Replace
_targetProduct_
with the actual address of your Mozart product in the SETTINGS section. - Test the macro by triggering the event. The macro should toggle the mute state of your Mozart product.
The macro lua code
-- === TOGGLE MUTE ON A BANG & OLUFSEN MOZART PRODUCT ===
-- This macro toggles the mute state of the _targetProduct_.
--
-- How to use it:
-- 1. Create a Macro.
-- 2. As an event, add the trigger for this macro, e.g., a button press on a keypad.
-- 3. Press the Convert to code button in the commands table.
-- 4. Copy this whole file into the code text area.
-- 5. Replace _targetProduct_ with the actual address of your Mozart product.
-- 6. Test it: Trigger the event, and the macro should toggle the mute state.
-- ============================================================================
function(event, engine)
-- --------------------------------------------------------
-- SETTINGS
-- --------------------------------------------------------
local renderer = "_targetProduct_" -- Replace with the address of your Mozart product.
-- --------------------------------------------------------
-- DO NOT EDIT BELOW HERE UNLESS YOU REALLY UNDERSTAND IT!
-- --------------------------------------------------------
local isMute = engine.query(renderer)[1].get_boolean("MUTE")
local nextState = isMute and "false" or "true"
engine.fire(renderer .. "/SET_MUTE?MUTE=" .. nextState)
end
Example macro view

Customize Settings
You can customize the macro by changing the renderer
variable in the SETTINGS section of the lua code to match the address of your Mozart product.