Media source - media not showing

What am I missing?

I have media in the /media folder

image

but nothing shows up in Media Browser.

image

I have media_source: in my config and I have restarted

You need to put the folder one level up, so, its in the same level as addons, backup, config, share and ssl.
Schermafbeelding 2020-09-23 om 11.36.55

1 Like

Perfect.
Thank you.

This might be a stupid follow up question but how do I access these media files to play them on a media player?

This isn’t working

- service: media_player.play_media
  data:
    entity_id: media_player.kitchen
    media_content_id: http://192.168.1.25:8123/media/test.mp3
    media_content_type: music

use the media browser en select your speaker at the top right.

Sorry, yes, but I mean in a script are those media files accessible to a media player? Currently I am using a folder within /local/ but it would be ‘cleaner’ to have those sound files in the media folder too.

3 Likes

hey @klogg
sorry to bump this, but was this final issue resolved for you? Im struggling here:Migrating media files from /config/local to /media and can not make it happen (use a script to acces the files in /media share…

would appreciate if you could have a look… tx!

Hey Marius,

No problem at all, I don’t get tagged often enough for it to be a problem.

No, I never solved this. I’m can’t remember how hard I tried in the end but I gave up :frowning:

I’d be grateful if you’d try and remember to post here if you find a solution!

sure, thanks.

I posted the link above, because in the current #beta on discord tried to solve this, but Frenck mentioned is was only a path thing, but that was as far as it went. No one else responded so, I am really lost, I cant make coffee of the instructions on Media Source - Home Assistant on how to map the share media:

bottom line question how do I get the backend to use

/media/audio/sound_bytes/alarm_clock.mp3

and not use:

/config/local/sounds/sound_bytes/alarm_clock.mp3

where /media and /config are the root shares in my system, as probably on everyone else’s using an OS install

Schermafbeelding 2022-02-24 om 13.33.25

Yes, I’d (still) Like to know too!

I do believe I finally found it. testing in dev tools services made me try:

service: media_player.play_media
target:
  entity_id: media_player.googlehome_library
data:
  media_content_type: music
  media_content_id: media-source://media_source/local/sounds/sound_bites/bike_horn.mp3

and that makes a lot of noise in the library ! :wink:

so given the fact the default media_source is reached at media-source://media_source/local/ the path following that is what is on the root of share media:

where

  sound_bite:
    alias: Sound bite
    mode: restart
    sequence:
      service: media_player.play_media
      data:
        entity_id: >
          {{states('sensor.sound_bite_player')}}
        media_content_id: >
          {{states('sensor.sound_bite')}}
        media_content_type: music

used to point me to /local/sounds/sound_bites/xxx.mp3 (with /local being /config/www ) I now need to change the path in that script to

    sequence:
      service: media_player.play_media
      data:
        entity_id: >
          {{states('sensor.sound_bite_player')}}
        media_content_id: >
          media-source://media_source{{states('sensor.sound_bite')}}
        media_content_type: music

Ill probably adapt the template for sensor.sound_bite, but that doesnt matter for now, the path is clear!

Ill repost this in my own topic, so the answer is clear and in 1 post. (dont want to cross-post, but this is an exception)

1 Like

Excellent. Thanks!

Is this ‘automatic’ because I don’t seem to be able to get this to work…

service: media_player.play_media
target:
  entity_id: media_player.kloggpc
data:
  media_content_type: music
  media_content_id: media-source://media_source/local/sounds/two-tone-chime.mp3

image

Whereas this does work. (Obviously I have the sound clips in both locations temporarily).

service: media_player.play_media
target:
  entity_id: media_player.kloggpc
data:
  media_content_type: music
  media_content_id: http://192.168.1.25:8123/local/sounds/two-tone-chime.mp3

image

tbh, I am not yet very accustomed to this. having said that, I wonder why your working solution doesnt need /config before the local (www) folder.

If you replace http://192.168.1.25:8123 with /config/ , does it work too? that would at least solve that puzzle for me.

what install method do you use? and, what do you have in configuration.yaml?
apparently media: (the share) is supposed to be the default yes. And should be pointing there with the aforementioned string.

if you dont use that (so including the media_source:// bit) it will go and find the /config share and look in the www folder.

At least, thats what I see.

I have nothing else configured, so no extra media_dirs either.

Also, I found the solution experimenting with the dev tools services, (after having tried a few iterations and restarting all the time…)

Ok, so

/config/local/sounds/two-tone-chime.mp3

does not work either :man_shrugging:

My installation is Home Assistant OS and my configuration.yaml is fairly standard:

homeassistant:
  packages: !include_dir_named packages/   

  #=== Included for FileSize sensor
  allowlist_external_dirs:
    - /config

frontend:
  themes: !include_dir_merge_named themes/
  extra_module_url:
    - /hacsfiles/lovelace-card-mod/card-mod.js

default_config:

discovery:

http:
  ip_ban_enabled: true
  login_attempts_threshold: 5

lovelace_gen:

browser_mod:
  devices:
    -- etc--

lovelace:
  mode: yaml
  resources: !include lovelace/resources/resources.yaml

  dashboards:
    -- etc --

I admit I am somewhat confused…

for the record, I am experiencing new issues, but only playing those music files to my browser-mod media_players, and I filed an issue at https://github.com/thomasloven/hass-browser_mod/issues/302

Not sure if BM is creating the issue, it worked before. HA has had several Beta/Dev updates since earlier succes, so I figure something went amiss there.

filed https://github.com/home-assistant/core/issues/67473