Open miikama opened 2 years ago
Thanks @miikama for the detailed message, I was able to add tts_bluetooth thanks to you !
But when testing with the service Text-to-speech (TTS): Say an TTS message with google_translate, no sound is outputting... Is it working for you ?
I can output audio from my BT speaker with the mplayer -ao pulse::bluez_sink command, so the device is behaving correctly on the Debian host
Thanks for the help you already provided and maybe the help you could provide :)
The module seems to use two command line utilities, mplayer
and sox
. Do you also have sox
installed? (I didn't because I skipped some instruction steps).
Which environment are you running the homeassistant on? Is it the docker container, the home assistant operating system on raspberry pi, or the home assistant installed in a python virtual environment? I am running it from a Python virtual environment so it is not containerized. If you are running it in a container, can you also run the mplayer
command inside the container successfully?
And to answer your question @archit3kt , I am actually able to use the TTS to output speech from the speaker :)
I'm running HA in supervised mode on latest Debian 11, to stay in a supported environment !
Indeed the amd64-hassio-audio container, which configure all the audio stuff, wasn't getting the bluetooth conf from the pulseaudio host... I could configure the conf file inside the container to access the bluetooth sink, but the conf would be lost at every reboot.
I went another way and installed mpd on the Debian host, configure it to use the pulseaudio bluez sink on the host, and configure HA in this very simple way :
`media_player:
Now it is workiing like a charm, this page gave me the right instructions to add the BT player on the host, and mpd is doing the rest :)
Thanks for your help, was appreciated !
I'm running HA in supervised mode on latest Debian 11, to stay in a supported environment !
I'm on the same boat, just not as advanced as you. Would you mind detailing how I can set it up?
I can get audio via bluetooth, but not tts.
Hey @elektrinis, I followed this guide until point 5 included, so bluetooth audio was working on the Debian host.
pactl list sinks is listing correctly : bluez_sink.11_75_58_9D_B7_73.a2dp_sink
I installed mpd and configured /etc/mpd.conf with the following :
audio_output { type "pulse" name "My Pulse Output" sink "bluez_sink.11_75_58_9D_B7_73.a2dp_sink" }
Ofc enable and start the service, that's all on the Debian part. Connect to your HA instance and add to configuration.yaml :
media_player:
It will connect the mpd HA object to your mpd server on Debian host. You can then use this mpd object to play audio files in HA.
For TTS, don't forget to configure it in the configuration.yaml :
tts:
or if you like marytts like me and you run the container to get local voice generation on your debian host :
tts:
Should be working after all this :)
Or as the simplest way to output audio to a bluetooth speaker, this is through the Mopidy addon, where we select a bluetooth speaker from the list as an audio output.
in configuration.yaml, we add
#MPD music player daemon
media_player:
- platform: mpd
name: "MPD Mopidy"
host: localhost
port: 6601
for example, audio output via a portable bluetooth speaker using a local rhasspy voice assistant with Silero TTS Service speech synthesis
service: tts.marytts_say
data:
entity_id: media_player.mpd_mopidy
message: >-
15 years later, the life of Jean-Luc, who once plowed the cosmic expanses
Picard
Unfortunately it did not work. Not sure if HASS 2023 or 2024 has more changes, but I still get this:
Platform error media_player.tts_bluetooth_speaker - Integration 'tts_bluetooth_speaker' not found.
Anybody knows where to look?
I have
hass
version2022.3.1
I had some issues when adding the tts_bluetooth_speaker as a custom component. I manually added the component into the configuration.yaml as
After adding, and checking the configuration
The component should be at the correct location
It seems that more recent hass versions require a version key in the custom component
manifest.json
file.See e.g. https://community.home-assistant.io/t/no-version-key-in-the-manifest-file-for-custom-integration-environment-canada/311313/7
Also, the class
MediaPlayerDevice
has been renamed toMediaPlayerEntity
. See https://community.home-assistant.io/t/media-player-not-working-after-upgrading-to-2022-2-6/391841.The
tts_bluetooth_speaker
component can be loaded after updating the filemedia_player.py