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
74k stars 31.05k forks source link

Linkplay multiroom join/unjoin not working correctly for some Arylic devices #130077

Closed manwithpowers closed 2 weeks ago

manwithpowers commented 2 weeks ago

The problem

The new media_player.join or media_player.unjoin functionality for Linkplay devices in the latest version of Home Assistant (2024.11.0) doesn't appear to work with Arylic S10 or Mini devices. From the logs, it appears the IP address isn't being passed along correctly to the httpapi commands:

2024-11-07 19:53:40.256 DEBUG (MainThread) [linkplay] Request command at https://192.168.1.16: ConnectMasterAp:JoinGroupMaster:eth:wifi0.0.0.0
2024-11-07 19:53:40.533 DEBUG (MainThread) [linkplay] Request multiroom:getSlaveList at https://192.168.1.15
2024-11-07 19:53:40.853 DEBUG (MainThread) [linkplay] Response multiroom:getSlaveList: {'slaves': 0, 'wmrm_version': '4.2'}
2024-11-07 19:53:40.854 DEBUG (MainThread) [linkplay] Request multiroom:getSlaveList at https://192.168.1.15
2024-11-07 19:53:41.183 DEBUG (MainThread) [linkplay] Response multiroom:getSlaveList: {'slaves': 0, 'wmrm_version': '4.2'}
2024-11-07 19:53:41.183 DEBUG (MainThread) [linkplay] Request multiroom:getSlaveList at https://192.168.1.16

The correct command in this case would be https://192.168.1.16: ConnectMasterAp:JoinGroupMaster:eth192.168.1.15:wifi0.0.0.0

Similarly for media_player.unjoin:

2024-11-07 20:26:41.596 DEBUG (MainThread) [linkplay] Request command at https://192.168.1.15: multiroom:SlaveKickout:

It should be https://192.168.1.15: multiroom:SlaveKickout:192.168.1.16

I suspect that it's related to this issue in python-linkplay: https://github.com/Velleman/python-linkplay/issues/59

What version of Home Assistant Core has the issue?

core-2024.11.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 2 weeks 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)

silamon commented 2 weeks ago

I'm still looking for more information. The IP address is listed in the player status although it seems that the manufacturers have used different fields. (You have already enabled debug I see, but you removed the player status and only copied the multiroom related parts. )

manwithpowers commented 2 weeks ago

Hi @silamon thanks for the response. I assumed only the multiroom would be relevant, sorry about that. Here is everything in the linkplay debug log when attempting to unjoin:

2024-11-08 16:03:56.608 DEBUG (MainThread) [linkplay] Request command at https://192.168.1.15: multiroom:SlaveKickout:
2024-11-08 16:03:56.883 DEBUG (MainThread) [linkplay] Request getPlayerStatusEx at https://192.168.1.15
2024-11-08 16:03:56.885 DEBUG (MainThread) [linkplay] Request getPlayerStatusEx at https://192.168.1.16
2024-11-08 16:03:56.889 DEBUG (MainThread) [linkplay] Request multiroom:getSlaveList at https://192.168.1.15
2024-11-08 16:03:57.201 DEBUG (MainThread) [linkplay] Response getPlayerStatusEx: {'type': '1', 'ch': '0', 'mode': '99', 'loop': '4', 'eq': '0', 'status': 'stop', 'curpos': '45259', 'offset_pts': '5590', 'totlen': '203373', 'Title': '556E6B6E6F776E', 'Artist': '556E6B6E6F776E', 'Album': '556E6B6E6F776E', 'alarmflag': '0', 'plicount': '0', 'plicurr': '0', 'vol': '65', 'mute': '0'}
2024-11-08 16:03:57.404 DEBUG (MainThread) [linkplay] Response getPlayerStatusEx: {'type': '0', 'ch': '0', 'mode': '31', 'loop': '4', 'eq': '0', 'status': 'stop', 'curpos': '206885', 'offset_pts': '0', 'totlen': '212658', 'Title': '', 'Artist': '', 'Album': '', 'alarmflag': '0', 'plicount': '0', 'plicurr': '0', 'vol': '82', 'mute': '0'}
2024-11-08 16:03:57.420 DEBUG (MainThread) [linkplay] Response multiroom:getSlaveList: {'slaves': 1, 'wmrm_version': '4.2', 'slave_list': [{'name': 'Kitchen Speakers', 'uuid': 'FF31F09E665FB602939FF2C7', 'ip': '192.168.1.16', 'version': '4.2', 'type': 'WiiMu-A31', 'channel': 0, 'volume': 65, 'mute': 0, 'battery_percent': 0, 'battery_charging': 0}]}
2024-11-08 16:03:57.421 DEBUG (MainThread) [linkplay] Request getPlayerStatusEx at https://192.168.1.16
2024-11-08 16:03:57.698 DEBUG (MainThread) [linkplay] Response getPlayerStatusEx: {'type': '1', 'ch': '0', 'mode': '99', 'loop': '4', 'eq': '0', 'status': 'stop', 'curpos': '45259', 'offset_pts': '5590', 'totlen': '203373', 'Title': '556E6B6E6F776E', 'Artist': '556E6B6E6F776E', 'Album': '556E6B6E6F776E', 'alarmflag': '0', 'plicount': '0', 'plicurr': '0', 'vol': '65', 'mute': '0'}
2024-11-08 16:04:06.884 DEBUG (MainThread) [linkplay] Request getPlayerStatusEx at https://192.168.1.15
2024-11-08 16:04:06.887 DEBUG (MainThread) [linkplay] Request getPlayerStatusEx at https://192.168.1.16
2024-11-08 16:04:07.161 DEBUG (MainThread) [linkplay] Response getPlayerStatusEx: {'type': '0', 'ch': '0', 'mode': '31', 'loop': '4', 'eq': '0', 'status': 'stop', 'curpos': '206885', 'offset_pts': '0', 'totlen': '212658', 'Title': '', 'Artist': '', 'Album': '', 'alarmflag': '0', 'plicount': '0', 'plicurr': '0', 'vol': '82', 'mute': '0'}
2024-11-08 16:04:07.190 DEBUG (MainThread) [linkplay] Response getPlayerStatusEx: {'type': '1', 'ch': '0', 'mode': '99', 'loop': '4', 'eq': '0', 'status': 'stop', 'curpos': '45259', 'offset_pts': '5590', 'totlen': '203373', 'Title': '556E6B6E6F776E', 'Artist': '556E6B6E6F776E', 'Album': '556E6B6E6F776E', 'alarmflag': '0', 'plicount': '0', 'plicurr': '0', 'vol': '65', 'mute': '0'}

Let me know if you need any other info

silamon commented 2 weeks ago

Can you provide the getStatusEx or getStatus lines? They should come at first when the integration is loaded.

manwithpowers commented 2 weeks ago

Sure thing:

2024-11-08 17:39:55.443 DEBUG (MainThread) [linkplay] Request getStatusEx at https://192.168.1.16
2024-11-08 17:39:55.451 DEBUG (MainThread) [linkplay] Request getStatusEx at https://192.168.1.15
2024-11-08 17:39:55.729 DEBUG (MainThread) [linkplay] Response getStatusEx: {'uuid': 'FF31F09E665FB602939FF2C7', 'DeviceName': 'Kitchen Speakers', 'GroupName': 'Kitchen Speakers', 'ssid': 'SoundSystem_A00C', 'language': 'en_us', 'firmware': '4.6.415145', 'hardware': 'A31', 'build': 'release', 'project': 'UP2STREAM_MINI_V4', 'priv_prj': 'UP2STREAM_MINI_V4', 'project_build_name': 'a31rakoit', 'Release': '20220427', 'temp_uuid': 'BC87243D5C70A4E2', 'hideSSID': '1', 'SSIDStrategy': '2', 'branch': 'A31_stable_4.6', 'group': '1', 'master_uuid': 'FF31F09E8A4A5A8E231B7668', 'slave_mask': '0', 'wmrm_version': '4.2', 'internet': '1', 'MAC': '00:22:6C:66:A0:0C', 'STA_MAC': '00:22:6C:66:A0:0E', 'CountryCode': 'CN', 'CountryRegion': '1', 'netstat': '2', 'essid': '2120322E34', 'apcli0': '192.168.1.16', 'eth2': '', 'ra0': '10.10.10.254', 'eth_dhcp': '1', 'VersionUpdate': '0', 'NewVer': '0', 'set_dns_enable': '1', 'mcu_ver': '0', 'mcu_ver_new': '0', 'dsp_ver': '0', 'dsp_ver_new': '0', 'date': '2024:11:08', 'time': '16:39:11', 'tz': '1.0000', 'dst_enable': '1', 'region': 'unknown', 'prompt_status': '1', 'iot_ver': '1.0.0', 'upnp_version': '1005', 'cap1': '0x305200', 'capability': '0x28e90b80', 'languages': '0x6', 'streams_all': '0x7bff7ffe', 'streams': '0x7b9831fe', 'external': '0x0', 'plm_support': '0x8004', 'preset_key': '10', 'spotify_active': '0', 'lbc_support': '0', 'privacy_mode': '0', 'WifiChannel': '13', 'RSSI': '-66', 'BSSID': '08:BF:B8:96:FA:68', 'battery': '0', 'battery_percent': '0', 'securemode': '1', 'auth': 'WPAPSKWPA2PSK', 'encry': 'AES', 'upnp_uuid': 'uuid:FF31F09E-665F-B602-939F-F2C7FF31F09E', 'uart_pass_port': '8899', 'communication_port': '8819', 'web_firmware_update_hide': '0', 'ignore_talkstart': '0', 'web_login_result': '-1', 'silenceOTATime': '', 'ignore_silenceOTATime': '1', 'new_tunein_preset_and_alarm': '1', 'iheartradio_new': '1', 'new_iheart_podcast': '1', 'tidal_version': '2.0', 'service_version': '1.0', 'ETH_MAC': '00:00:00:00:00:00', 'security': 'https/2.0', 'security_version': '2.0'}
2024-11-08 17:39:55.766 DEBUG (MainThread) [linkplay] Response getStatusEx: {'uuid': 'FF31F09E8A4A5A8E231B7668', 'DeviceName': 'Living Room Speakers', 'GroupName': 'Living Room Speakers', 'ssid': 'SoundSystem_E82A', 'language': 'en_us', 'firmware': '4.6.415145', 'hardware': 'A31', 'build': 'release', 'project': 'UP2STREAM_PRO_V4', 'priv_prj': 'UP2STREAM_PRO_V4', 'project_build_name': 'a31rakoit', 'Release': '20220427', 'temp_uuid': '93EF084726A9936A', 'hideSSID': '1', 'SSIDStrategy': '2', 'branch': 'A31_stable_4.6', 'group': '0', 'wmrm_version': '4.2', 'internet': '1', 'MAC': '00:22:6C:66:E8:2A', 'STA_MAC': '00:22:6C:66:E8:2C', 'CountryCode': 'CN', 'CountryRegion': '1', 'netstat': '2', 'essid': '2120322E34', 'apcli0': '192.168.1.15', 'eth2': '', 'ra0': '10.10.10.254', 'eth_dhcp': '1', 'VersionUpdate': '0', 'NewVer': '0', 'set_dns_enable': '1', 'mcu_ver': '35', 'mcu_ver_new': '0', 'dsp_ver': '0', 'dsp_ver_new': '0', 'date': '2024:11:08', 'time': '16:39:55', 'tz': '1.0000', 'dst_enable': '1', 'region': 'unknown', 'prompt_status': '1', 'iot_ver': '1.0.0', 'upnp_version': '1005', 'cap1': '0x305200', 'capability': '0x28e90b80', 'languages': '0x6', 'streams_all': '0x7bff7ffe', 'streams': '0x7b9831fe', 'external': '0x0', 'plm_support': '0x8006', 'preset_key': '10', 'spotify_active': '0', 'lbc_support': '0', 'privacy_mode': '0', 'WifiChannel': '13', 'RSSI': '-54', 'BSSID': '08:BF:B8:96:FA:68', 'battery': '0', 'battery_percent': '0', 'securemode': '1', 'auth': 'WPAPSKWPA2PSK', 'encry': 'AES', 'upnp_uuid': 'uuid:FF31F09E-8A4A-5A8E-231B-7668FF31F09E', 'uart_pass_port': '8899', 'communication_port': '8819', 'web_firmware_update_hide': '0', 'ignore_talkstart': '0', 'web_login_result': '-1', 'silenceOTATime': '', 'ignore_silenceOTATime': '1', 'new_tunein_preset_and_alarm': '1', 'iheartradio_new': '1', 'new_iheart_podcast': '1', 'tidal_version': '2.0', 'service_version': '1.0', 'ETH_MAC': '00:00:00:00:00:00', 'security': 'https/2.0', 'security_version': '2.0'}
manwithpowers commented 2 weeks ago

I can confirm that version v0.0.18 of python-linkplay fixes this issue for me. Thanks @silamon

silamon commented 2 weeks ago

Hi, thank you for providing the information and thank you for testing the fix.