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