BeoLink (Bang & Olufsen)

Software version 2.3.4 is being rolled out (phased over 7 days) to Mozart speakers.
This means that I can now share this:

This custom component can be used with:

  • Beosound Balance
  • Beosound Level
  • Beosound Emerge
  • Beosound Theatre (audio only for now)
  • Beolab 28

Add this repository to HACS to install the Bang & Olufsen-component.

For those interested, there is also API documentation available here: Mozart platform API

2 Likes

his is really amazing work! And with the B&O releasing the open API and this component for Home Assistant is mind blowing! I’m really impressed with B&Os commitment to the longevity of their products.

Not to sound ungrateful, but I don’t suppose there’s a chance of them expanding this component to also cover the old “BeoPlay” platform? :slightly_smiling_face:

Hi guys. Im brand new to the HA world, and Im wondering if any of you got Beremote Halo to work? I have tried to install this: GitHub - bang-olufsen/beoremote-halo: Beoremote Halo Open API through HACS but with no luck.
Really want the Halo to work. Any ideas?

I’ve made an automation that announces which other product in the home I’m joining, when making a long press on the Play/Pause button. It’s using the built-in Overlay TTS function in the Mozart speaker, so it does not stop what’s playing, it just lowers the volume and plays the announcement on top.

Here is a very short demo: Join announcement - YouTube

alias: "Long press on Mozart speakers "
description: Tells which room is joined
trigger:
### If long press on Play/pause on Beosound Level
  - platform: device
    device_id: b95e76a87142de088e4466c8a8e6f585
    domain: bangolufsen
    type: PlayPause_longPress
    id: level_join
### If long press on Play/pause on Beosound Emerge    
  - platform: device
    device_id: ce3c4cf11bc51e0bc34f52ee2c988743
    domain: bangolufsen
    type: PlayPause_longPress
    id: emerge_join

condition: []

action:
  - choose:
### If long press on Play/pause on Beosound Level  
      - conditions:
          - condition: trigger
            id: level_join
        sequence:
          ### Only speak if there is something to join        
          - wait_template: >-
              {{state_attr("media_player.beosound_level","beolink").leader is defined}}
            continue_on_timeout: false
            timeout: "2"
          - delay: 
              milliseconds: 700
          ### Say which prodict has been joined. It will use the Friendly name of the product            
          - service: bangolufsen.overlay_audio
            data:
              volume_offset: 20
              tts: >-
                Joined {{(state_attr("media_player.beosound_level","beolink").leader | list).0}}
              tts_language: en-us
            target:
              entity_id: media_player.beosound_level
              
### If long press on Play/pause on Beosound Emerge              
      - conditions:
          - condition: trigger
            id: emerge_join
        sequence:
          ### Only speak if there is something to join
          - wait_template: >-
              {{state_attr("media_player.beosound_emerge","beolink").leader is defined}}
            continue_on_timeout: false
            timeout: "2"
          - delay: 
              milliseconds: 700
          ### Say which prodict has been joined. It will use the Friendly name of the product
          - service: bangolufsen.overlay_audio
            data:
              volume_offset: 20
              tts: >-
                Joined {{(state_attr("media_player.beosound_emerge","beolink").leader | list).0}}
              tts_language: en-us
            target:
              entity_id: media_player.beosound_emerge
mode: single

I’ve been using my own Nodered flow since the launch of CI features on Halo, and it’s working perfect for me.

Here is my sample flow: Pastiebin.com 626c3976a94e8
Go in anc change the websocket in and out to be ws://:8080 and press the ‘send configuration manully’ button, you should be able to swipe up on your halo and see 4 buttons.

It gives me an error: " This node is a type unknown to your installation of Node-RED. Also getting an error about “Encrypted credentials not found”

It’s between change 3 rules and switch and just says unknown string.

Hmm weird. Are you using the HA Nodered add-on? As far as I know all the needed “modules” are installed by default when using the add-on (websocket in/out, delay node, etc.).

I did a restart and now I can see the buttons. That is awesome. So just a newbie question. If I want to control the lights in my “Stue” which is my living room. The only thing I need to change is the state_changed: and pick the light? Do I also need to change the HA server? I can see now that it says CK Home Assistant.

Basically, all the fields where there is a comment next to, you should change to fit your system. So yes, it should connect to YOUR HA server. And in regards to the light, you need to insert your light entity in 2 places, as shown on this image.

Got it to work! This is great. Last question. If I want to add more rooms to the setup when it comes to lights. Can I just duplicate HALO LIGHT?

Yes, you can.
You have probably seen the function node that says PRIMARY. That is the configuration that lets Halo know what you have. So in there you need to add another light too, and give it a unique id (just change some characters in the end or something). Otherwise the button never shows up:)

Then take that new unique id and put into the Light subflow node that you duplicated. This will ensure that all updates are sent to the new button you just created.

You can have up to 8 buttons in one row, and up to 3 rows.

1 Like

Great! You have saved the day.

1 Like
1 Like

Any hints what‘s missing here?
Would like to use it in automations and select a source like Spotify or Radio.

If you just want to start local Spotify you can also use:
POST http://<speaker_ip>:8080/BeoZone/Zone/ActiveSourceType

{
    "sourceType": {
        "type": "SPOTIFY"
    }
}

or

{
    "sourceType": {
    "type": "BEO RADIO"
    }
}

(given that you made the switch to B&O radio on your M5)

1 Like

Thanks for the hint regarding ActiveSourceType. I hoped I could do it with this HA beoplay integration but your solution works as smooth.

btw, is there any complete documentation about the BeoZone API? For example, I can’t find any information about “/BeoZone/Zone/ActiveSourceType”.

I made this for my own use.

1 Like

This is brilliant! Helps a lot! Thanks again

Found an error:
In the “Set active source - by source id” section, the URL says: http://192.168.40.7:8080/BeoZone/Zone/ActiveSourceType

Should be http://192.168.40.7:8080/BeoZone/Zone/ActiveSources instead

EDIT: Should be fixed now

1 Like

Hi CMDK, first of all thank you very much for your wonderful work… Last week I’ve added a Beosound Balance with no problem but today I tried to add the couple of Beolab 28 and got this:

Logger: homeassistant.config_entries
Source: custom_components/bangolufsen/select.py:127 
Integration: Bang & Olufsen (documentation, issues) 
First occurred: 11:15:14 (6 occurrences) 
Last logged: 13:36:31

Error setting up entry Beolab 28 for bangolufsen
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 372, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/bangolufsen/__init__.py", line 67, in async_setup_entry
    if not await init_entities(hass, entry):
  File "/config/custom_components/bangolufsen/__init__.py", line 163, in init_entities
    selects.append(BangOlufsenSelectSoundMode(entry))
  File "/config/custom_components/bangolufsen/select.py", line 88, in __init__
    self._initial_setup()
  File "/config/custom_components/bangolufsen/select.py", line 101, in _initial_setup
    self._attr_current_option = self._get_sound_mode_name(active_sound_mode.id)
  File "/config/custom_components/bangolufsen/select.py", line 127, in _get_sound_mode_name
    return [x for x in self._sound_modes if self._sound_modes[x] == sound_mode_id][
IndexError: list index out of range

Where am I doing wrong?
Thank you very much!!!