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.92k stars 30.15k forks source link

Squeezebox (LMS) creating new media_player entities with numbers #91820

Closed AndreKR closed 1 year ago

AndreKR commented 1 year ago

The problem

I have three players in my LMS. I use one, another one is offline and there's one I don't usually use.

Today my automations stopped working. I investigated and found that the player I wanted to use, media_player.kitchen, showed the red "Restored" circle in the list. Two more entities of the same name but with a number appended had appeared:

chrome_zoFrezkcE8

Presumably media_player.kitchen_3 is now the entity for my "Kitchen" player in LMS.

I also have some errors in my log, which may or may not be related:

2023-04-21 15:57:00.838 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/media_player.py", line 152, in _discovered_player
    await player.async_update()
  File "/usr/local/lib/python3.10/site-packages/pysqueezebox/player.py", line 380, in async_update
    self._status.update(response)
TypeError: 'bool' object is not iterable
2023-04-21 15:58:00.873 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/media_player.py", line 152, in _discovered_player
    await player.async_update()
  File "/usr/local/lib/python3.10/site-packages/pysqueezebox/player.py", line 380, in async_update
    self._status.update(response)
TypeError: 'bool' object is not iterable
2023-04-21 15:59:00.865 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/squeezebox/media_player.py", line 152, in _discovered_player
    await player.async_update()
  File "/usr/local/lib/python3.10/site-packages/pysqueezebox/player.py", line 380, in async_update
    self._status.update(response)
TypeError: 'bool' object is not iterable

They appear once a minute.

What version of Home Assistant Core has the issue?

core-2023.3.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Squeezebox (Logitech Media Server)

Link to integration documentation on our website

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

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 year ago

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

Code owner commands Code owners of `squeezebox` 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 squeezebox` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


squeezebox documentation squeezebox source (message by IssueLinks)

AndreKR commented 1 year ago

The reason for this was that squeezelite was running in a Docker container and depending on the start order it got a slightly different MAC address. LMS uses the MAC address reported by the player to identify it. I now set a fixed MAC address in squeezelite with the -m option.