Play song from media folder on all Google Home Devices

Hi I am new to town and not really into it. Hope you can help me out:

I want to make google assistant play a specific music file locatet on my pi when I get home. Any advice how to get there?

Tried to trigger an event:

entity_id: media_player.home_assistants
service: media_player.play_media
data:
  media_content_type: music
  media_content_id: "192.168.0.120\media\song.mp3"

but this failed.
Thanks in advance for any hint!

first check if you have a folder called www. if not just create one. then put the mp3 there or in a subfolder. and then the path should start with /local/mp3.mp3 or if you made a subfolder /local/subfolder/mp3.mp3

then create a script like this one. you can copy and paste it, just change according to your setup. and then you can make a automation. let me know if you need help with the automation

alias: mp3
sequence:
  - service: media_player.play_media
    data:
      media_content_id: 'https://*******.duckdns.org:8123/local/sounds/welcome.mp3'
      media_content_type: music
    target:
      device_id: 1380171f542aae627bed17e4c0075f56
mode: single
icon: 'hass:music'

Do I have to call it via " https://*******.duckdns.org" even when the music is stored locally on the raspi?

If you don’t have remote access, just put your ip and port just like you did, but finish it of with the port

did you manage it?>

Nope :confused: tried it via a service too but that did not work either:

Judging by your UI, you’re on HA latest version, so you can do it through the media integration which is enabled by default.

On your local integration, you’ll have a path like this: \\192.168.0.120\media, drop the .mp3 file there and then add the data below to your automation:

service: media_player.play_media
data:
  media_content_id: 'media-source://media_source/local/welcome.mp3'
  media_content_type: music
target:
  device_id: 1380171f542aae627bed17e4c0075f56

Here’s an example on my instance:

3 Likes

wohoo! that worked for me :slight_smile:
Thanks a lot for your help guys!!

1 Like

This works great in my automation. Thanks @carlos.vroque

  action:
  - service: media_player.play_media
    data:
      entity_id: media_player.home_group
      media_content_id: 'media-source://media_source/local/Napalm_Death_You_Suffer.mp3'
      media_content_type: music
1 Like