Bluetooth speaker and mpd integration in HA.
On your host install mpd, edit Mpd configuration in /etc of your host and make this your only output
audio_output {
type"alsa"
name"JBL GO 2"
device"bluealsa:DEV=70:99:1C:D1:0C:EE,PROFILE=a2dp"
}
To have volume control using HA this bellow type above
mixer_type "software"
The 70:99:1C:D1:0C:EE is my own speaker, there you should put yours, you can change the name as well.
Then using bluetoothctl pair and trust and connect to your speaker. Then in /etc edit asound.conf and add this
pcm.mid {
type plug
slave {
pcm {
type bluealsa
device 70:99:1C:D1:0C:EE
profile "a2dp"
}
}
hint {
show on
description "JBL GO 2"
}
}
Again instead of 70:99:1C:D1:0C:EE add your Bluetooth speaker, also you can change the description.
Make a script that will run on startup that will connect to your Bluetooth speaker on every boot.
Make a script that will run mpd on every boot.
In Ha add mpd in your ha config and as host IP of mpd add your HA instance IP (since it’s the same IP as the host you are running it on)
Restart and have mpd player in ha play sound through Bluetooth speaker