BeoLiving news & support from Khimo!

636 replies
...

Hi !

I have the same problem whit my BLI.

The automatic switch  for my macros, that fire when they are before sunset seem to no longer work.

Hi !

I have the same problem whit my BLI.

The automatic switch  for my macros, that fire when they are before sunset seem to no longer work.

CTR wrote:
Can we do this ourselves via LUA?
Yes, with 2 Macros

Note: Halo,Renderer and virual resource all in the same Area and Zone.

 

MACRO 1: on/off button

Make virtual Boolean resource named "alarmButton" (same area/zone as Halo)

create 2 events (in the same Macro) for the new Halo Button: 1) Wheel turned, 2 ) Button pressed

code:

function(event, engine) 

  -- by pressing button ON/OFF toggles

  -- by clockwise turning wheel button ON

  -- by anti clockwise turning wheel button OFF

 

  local Ea=event.area()

  local Ez=event.zone()

 

  --Resource alarmButton as String

  local alarmButton_query = engine.query(Ea.."/"..Ez.."/VARIABLE/alarmButton")

  local aButton = alarmButton_query[1].get_boolean("VALUE")

 

  local deviceName="BeoPlay A6" -- change to name desired device (note: device and Halo in the same Area/Zone) "#"

  local info

  local tst="Alarm"

 

  local haloName="Beoremote Halo xxxx" -- change to name Halo in the BLI         "#"

  local haloID="497f6eca-6276-4993-bfeb-0000008xxxxx" -- change to ID of your Halo Button "#"

 

 

  if event.parameters()["OFFSET"] then

    if tonumber(event.parameters()["OFFSET"])>=1 then

      aButton= true

    else

      aButton=false

    end 

  else    

  if aButton then

      aButton=false

    else

      aButton=true

    end

  end  

 

  if aButton then

    info="ON"

  else

    info="OFF"

  end

 

  engine.fire(Ea.."/"..Ez.."/VARIABLE/alarmButton/SET?VALUE="..tostring(aButton))

  engine.fire(Ea.."/"..Ez.."/Halo remote/"..haloName.."/SET_TEXT?BUTTON="..haloID.."&TEXT="..tostring(info))

  engine.fire(Ea.."/"..Ez.."/Halo remote/"..haloName.."/SET_TITLE?BUTTON="..haloID.."&TITLE="..tostring(deviceName))  

  engine.fire(Ea.."/"..Ez.."/Halo remote/"..haloName.."/SET_SUBTITLE?BUTTON="..haloID.."&SUBTITLE="..tostring(tst))

 

end 

 

MACRO 2: start TuneIn on device at certain time if alarm is set ON

Event: Global/global/SYSTEM/Clock/STATE_UPDATE?hour=7&minute=0   (in this example TuneIn starts on 7:00h is alarm is set ON)

code:

function(event, engine) 

  -- your_area and your_zone are the Halo's and alarmButton area and zone

  local alarmButton_query = engine.query(your_area/your_zone/VARIABLE/alarmButton")

  local aButton = alarmButton_query[1].get_boolean("VALUE")

 

  if aButton then

    engine.fire(your_device_area/your_device_zone/AV renderer/your_renderer/Select source?Connector=&Origin=local&Source Type=TUNEIN")

  end  

end 

 

Edited second Macro

Hallo Carolpa

 

I don't get the Ea/Ez part for now.... Can you help me out?

Boolean, Halo and AV render is in the same area/zone. 

My code is like this for now:

 

function(event, engine) 

 

  -- by pressing button ON/OFF toggles

  -- by clockwise turning wheel button ON

  -- by anti clockwise turning wheel button OFF

 

  local Ea=event.area()

  local Ez=event.zone()

  --Resource alarmButton as String

 

  local alarmButton_query = engine.query("Stueplan/Spisestue/VARIABLE/alarmButton")

 

  local aButton = alarmButton_query[1].get_boolean("VALUE")

 

  local deviceName="M3 Spisestue" 

  -- change to name desired device (note: device and Halo in the same Area/Zone)

 

  local info

 

  local tst="Alarm"

 

  local haloName="Beoremote Halo" -- change to name Halo

 

  local haloID="497f6eca-6276-4993-bfeb-00000081071" -- change to ID of your Halo 

 

  if event.parameters()["OFFSET"] then

 

    if tonumber(event.parameters()["OFFSET"])>=1 then

 

      aButton= true

 

    else

 

      aButton=false

 

    end 

 

  else    

 

  if aButton then

 

      aButton=false

 

    else

 

      aButton=true

 

    end

 

  end  

 

 

 

  if aButton then

 

    info="ON"

 

  else

 

    info="OFF"

 

  end

 

  engine.fire(Ea.."/"..EZ.."/VARIABLE/alarmButton/SET?VALUE="..tostring(aButton))

 

  engine.fire(Ea.."/"..Ez../Halo remote/Beoremote Halo/SET_TEXT?BUTTON=497f6eca-6276-4993-bfeb-00000081071&TEXT="..tostring(info))

 

  engine.fire(Ea.."/"..EZ.."/Halo remote/Beoremote Halo/SET_TITLE?BUTTON=497f6eca-6276-4993-bfeb-00000081071&TITLE="..tostring(deviceName))  

 

  engine.fire(Ea.."/"..Ez.."/Halo remote/Beoremote Halo/SET_SUBTITLE?BUTTON=497f6eca-6276-4993-bfeb-00000081071&SUBTITLE="..tostring(tst))

 

 

end 

 

CTR wrote:
I don't get the Ea/Ez part for now.... Can you help me out?
I made the programming in general somewhat easier with these lines:
CTR wrote:

  local Ea=event.area()

  local Ez=event.zone()

This way you do not have to set the Area and Zone every time anymore. "Ea" gets the value of the Area which fired the event. Same applies for the Zone, "Ez".

The same I did with button ID and device name. Then you only have to set these local variables. It makes everything much easier..........

I will add in my previous post a "#" in the lines which variables to set.

 

 

Hi talisman,

You too can write to us to support@khimo.com with your BLI serial number and we can give you the new version to test

...
or
BeoWorld Gold Membership card
Join BeoWorld

Register to access the forums, reference material, and exclusive member benefits — including our monthly prize draw.

Become a Member

December 2026 Prize Draw

Gold Members Only

As a Gold member you're automatically entered into our exclusive prize draw — your chance to win iconic Bang & Olufsen products. A unique benefit of BeoWorld Gold membership, every draw brings a new opportunity to win something special.