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
73.82k stars 30.91k forks source link

Homekit controller using wrong IP Address for an entity when connecting #82399

Closed brent7320 closed 1 year ago

brent7320 commented 2 years ago

The problem

I have around 20 Meross Homekit switches that I have added to Home Assistant within the past 2 weeks. Intermittently some devices will become "unavailable" in Home Assistant, with an error similar to the below.

Retrying setup: Timeout while waiting for connection to device 192.168.1.61:52432

or this in the full Home Assistant log

Config entry 'MSS510-aedb' for homekit_controller integration not ready yet: Timeout while waiting for connection to device 192.168.1.61:52432; Retrying in background
3:19:00 AM – (WARNING) config_entries.py - message first occurred at November 19, 2022 at 9:14:01 PM and shows up 214 times

When these errors do show up, in all cases, the IP address that is displayed in the error is NOT the ip address of that specific entity. I have all of the IP's and MAC addresses documented on my home network, and these switches all have DHCP reservations.

In the specific error above, the light switch that Home Assistant is saying is "unavailable" is actually 192.168.1.75. Another thing to note is that BOTH of these addresses (192.168.1.61 AND 192.168.1.75) are up on the network, singable, and the web interface returns "Page Not Found / " as it does for all of the working switches.

Restarting Home Assistant always appears to resolve the issue and the entity becomes available again.

What version of Home Assistant Core has the issue?

core-2022.11.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Homekit Controller

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Config entry 'MSS510-aedb' for homekit_controller integration not ready yet: Timeout while waiting for connection to device 192.168.1.61:52432; Retrying in background
3:19:00 AM – (WARNING) config_entries.py - message first occurred at November 19, 2022 at 9:14:01 PM and shows up 214 times

Additional information

No response

home-assistant[bot] commented 2 years ago

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

Code owner commands Code owners of `homekit_controller` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign homekit_controller` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


homekit_controller documentation homekit_controller source (message by IssueLinks)

bdraco commented 2 years ago

Ips are updated via mdns

check in the discovery app which ip the device is broadcasting

brent7320 commented 2 years ago

using an mNDS browser on MacOS I can see that the device listed in the log above (MSS510-aedb) has an IP of 192.168.1.75, which is correct. This is the device that HomeAssistant was listing as trying to connect to as 192.168.1.61 (until it was rebooted).

image

bdraco commented 2 years ago

Thats good. Some of them actually announce the wrong address.

If you enable debug logging for zeroconf and aiohomekit you should be able to get a better idea of what is going on.

Search for the id value in the log the next time it happens and see what ip address is coming in.