LinkPlay Integration

Ok, so it’s not a limitation of the platform.
Thank you very much for the quick answers and especially for your great work!

1 Like

v3.0.0 out

  • Refactored component to be async to improve responsiveness and less hog down the system
  • HA unique identifier based on hardware UUID, see breaking change note below
  • Changed to a different UPnP implementation, this should work also from other subnets
  • Removed the deprecated, unused services

Breaking change: the configured devices will be re-added to HA internal registry database with a new unique identifier tied to the hardware UUID of the Linkplay modules instead of IP address. This will result in having the original entity_id of the preiously configured devices unavailable and having added it as new with entity_id _2 or similar.

This can be easily fixed in Home Assistant, visit your entites list, click the old entity_id and delete it. Then click the newly generated entity_id _2 and name it back to what preiously was. Everything else remains unchanged.

This should be useful when the IP address of the device changes, so the entity id is kept in the future.

4 Likes

Thanks for the new version! It seems to respond much faster.

But I got an issue with double entities.
My linkplay devices are behind smart switches. So they are not available most of the time.

When HA starts it adds the entities according to the yaml configuration. But without the UUID because they are not reachable. When I then turn on the linkplay device HA adds antoher entity (media_player.x_2)

The only thing which currently sovles this is, when I turn on all linkplay devices when I restart HA.

Is there a possibility to set the UUID in the yaml config?

Yes it is, check out in the latest release. Turn on the devices, restart HA, look in device attributes for their UUID, and set it in the config manually (see readme), and then restart HA again.

1 Like

Added support for HA’s built-in media browser. TTS is back from the UI and the new Radio Browser (HA’s original integration) is also working. Can play now media files stored in HA.

Local USB browser disabled for now - have no clue how to combine the two. But I guess few people used it anyway. USB playback is of course still working, it’s just the browsing UI functionality that was removed.

2 Likes

If TTS audio is being cut off at the beginning, this is because the player needs some time to switch to playing out the stream. The only good solution for this is to add a configurable amount of silence at the beginning of the audio stream, I’ve modified Google Translate and VoiceRSS to do this, they can be installed manually as custom components.

Custom integrations that override core integrations are not accepted in HACS, but can can still be installed through it as custom repository.

Hi many thanks for this integration. Really appreciated.

I see indeed that the Media Browser is included. However I don’t see Spotify as a source in the Media Browser for the linkplay device.

This is an example of another chromecast device:

And this is the one from the Linkplay device:

Would it be possible to also add spotify to the Media browser?

Thanks for the headsup. I’ll see what can be done.

1 Like

Not easy to implement for me so don’t expect it any soon.

Is it normal that power button of mini-media-player “does no support this service”??

yes linkplay modules don’t support power on/off

I looked in the official documentation and I see that the manufacturer did not provide such a function at all. It’s a pity because I thought that I would be able to do automatic switching off the amplifier when my wife leaves the house because somehow she never remembers to do it herself :frowning:

I have an automation that turns on/off the amplifier smart plug depending on the status of my Linkplay device.

1 Like

Have you found a solution?

The link doesn’t work from France (“The website is currently inaccessible…
The website has not obtained an ICP filing according to the law of the Ministry of Industry and Information Technology of the People’s Republic of China”)
Is there another one that can be used outside of China? Thx.

I also have a forbidden message:
“Forbidden
You don’t have permission to access this resource.
Apache/2.4.41 (Ubuntu) Server at s000.linkplay.com Port 8020”
Is it the right link?

Added support for Music Assistant:

  • retrieve artist, title, coverart of the current playing media
  • retrieve current playing position of the current playing media
  • support for Previous/Next track in Music Assistant play queue
  • support for announce flag of TTS messages (no need anymore for snapshot and restore services) from HA 2022.06
6 Likes

Hi! I have been using linkplay for maybe 2 years with mini media player card and it have worked really well until 2 months ago.

Now it won’t read the player group and can’t add players to the “master”

This is an error I get

Felet härrör från en anpassad integration.

Logger: custom_components.linkplay.media_player
Source: custom_components/linkplay/media_player.py:412
Integration: Linkplay (documentation, issues)
First occurred: 9 juli 2022 00:57:37 (9329 occurrences)
Last logged: 07:22:33

Failed communicating with LinkPlayDevice (httpapi) 'Vardagsrum': <class 'aiohttp.client_exceptions.ClientConnectorError'>
Failed communicating with LinkPlayDevice (httpapi) 'Köket': <class 'aiohttp.client_exceptions.ClientConnectorError'>
Failed communicating with LinkPlayDevice (httpapi) 'Kontoret': <class 'aiohttp.client_exceptions.ClientConnectorError'>
Failed communicating with LinkPlayDevice (httpapi) 'Tv bänk': <class 'asyncio.exceptions.TimeoutError'>

And this is my card

type: grid
cards:
  - type: custom:mini-media-player
    entity: media_player.tv_bank
    icon: mdi:speaker-wireless
    artwork: cover
    shortcuts:
      columns: 3
      buttons:
        - icon: mdi:sofa
          type: service
          id: spotcast.start
          data:
            spotify_device_id: ********************
            uri: spotify:playlist:37i9dQZF1EMf7p3p04uNyJ
            random_song: true
        - icon: mdi:desk
          type: service
          id: spotcast.start
          data:
            platform: linkplay
            spotify_device_id: ********************
            uri: spotify:playlist:37i9dQZF1EMf7p3p04uNyJ
            random_song: true
        - icon: mdi:dog-side
          type: music
          entity_id: media_player.tv_bank
          id: https://sverigesradio.se/topsy/direkt/164-mp3.pls
    hide:
      volume: false
      source: false
      power: true
    speaker_group:
      platform: linkplay
      show_group_count: true
      entities:
        - entity_id: media_player.koket2
          name: Köket
        - entity_id: media_player.vardagsrum2
          name: Vardagsrum
        - entity_id: media_player.tv_bank
          name: Tv bänk
        - entity_id: media_player.kontoret2
          name: Kontoret
    toggle_power: false
columns: 1
square: false

I have tries Google the error but can’t seem to find anything about it. The speakers are audio pro and like I said, it worked great before

i have the same error… i think is aproblem with Music Assistant

What is your linkplay component version?