core: Error since 2023.2.0 - Platform kef not ready yet: Cannot get the ip address of kef speaker

The problem

Since the 2023.2.0 update, the kef integration no longer can access my kef speaker, no matter how many times I reboot each. The speaker itself is pingable and connectable from the kef app, just not HA since the upgrade.

What version of Home Assistant Core has the issue?

2023.2.0

What was the last working version of Home Assistant Core?

2023.1.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

kef

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

media_player:
 - platform: kef
   host: 192.168.8.162
   type: LS50
   supports_on: false
   inverse_speaker_mode: true
   standby_time: 60
   maximum_volume: 1
   name: Living Room Speakers

Anything in the logs that might be useful for us?

The error I see in the logs at HA reboot time is

Platform kef not ready yet: Cannot get the ip address of kef speaker.; Retrying in background in 30 seconds

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 43 (13 by maintainers)

Most upvoted comments

Hello

I just want to inform that this issue is not isolated to one user. I am experiencing the exact same problem.

That’s basically it. In layman’s terms

  • download the content of the kef integration (4 files)
  • copy them in the directory custom_components (the same where HACS integrations are installed)
  • edit the manifest.json file to add a version number like "version": "0.0.1"
  • Hardcode the Mac address of your kef in media_player.py line 120
  • restart and enjoy

I created a kef custom_integration directory, copied the 4 kef integration files into it, added a version key to the manifest.json (otherwise the custom integration won’t load). Changing the get_ip_mode function didn’t help. It seems to be the getmac library having issues. There are other issues written like this one. https://github.com/home-assistant/core/issues/87623

Hopefully a fix for getmac can be added to the next HA version. For now I replaced the following line

https://github.com/home-assistant/core/blob/94519de8dd9fcac684b510904a38c2269c27a042/homeassistant/components/kef/media_player.py#L120

with my speakers mac, in lowercase, like

mac = '84:17:15:00:xx:xx'

and rebooted HA and its back online. Using uppercase resulted in a second media_player entity being created so using lowercase solved that. At least its a temporary workaround.

I used some code suggestions from the https://github.com/home-assistant/core/issues/87623 issue and it worked. Hoping someone can review the changes, or let me know what the normal expectation is with this integration in terms of tests / code styles etc. It works for me anyways. Here’s the pull request. https://github.com/home-assistant/core/pull/87712

Having the same issue with Kef LS50 W speakers