This worked a treat for me! Way better than VLC / Modipy
FYI you need to update your config.json to include this line to get it to work properly:
“arch”: [“armhf”, “armv7”, “aarch64”, “amd64”, “i386”],
This worked a treat for me! Way better than VLC / Modipy
FYI you need to update your config.json to include this line to get it to work properly:
“arch”: [“armhf”, “armv7”, “aarch64”, “amd64”, “i386”],
you are a life saver ! … install of the Addon worked after your suggestion. However I wasn’t able to call the service. I used the below format but its not even allowing me to save it. Under developer tool “call service” area. when i select the service and put the data. it says incorrect json. I also tried in the automation and tried to call this service there but it is not even saving the data portion of the service. What am i doing wrong.
service: hassio.addon_stdin
data:
addon: local_audio_player
input: “http://localhost:8123/local/doorbell.mp3”
Hit and trial and got it to work. Used below json format to call the service .
The only issue now is the audio plays but it cuts off before it completes. For example. say, the audio file is 3 seconds. but it cuts off after 2 sec. does anyone know why its happening?
{
“addon”: “local_audio_player”,
“input”: “http://<local_ip>:8123/local/audio/03-back-door-open.mp3”
}
Hello, i’m working to play local audio file through audio jack in my home assistant running in docker and then i ended up here.
Is this solution still aplicable? Because i tried to install this addons after following steps over here, but no addons shows up. Can you please help me? Thanks.
Hi, I’m also running home assistant/HASSIO in docker. I’ve installed the add on.
I added BestLibre repository to the add-on store and then installed the Mopidy add on from there.
It seems to be running an all, but I don’t see a media player in developer tools to play the audio from. Am I supposed to be seeing media_player.mpd somewhere or is it added separately?
I think you should try to add media_player.mpd in the configuration.yaml
file.
Thanks mate. I suppose that is pretty obvious, thanks for the reply.
So… I’m a pretty big newbie here. I’ve got HA running in Docker on a Raspberry pi, and I have managed to use ESPHome to connect a temperature sensor. Now I am working on some door sensors, and I would like to trigger some audio files locally stored on the Pi when a door is opened. This seemed like just the ticket. I fixed the “arch” issue, but the installation failed with the following error:
20-05-18 20:54:58 ERROR (SyncWorker_8) [supervisor.docker.addon] Can't build local/armv7-addon-audio_player:1.5: COPY failed: stat /var/lib/docker/tmp/docker-builder437573016/run.sh: no such file or directory
I’m not even sure where to start with that error - can anyone point me in the right direction? I thought maybe somehow it was looking in the wrong directory during the installation, so I tried fiddling with the addresses in the docker file, but I had no luck. Any help would be greatly appreciated! Thank you so much!
My original add-on to play local audio files through the Pi’s jack has not been working for a few years which I didn’t mind because our dog goes absolutely mental when he recognizes a doorbell but I finally decided to fix the add-on and try again.
Here it is: Hassio_addons/local_audio_player at master · dingedan/Hassio_addons · GitHub. You can now install it through the repo as well.
I got this working to play local audio by calling the service from an HA script - thank you Daniel - but I am using a USB audio speaker (powered by USB) that has no volume control, and it defaults to max volume.
Can you give me any hints as to how I could adapt it to pass a volume level at which the audio will be played, please? Or even hack in volume level somewhere, as a first step?
(Although I got it working I don’t have much idea how it works, e.g. which command gets run to actually play the audio)
(One of my goals for using this, other than fully local playback so it works when the Internet is down, is to be able to play (e.g. an alarm) at a low volume and repeat it with a higher volume).
Hi Dingle,
I’m currently integrating your solution into my installation. Since I’m completely new to Home Assistant it is important for me to understand what exactly I am doing. I believe I now understand your solution with the exception of two details:
1:
run.sh:
# removing JSON stuff
input="$(echo "$input" | jq --raw-output '.')"
What does this line do?
According to the documentation of the jq command it shouldn’t do anything to the string with the given parameters.
2:
config.json
"audio": true,
and
Dockerfile
RUN apk add --no-cache jq sox alsa-plugins-pulse
According to the HA documentation the “audio” parameter means “Mark this add-on to use internal audio system. We map a working PulseAudio setup into container.”.
According to the SoX documentation Pulse Audio is the default sound driver SoX tries to use.
So why do we need to install alsa-plugins-pulse when home assistant provides Pulse Audio and SoX prefers to use it?
It would be really nice of you to clarify these things so I can avoid doing something I don’t completely understand.
Best Regard
Zebi
As discussed in this thread I forked Dingle’s solution, adapted it to the current Home Assistant version and wrote a bit of documentation.
You can find it here: