How to play a mp3 on CCA?

How to play a mp3 on CCA? I have been trying for pretty long time and also tried the different trix in different posts.

play_song:
    sequence:
      - service: media_player.turn_on
        data:
          entity_id: media_player.chromecastaudio2901
      - service: media_player.volume_set
        data_template:
          entity_id: media_player.chromecastaudio2901
          volume_level: 0.5
      - service: media_player.play_media
        data_template:
          entity_id: media_player.chromecastaudio2901
          media_content_id: http://ip:port/local/mp3/dawn-chorus.mp3
          media_content_type: 'music'

I have also tried:

          media_content_id: http://ip:port/local/mp3/dawn-chorus.mp3
          media_content_id: /local/mp3/dawn-chorus.mp3
          media_content_id: /home/homeassistant/.homeassistant/www/mp3/dawn-chorus.mp3
          media_content_type: 'audio/mp3'
          media_content_type: 'music'

Unless something has changed, and it very well may have, you can’t play a locally stored mp3 file.

When I was building a DIY alarm system I had to upload my file to dropbox then share that file then HA could play the external file.

If you find something has changed and we can now play local files in HA please post the method here.

1 Like