Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant config Linkplay with my Edifier MA3 #135488

Closed
VergilGao opened this issue Jan 13, 2025 · 7 comments · Fixed by #136272
Closed

Cant config Linkplay with my Edifier MA3 #135488

VergilGao opened this issue Jan 13, 2025 · 7 comments · Fixed by #136272

Comments

@VergilGao
Copy link

The problem

This is a strange device because there is no mac field in its linkplay description file.
According to the log, I think this is the main reason why he failed to configure successfully

What version of Home Assistant Core has the issue?

core-2025.1.2

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

config_entry-linkplay-01JHCYDR4NSA08JGD155KT360K.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2025-01-12 17:45:59.334 ERROR (MainThread) [homeassistant.components.button] Error while setting up linkplay platform for button
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 374, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 641, in async_add_entities
    for entity in new_entities:
                  ^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/button.py", line 59, in <genexpr>
    LinkPlayButton(config_entry.runtime_data.bridge, description)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/button.py", line 75, in __init__
    super().__init__(bridge)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/entity.py", line 49, in __init__
    connections={(dr.CONNECTION_NETWORK_MAC, bridge.device.properties["MAC"])},
                                             ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'MAC'
2025-01-12 17:45:59.343 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up linkplay platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 143, in async_setup_entry
    async_add_entities([LinkPlayMediaPlayerEntity(entry.runtime_data.bridge)])
                        ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/media_player.py", line 157, in __init__
    super().__init__(bridge)
    ~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/linkplay/entity.py", line 49, in __init__
    connections={(dr.CONNECTION_NETWORK_MAC, bridge.device.properties["MAC"])},
                                             ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'MAC'


### Additional information

_No response_
@home-assistant
Copy link

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)

@benbender
Copy link

@VergilGao Just tried to look up the "Edifier MA3", but couldn't find them. There is a model named "Edifier MR3", but this one doesn't have wifi and is therefor definitely not Linkplay-compatible as Linkplay is DLNA-based and only works via TCP/IP. Afaik, the only Speakers by Edifier supporting Linkplay are the MS50-A and the S1000-W. Imho this issue might be therefor invalid. If I'm missing smth, please correct me!

@VergilGao
Copy link
Author

@VergilGao Just tried to look up the "Edifier MA3", but couldn't find them. There is a model named "Edifier MR3", but this one doesn't have wifi and is therefor definitely not Linkplay-compatible as Linkplay is DLNA-based and only works via TCP/IP. Afaik, the only Speakers by Edifier supporting Linkplay are the MS50-A and the S1000-W. Imho this issue might be therefor invalid. If I'm missing smth, please correct me!

This is a co-branded device that was exclusively sold in China about 7 years ago. The co-branded brand has been shut down. I found that it has the same web configuration page as other LinkPlay devices, so I started trying to control it using the LinkPlay protocol.

@silamon
Copy link
Contributor

silamon commented Jan 22, 2025

I've added a PR to close this one, it is appreciated if you could test. Since the integration exists, a broad range of devices from different brands seems to support this LinkPlay protocol, but it's pretty unclear in how they follow what is publicly available in documentation. That means, that it may be possible that your device still gives an error somewhere further in the code.

@VergilGao
Copy link
Author

VergilGao commented Jan 23, 2025

@silamon I'm actually trying to modify the code to adapt to this device, and besides not having a mac address, some of its APIs can't return a valid json string correctly.

like this Velleman/python-linkplay#68 (comment)

If you want to adapt to this situation, you can only modify the code of the upstream python-linkplay repository.
Because this is a relatively old device and its firmware maintenance has been completely stopped. I think writing a custom integration for him alone is a more advantageous option.
I decided to use my free time this year to complete this work.
This device is currently circulating in the second-hand market in China. It seems that the debts caused by the operator's bankruptcy have been settled, and this part of the equipment is used to offset the debts, so merchants specializing in second-hand equipment transactions have begun to ship large quantities.The price is about 10 US dollars

@silamon
Copy link
Contributor

silamon commented Jan 23, 2025

If you want to solve that issue you've linked, your device may also work with the core integration. As I said, I'm accepting contributions in that library if somebody implementing the uPnP alternatives for getPlayerStatus.

@heinzma
Copy link

heinzma commented Jan 23, 2025

@VergilGao It might be possible to update your device with a newer firmware: https://forum.arylic.com/t/question-about-non-arylic-product/617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants