Hey guys. I have a RPi 3 hooked to the Router. To have a transplantable dev and production environment, I use docker to deploy the homeassistant, expose 8123 port. Everything works excellent except TTS service. I cannot play any sound using home assistant. Here’s the detail.
I’m using the embedded sound card, the 3.5mm connector. In Raspbian, I can use vlc to play any .mp3
file to the speaker. I use the devices
flag in docker-compose.yaml
file to mount the sound device to homeassistant container. The docker-compose.yaml
is like:
version: '3'
services:
homeassistant:
image: ${HOMEASSISTANT_IMAGE}
container_name: home-assistant
depends_on:
- mqtt
volumes:
- ./homeassistant/config:/config
devices:
- "/dev/snd:/dev/snd"
ports:
- "8123:8123"
environment:
- TZ=America/New_York
- MQTT_BROKER=${MQTT_BROKER}
hostname: homeassistant
networks:
- HAS
The tts
and mediaplayer
homeassistant confirguration.yaml
file is:
tts:
- platform: google
media_player:
- platform: vlc
After call the tts.google_say
service with message text, nothing comes out from the speaker.
Trouble shooting:
-
In the
config/tts
folder I found files like1160265318cfc57fc39224f36ff68a13a652492e_en_-_google.mp3
which means the sound file has been fetched from google API. -
Such event is logged, in which the mp3 url is a valid one and can be accessed by any device in the world(also in the LAN, by this vlc server in homeassistant docker container).
Bus:Handling <Event call_service[L]: domain=media_player, service=play_media,
service_data=media_content_id=http://xxx.xxx.xxx/api/tts_proxy/0448240fad25c776cd56bf074912c7
eaa2b79bf2_en_-_google.mp3, media_content_type=music, service_call_id=1968414384-14>
- The user that runs docker deamon in hose is root, and the user that runs homeassistant in container is also root. So they all should have enough privilege to play sound.
Does anyone has idea bout it? Thanks.