N0ciple / hass-kef-connector

A Home Assistant integration for KEF speakers
Apache License 2.0
9 stars 4 forks source link

Cannot connect to LS50W2 #3

Closed aliparr- closed 1 year ago

aliparr- commented 1 year ago

Upon HomeAssistant startup I get this error logged:

    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/connector.py", line 988, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.170:80 ssl:default [Connect call failed ('192.168.1.170', 80)]

192.168.1.170 is the IP address of my LS50W2s - which are on/working etc.

My configuration.yaml looks like this:

media_player:
  - platform: kef_connector
    host: 192.168.1.170
    name: "Butterfly Kef Speakers"
    maximum_volume: 1.0
    volume_step: 0.03

Also, question... if this does work, how does the device show up? This wasn't clear from the readme. It shows up as a device with entities? I see nothing in my device list.

Many thanks!

N0ciple commented 1 year ago

Hello @aliparr-,

I have restarted my home assistant instance, but unfortunately, I could not reproduce the issue.

I had a look at your configuration and it is fine!

Could you please tell me which version of home assistant you are running? You can check that in Settings > About. The last version is 2023.7.3.

The error message you gave seems to indicate an issue with aiohttp that cannot connect to your speakers. If you are sure that the IP of your speakers is correct, are your home assistant instance and LS50 on different subnetworks? I should not cause any issues, except if you add some specific firewall rules between the two subnetworks.

About your question on how the device shows up: the integration creates a new entity in the media_player domain. In your case, it should be entitled something like media_player.butterfly_kef_speaker. You can find them on the entity page (Settings > Devices and Entities > Entities), and from here it should pop up when you search for "kef". Of course, I think that for the entity to appear, the integration should be successfully set up.

aliparr- commented 1 year ago

Hi @N0ciple , Thanks so much for coming back to me. I've managed to fix it! Though I am not sure how. As you suggested, I wanted to ensure network connectivity was all there between HA and the KEFs. Pinging the LS50W2s from my Mac worked fine, but pinging them from my HA RPi4 was timing out.

Strange though, as they are all on the same subnet / router etc. Everything is cabled too, so no Wifi getting in the way.

I tried various things. In the end I did a factory reset of the KEFs, installed the latest firmware, set a fixed IP, and boom, now it works.

So... no clue what I was missing before. As far as I can see everything is the same as it was before. But hey, I won't complain.

Thank you again for the support and for your excellent integration!

N0ciple commented 1 year ago

Glad to know it is working for you now 👌 !

I will close this issue but feel free to (re)open if needed.