I have a set of USB speakers plugged into my RPi running Hassio. Is there a way to run local announcements through these speakers? ie at 8:00 am every morning have the speakers tell me that it is time to get up. I was able to add an automation to make an announcement through my Google Home, but don’t see what entity_id to use for the local device. I also have seen a few examples of running a command to show your ALSA devices but don’t see how I can run this command on the hassio host.
- alias: test
trigger:
platform: time
at: '23:43:00'
action:
service: tts.google_say
entity_id: media_player.master_bedroom_home
data_template:
message: >
the time is eleven forty-three pm
could the google assistant component be used for this ? In BRUH’s video, there is a small speaker connected to the PI and it seems that google assistant can use it to speak.
I was thinking about doing that too, but I didn’t want it to stop whatever is playing on the chromecast. But it is probably the best way to do it right now.
I have switched to hassio but my set-up used VLC for TTS announcements, so I tried your addon and it worked great thanks for making your addon available.
Do you know how to change the output back to the Pi audio jack. It was working fine but now the audio is only coming out of the HDMI output. Can you tell me how to correct this?
I’ve created a local addon to play local audio files. This doesn’t entirely match the question because it won’t be able to play audio from Google Home but I think it’s still on topic.
#!/bin/bash
set -e
echo "starting!"
# Read from STDIN aliases to play file
while read -r input; do
# removing JSON stuff
input="$(echo "$input" | jq --raw-output '.')"
echo "[Info] Read alias: $input"
if ! msg="$(play $input)"; then
echo "[Error] Playing failed -> $msg"
fi
done
You can play local audio files by calling the following service, in this case I’ve just put an mp3 in the www folder of my configuration:
I’ve put them in the config/www folder where you also put the images that need to be available in the webUI. That config/www folder is equal to http://localhost:8123/local/ so you can use subfolders if needed. I don’t know how to set up the addon to also access other files in the config section…
Hey there, thanks so much for this! Been meaning to figure out how to play a locally hosted audio file for awhile, and specifically how to do it over local audio output. This is perfect … EXCEPT I can’t get it to work.
I’ve installed the addon in an “audio_player” folder under /addons/. I’ve installed the local addon and that all seems to be working. When I run your test under services, I get the following error in the log for the addon:
[Info] Read alias: http://localhost:8123/local/chime.mp3
play WARN alsa: can't encode 0-bit Unknown or not applicable
wget: error getting response: Invalid argument
play FAIL formats: can't open input file URL `http://localhost:8123/local/chime.mp3':
[Error] Playing failed ->
The chime file is in the www folder inside config. I’m using duckdns and LetsEncrypt, so not sure if there’s some formatting I need for that. Any ideas?
Are you able to access that chime file through your browser? (replace localhost with the ip address of course)
And does it work when you refer to that ip address from the configuration?