I added the following code in the docker-compose:
homeassistant:
build: /home/docker-compose/homeassistant-custom
restart: always
volumes:
- /dev:/dev
- /tmp/.X11-unix:/tmp/.X11-unix
- ~/.config/pulse/cookie:/root/.config/pulse/cookie
- /run/user/1000/pulse:/run/user/1000/pulse
- /var/run:/var/run
- /run/dbus/:/run/dbus/:rw
- /dev/shm:/dev/shm
environment:
- PULSE_SERVER=/run/user/1000/pulse/native
- PULSE_COOKIE=/root/.config/pulse/cookie
devices:
- /dev/snd:/dev/snd
This code is added on top of your normal docker-compose lines.
Furthermore i created the home-assistant-custom dir and add the
following in dockerfileFROM homeassistant/home-assistant:latest RUN apt-get update && \ apt-get install -y vlc-nox apt-utils alsa-utils nano pulseaudio && \ usermod -a -G audio root && \ usermod -a -G pulse-access root
Now you can get TTS pulse audio from HA, just add a media_player:And use it in a script or automation.media_player: - platform: vlc name: speaker_1 arguments: '--alsa-audio-device=hw:0,0'
(https://www.martinvdm.nl/2018/08/25/pulseaudio-with-homeassistant-and-docker/)
Post a Comment
Post a Comment