I have been able to play sounds through the Rapberri Pi 4 audio output (jack 3,5mm). This is what I did:
-
Add the following repository in Addos: GitHub - Poeschl/Hassio-Addons: The repository for my Home Assistant Supervisor Add-ons.
-
Install MPD addon. Go to Configure and select Output as Bulti-In Audio Stereo:
- Include the following code in your “configuration.yaml”
media_player:
- platform: mpd
host: "the IP of your local host"
-
Run the Addon.
-
Save your MP3 files in the folder /media/
-
Create a Script like the following:
alias: Doorbell
sequence:
- service: media_player.play_media
data:
media_content_id: media-source://media_source/local/doorbell-1.mp3
media_content_type: audio
target:
entity_id: media_player.mpd
mode: restart
Note: The folder /local/ of the script is equivalent to the /media/ folder.