Solved:How can play local mp3 with vlc_telnet?

The vlc_telnet can play music on website:

service: media_player.play_media
target:
  entity_id: media_player.vlc_telnet
data:
  media_content_type: music
  media_content_id: "http://www.soundjay.com/nature/sounds/rain-07.mp3"

I set local mp3 file in media_content_id as below:

service: media_player.play_media
target:
  entity_id: media_player.vlc_telnet
data:
  media_content_type: music
  media_content_id: "/home/homeassistant/.homeassistant/media/test.mp3"

How can play local mp3 with vlc_telnet?

media_content_id: "/home/homeassistant/.homeassistant/media/test.mp3"

Try

media_content_id: "/local/media/test.mp3"

or perhaps

media_content_id: "/media/test.mp3"

None of them!Solved it this way:

sudo apt install apache2
sudo cp test.mp3  /var/www/html

Fix the configuration.yaml

service: media_player.play_media
target:
  entity_id: media_player.vlc_telnet
data:
  media_content_type: music
  media_content_id: http://127.0.0.1/test.mp3

Is there another way to play local music file without installing web server(apache or nginx) ?

Yes I told you how.

It can’t work!The local point to /home/homeassistant/.homeassistant/media in configuration.yaml:

homeassistant:
  media_dirs:
    local: /home/homeassistant/.homeassistant/media

No matter what i write ,it can’t work!

media_content_id: "/local/test.mp3"
media_content_id: "local/test.mp3"
media_content_id: "/media/test.mp3"
media_content_id: "/local/media/test.mp3"
media_content_id: http://127.0.0.1:8123/media-browser/media_player.vlc_telnet/app%2Cmedia-source%3A%2F%2Fmedia_source/test.mp3

None of them can work!Had you made experiments in your homeassistant?

How did you install Home Assistant, which method?

Version core-2023.7.3
Installation Type Home Assistant Core
Development false
Supervisor false
Docker false
User homeassistant
Virtual Environment true
Python Version 3.11.0rc2
Operating System Family Linux
Operating System Version 5.10.0-23-amd64
CPU Architecture x86_64
Timezone Asia/Shanghai
Configuration Directory /home/homeassistant/.homeassistant

Home Assistant Cloud

MANAGE

Logged In false
Reach Certificate Server ok
Reach Authentication Server ok
Reach Home Assistant Cloud ok

Dashboards

MANAGE

Dashboards 1
Resources 0
Mode auto-gen

Recorder

Oldest Run Start Time 17 August 2023 at 05:17
Current Run Start Time 20 August 2023 at 13:15
Estimated Database Size (MiB) 2.87 MiB
Database Engine sqlite
Database Version 3.34.1

Home assistant has a web browser, so an alternative way is to put it in config/www and access it via http://127.0.0.1/local/test.mp3

sudo systemctl stop apache2
sudo systemctl restart home-assistant  #I set the service name as home-assistant.

Had a try in my homeassistant,it can’t get access it via http://127.0.0.1/local/test.mp3.

And where is test.mp3 when you tried?