Homeassistant will not play local MP3 files

I know there has been posts about this but it did not make me any clever
I have uploaded a simple mp3 file called doorbell-2.mp3

The plan is to have my aqara switch play this sound over my Sonos system.
I testet it could under media .

I know it’s in danish but hopefully you have worked with HA enough to see pass this.

So i am realy hoping some of you have a setup where you reference it, and can tell me the complete code, since i am not a code guy. Thanks

Welcome!

I struggled to get a direct path to work when I first setup a automation with a mp3 play. I figured out the syntax below and have stuck with it since.

The ‘/local/’ path is physically the path of ‘/user/home/homeassistant/www/’, or relative to my Home Assistant directory of ‘www/’

I’m playing to a Sonos device as well.

- alias: Front Door Opened
  trigger:
  - platform: state
    entity_id: binary_sensor.front_door_contact_sensor
    from: 'on'
  action:
    service: media_player.play_media
    data_template:
      media_content_id: http://192.168.1.10:8123/local/sounds/store-door-chime.mp3
      entity_id: media_player.living_room
      media_content_type: music

Good hunting!

1 Like

like @dproffer I used to have a local mp3 played to my Sonos system in the same way he does. But since a few updates that doesnt work anymore.

I ended up with playing the mp3 from my Synology by DLNA to my Sonos system.

My trigger is when somebody pushes one of my Unifi G4 doorbells.