home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

2024.8.0: Linkplay services issues #123372

Closed pergolafabio closed 1 week ago

pergolafabio commented 1 month ago

The problem

Hey, before i was using the custom linkplay integration, now tested the new linkplay core, my device A50 is well discoreved But before i used service to play presets, like below example, how does that work now? cant find any documentation on it?

                  action: call-service
                  service: linkplay.preset
                  service_data:
                    entity_id: media_player.luidspreker_buiten
                    preset: 1

Also i had some service like below:

                  action: call-service
                  service: media_player.play_media
                  service_data:
                    entity_id: media_player.luidspreker_buiten
                    media_content_id: 'http://opml.radiotime.com/Tune.ashx?id=s10861'
                    media_content_type: url

but gives me now error like below?

2024-08-08 15:11:47.384 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140708776533376] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 168, in async_resolve_media
    item = _get_media_item(hass, media_content_id, target_media_player)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 111, in _get_media_item
    item = MediaSourceItem.from_uri(hass, media_content_id, target_media_player)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_source/models.py", line 97, in from_uri
    raise ValueError("Invalid media source URI")
ValueError: Invalid media source URI

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 115, in _wrap
    return await func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 225, in async_play_media
    media = await media_source.async_resolve_media(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/media_source/__init__.py", line 170, in async_resolve_media
    raise Unresolvable(str(err)) from err
homeassistant.components.media_source.error.Unresolvable: Invalid media source URI

What version of Home Assistant Core has the issue?

core-2024.8.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Linkplay

Link to integration documentation on our website

https://www.home-assistant.io/integrations/linkplay/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @velleman, mind taking a look at this issue as it has been labeled with an integration (linkplay) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `linkplay` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign linkplay` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


linkplay documentation linkplay source (message by IssueLinks)

pergolafabio commented 1 month ago

also tried some basic commands now, this works on my google hub:

action: media_player.play_media
target:
  entity_id: media_player.google_hub
data:
  media_content_type: playlist
  media_content_id: 'https://icecast.vrtcdn.be/mnm-high.mp3'

and the same on my linkplay device:

action: media_player.play_media
target:
  entity_id: media_player.luidspreker_buiten
data:
  media_content_type: playlist
  media_content_id: 'https://icecast.vrtcdn.be/mnm-high.mp3'

gives me:

Failed to perform the action media_player.play_media. Invalid media source URI

also tried like content_type : music ...

nagyrobi commented 1 month ago

These are pretty usual HA services...

Apparently the linkplay integration in HA core is a very, very basic one. Many standard features of the Linkplay chipset don't seem to be implemented.

nagyrobi commented 1 month ago

@dukeofphilberg

dukeofphilberg commented 1 month ago

We've purposely started with a very small implementation to ensure that we hit the ground running. It was never the plan to have feature compatibility with the existing custom component from the start, but it'll get there 😉 .

pergolafabio commented 1 month ago

offcourse, it takes time! :-)

but at this moment, what can we do it with? is it even possible to send a meda/stream to it?

mirisbowring commented 2 weeks ago

It's not even possible to skip s song 😅

manwithpowers commented 2 weeks ago

It's also not possible to join/group devices together, which makes the new implementation unusable for me, unfortunately. (I get Action linkplay.join not found when trying). Rolling back to the custom component but would love to see this in the built in one down the line!

jumate commented 1 week ago

We are looking forward to new features such as song skip or track info. Thanks.

b00tsie commented 1 week ago

The native integration is, imho, pretty useless if you are custom to linkplay functionality. And that with the big remark the hacs integration of linkplay was unsupported notice in 2024.8.x ... joining doesn't work, selecting a preset doesn't work. For now i head back to the hacs integration...

nagyrobi commented 1 week ago

It's also not possible to join/group devices together, which makes the new implementation unusable for me, unfortunately. (I get Action linkplay.join not found when trying). Rolling back to the custom component but would love to see this in the built in one down the line!

Afaik multiroom has been standardised in HA so there are no more sonos.join linkplay.join etc. They are all just media_player.join universally (of course working only within the same compatible devices). The custom component used to support that too, but apparently this is also someting the HA devs decided not to implement.

b00tsie commented 1 week ago

It's also not possible to join/group devices together, which makes the new implementation unusable for me, unfortunately. (I get Action linkplay.join not found when trying). Rolling back to the custom component but would love to see this in the built in one down the line!

Afaik multiroom has been standardised in HA so there are no more sonos.join linkplay.join etc. They are all just media_player.join universally (of course working only within the same compatible devices). The custom component used to support that too, but apparently this is also someting the HA devs decided not to implement.

I just referred all my players back to the hacs integration and wait for the real link functionality in the core to migrate ( once again ) 🥵

silamon commented 1 week ago

I've opened:

Both are in draft since I haven't tested them yet. I can test in the coming days. Having these 2 merged will solve your issue.

pergolafabio commented 1 week ago

Thats nice!! But dont you need python-linkplay to 0.0.9 for the preset to work?

silamon commented 1 week ago

It was merged in yesterday, when https support was added.

pergolafabio commented 1 week ago

perfect, i will try to test the drafts soon, thnx for keeping us updated!!

pergolafabio commented 1 week ago

hi @joostlek , dont close yet, there is still one PR needed:

https://github.com/home-assistant/core/pull/125204

silamon commented 1 week ago

It just needs the docs added and it will be merged, so this one is solved anyway soonish.

pergolafabio commented 1 week ago

Perfect, looking forward to it

pergolafabio commented 4 days ago

tested the play media, working great, thnx for this now waiting for the preset one :-)

silamon commented 4 days ago

It will be for the october release I assume since it's a new feature.