The goal of this tutorial is to pair arbitrary bluetooth speaker with the Home Assistant (HASSO) to be able to hear notifications & Text-To-Speach (TTS)
Proxmox server
- BT dongle (Broadcom - BCM20702A0); A list of supported BT dongles -> https://www.home-assistant.io/integrations/bluetooth#known-working-high-performance-adapters
- Home Assistant (Supervisioned version) (for this tutorial Home Assistant 2023.6.3 -> Supervisor 2023.06.4 -> Operating System 10.3 were used)
- any bluetooth speaker without auto-inactivity or/and auto-shutdown function. I've used Xiaomi Mi Compact Bluetooth Speaker 2 (XMYX02YM)
- Identify your BT speaker's BT MAC Address & BT Name
- Make sure that Proxmox’s HomeAssistant VM has an Audio device added (for example:
device=intel-hda, driver=none
) - Install SSH add-on into the HA and configure it
- Logging into the HA using terminal: login@IP_Address
- Switch off your BT speaker
- Type:
bluetoothctl
- Type:
list
to list all of your connected BT dongles. You should get the MAC addresses of all your BT dongles - Type:
select MAC_ADRESS_DONGLE
to select your main one dongle (for example: select 55:44:33:22:11:00) - Type:
default-agent
to make selected BT-dongle a default connector with your BT devices - Let's start connection & paring with your BT-speaker.
- Type:
scan on
- Turn on your BT speaker & set it to paring mode
- Check the console to see if your BT speaker has been detected (look for its name or MAC address). NOTE: Be patient during this process. If the speaker does not appear, try putting it back into pairing mode and checking again.
- Type:
pair MAC_ADRESS
(for example: pair 00:11:22:33:44:55) - Type:
trust MAC_ADRESS
(for example: trust 00:11:22:33:44:55) - Type:
connect MAC_ADRESS
(for example: connect 00:11:22:33:44:55) - (in the case of any problems type
help
for more info) - Check the connected devices using commands:
pactl list | grep ".a2dp_sink"
. Look for something similar to Name:bluez_sink.4C_72_74_XX_XX_XX.a2dp_sink
(NOTE: the number represents the MAC address of your BT speaker) - Set the newly connected BT device as the default sound output by using following command:
pactl set-default-sink NAME_OF_YOUR_BT_SPEAKER_FIND_IN_THE_PREV_STEP
- Check whether the output-audio is not muted, nor volume set to zero, by
Mute:
(should beno
) andVolume:
, should befront-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
by using following commend:pactl list sinks | grep "Mute:"
andpactl list sinks | grep "Volume:"
- Type
ha audio reload
and wait forCommand completed successfully
message on the terminal - At this point your BT should be connected to your HA
- Type:
exit
- Goto HA and install Settings -> Add-in VLC Local
- Goto VLC Local -> Configuration
- Set the Telnet Password and Http Password (you can use the default mypasswrd as well)
- Change the Audio-Output to the corresponding BT Name (it's the same obtained at I.1 point)
- Go back to VLC-Local Info tab and enable Auto-Start option
- Get back to Info tab hit Start
- Go to HA Settings -> Devices & Services (Integrations) and Add New Integration
- Search for VLC LAN select it and pick-up Local VLC Media player via Telnet
- Enter the password Telnet Password and click Submit
- NOTE: in case when VM with HA restarts & or BT device shutdowns power on the dev (XMYX02YM should say "Connected" after a few seconds) and go to section I.12 and II.4 points, and start VLC Local back again
- Go to Developers Tools and Services and enter followings :
- Service or Actions :
Media player: Play media
- Target: Search for
VLC
and select your one - Content type:
music
- Content ID:
/local/your.mp3
(files your.mp3 should be located at the/local/www/
folder of your HA installation) - Press Call-Service or Perform the action
- Go to Developers Tools and go to Actions or Services and enter followings :
- Service or Actions: type
TTS
and select one of your favourite (or default) one Text-To-Speach (for the porpouse of this tutoral I used gogole with google translate