I am new to HA and struggling with the status of my KEF LSX switching between unavailable and turned off (or on, it doesn’t matter in that respect) every 30 seconds or multiple thereof. I tried everything mentioned in this thread but it doesn’t help. The LSX is on the most recent firmware (5.2) and HAOS is up to date (2025.1.4). My configuration.yaml is as follows:
media_player:
- platform: kef
host: 192.168.0.60
type: LSX
This is in the logs:
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:960
First occurred: 4:41:49 PM (3 occurrences)
Last logged: 4:52:17 PM
Update for media_player.kef fails
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiokef/aiokef.py", line 356, in send_message
raw_reply = await self._send_message(msg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiokef/aiokef.py", line 319, in _send_message
return data
^^^^
UnboundLocalError: cannot access local variable 'data' where it is not associated with a value
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 114, in __call__
result = await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiokef/aiokef.py", line 473, in get_volume_and_is_muted
volume = await self._comm.send_message(COMMANDS["get_volume"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/tenacity/__init__.py", line 419, in exc_check
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7fb51d075ad0 state=finished raised UnboundLocalError>]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1318, in async_device_update
await self.async_update()
File "/usr/src/homeassistant/homeassistant/components/kef/media_player.py", line 250, in async_update
) = await self._speaker.get_volume_and_is_muted()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 189, in async_wrapped
return await copy(fn, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 111, in __call__
do = await self.iter(retry_state=retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/asyncio/__init__.py", line 153, in iter
result = await action(retry_state)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/tenacity/_utils.py", line 99, in inner
return call(*args, **kwargs)
File "/usr/local/lib/python3.13/site-packages/tenacity/__init__.py", line 419, in exc_check
raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7fb51d1e6950 state=finished raised RetryError>]
Can anybody help me out on this one? Thnx!