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

Slimproto integration does not discover/add Squeezebox Boom #74265

Closed meichthys closed 2 years ago

meichthys commented 2 years ago

The problem

I'm trying to migrate from Logitech Media Server to Slimproto to reduce the need for an additional addon. When enabling the Slimproto integration, it is setup immediately indicating it was successful, however the device is not added. A few notes that may be helpful:

When restarting Home Assistant i do see the logs i've included below.

What version of Home Assistant Core has the issue?

2022.6.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

slimproto

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: aioslimproto.discovery
Source: /usr/local/lib/python3.9/site-packages/aioslimproto/discovery.py:210
First occurred: 1:05:26 PM (1 occurrences)
Last logged: 1:05:26 PM

'utf-8' codec can't decode byte 0xa7 in position 16: invalid start byte
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aioslimproto/discovery.py", line 202, in datagram_received
    data = data.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa7 in position 16: invalid start byte

and...

Logger: homeassistant.components.media_player
Source: components/slimproto/media_player.py:104
Integration: Media player (documentation, issues)
First occurred: 1:05:29 PM (1 occurrences)
Last logged: 1:05:29 PM

Error while setting up slimproto platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/slimproto/media_player.py", line 71, in async_setup_entry
    await asyncio.gather(*(async_add_player(player) for player in slimserver.players))
  File "/usr/src/homeassistant/homeassistant/components/slimproto/media_player.py", line 55, in async_add_player
    async_add_entities([SlimProtoPlayer(slimserver, player)])
  File "/usr/src/homeassistant/homeassistant/components/slimproto/media_player.py", line 104, in __init__
    if "-pCP" in self.player.firmware or self.player.device_model == "SqueezeESP32":
TypeError: argument of type 'NoneType' is not iterable


### Additional information

_No response_
probot-home-assistant[bot] commented 2 years ago

slimproto documentation slimproto source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

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

marcelveldt commented 2 years ago

Do you have a name set on the Boom ? Can you please try to remove any "special" characters from that name as a test

meichthys commented 2 years ago

To add to this, i've also noticed that even aver re-booting, Home Assistant is 'discovering' a Logitech Media Server (with the ip of HA) which doesn't exist (I've confirmed the container is not running in HomeAssistant or otherwise on my network): image

meichthys commented 2 years ago

Do you have a name set on the Boom ? Can you please try to remove any "special" characters from that name as a test

I did a factory reset, so i don't think so, but I'll double check later.

meichthys commented 2 years ago

To follow up on this, it looks like the name is just: squeezebox

frankiboy1 commented 2 years ago

I'm experiencing a similar problem when trying to connect a squeezebox boom. I've tried multiple different methods, factory resetting between each try.

  1. Running LMS on the same network: The player connects to LMS
  2. Not running LMS: No squeezebox server found
  3. Manually setting IP address (to the Home assistant IP): The player is stuck displaying "connecting" on the display

I have also tried to connect to mysqueezebox.com to see if that make any difference, but I'm still unable to connect to slimproto.

I have a hifiberry connected to slimproto, but I expect slimproto can handle multiple devices?

marcelveldt commented 2 years ago

Yes, it can handle multiple devices but I have never tried it with a SB Boom. I will put a few guard in the code and provide a new version soon.

frankiboy1 commented 2 years ago

I installed squeezelite on my laptop, just to make sure that it's not an issue with my install of slimproto. The squeezelite player appears immediately as a slimproto device, so everything except SB Boom seems to work properly.

marcelveldt commented 2 years ago

OK thanks for that test, good to know.

meichthys commented 2 years ago

Also, my squeezebox boom is on firmware version 54. I'm not sure if there's a newer than that or not but I thought I would throw that out there for reference.

frankiboy1 commented 2 years ago

Mine is running FW version 57, which I believe is the latest.

frankiboy1 commented 2 years ago
Screenshot 2022-07-02 at 19 18 00

Not sure if this is helpful, but the only activity I can see from SB Boom is discover requests that are broadcasted. Slimproto does not reply to the requests.

HomeBro commented 2 years ago

To add to this, i've also noticed that even aver re-booting, Home Assistant is 'discovering' a Logitech Media Server (with the ip of HA) which doesn't exist (I've confirmed the container is not running in HomeAssistant or otherwise on my network): image

I have the same problem. No matter how I try to disable/remove the Squeezebox (Logitech Media Server) integration it appears again and I'm not able to connect to SlimProto (I have tried Squeezebox Radio, Squeezebox Duet).

frankiboy1 commented 2 years ago

Dug i bit deeper in the logs and found this error in the logs:

2022-07-03 14:51:48 ERROR (MainThread) [aioslimproto.discovery] 'utf-8' codec can't decode byte 0xc5 in position 17: unexpected end of data Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aioslimproto/discovery.py", line 202, in datagram_received data = data.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 17: unexpected end of data

0xc5 is the last byte of the device MAC address. So at least in my case, this looks like an issue with decode of the received data.

marcelveldt commented 2 years ago

Like I said above. I will provide a fix soon. The cause of the issue is all clear. Just need to find some time to PR the patch. Maybe later today or tomorrow. Thanks for the patience.

meichthys commented 2 years ago

@marcelveldt I see that your change is merged into https://github.com/home-assistant-libs/aioslimproto. Does that mean the fix is included in 2022.07?