Playing Sounds/Music on a Linux Laptop

I want to set up such automation in HA. If the Button is pressed, then on a laptop with linux (I only have firefox for logging in HA via www) play a sound from the Media library in HA.

What tools should I use now?
I am trying with LNXlink + MQTT_Media_Player + HASC but it does not work for me

I am the developer of LNXlink and I saw your question and I’ve made some changes to the media module which should allow you play any media.

You can try it out without waiting for the next release with this configuration in LNXlink:

exclude:
- media
custom_modules:
- https://raw.githubusercontent.com/bkbilly/lnxlink/refs/heads/master/lnxlink/modules/media.py

To play a media from the Media Library of Home Assistant you can try this example:

action: media_player.play_media
target:
  entity_id: media_player.desktop_linux
data:
  media_content_id: media-source://radio_browser/d1a54d2e-623e-4970-ab11-35f7b56c5ec3
  media_content_type: audio

Hope this helps!

Thank you for the information. I will test it.
Please help me. In your guide on GitHub there is Example MQTT configuration and file location homeassistant/media_player/myplayer/config
I don’t have this location, create it manually?
Is it supposed to look like
homeassistant/media_player/myplayer/config.yaml
homeassistant/media_player/myplayer/config/configuration.yaml

Thank you in advance

This path is on the MQTT server and you don’t have to do anything on that. This is how the LNXlink communicates with the media_player.

All you need is to install the MQTT Media Player addon and then look for the LNXlink and then go to Devices and add the new integration.
It will ask you for a name which can be found under the logs. This should look like this: lnxlink/DESKTOP-Linux_media_player

You can find more information how to set it up here: Media Player | LNXlink

EDIT: Keep in mind that by default the media addon is not active, so you will have to edit your yaml configuration to remove it from the exclude list.

1 Like

Can you explain it to me more because I don’t understand.
where is this configuration?
what should it look like?

bkbillyVasilis Koulis

you are great
IT WORKS
IT WORKS
IT WORKS

:slight_smile: :slight_smile:

1 Like