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
72.61k stars 30.37k forks source link

Mysa thermostat discovered but cannot configure via HomeKit bridge #84250

Closed jat255 closed 1 year ago

jat255 commented 1 year ago

The problem

I'm trying to get my Mysa (for A/C units) thermostat connected to HA through the HomeKit compatibility (I'm following for the most part this post for procedure). I've got the thermostat paired to the first-party Mysa app, have the HomeKit Controller integration configured, and see the thermostat in my integrations panel:

image

When I click configure, I get the following dialog

image

Unfortunately, this stays up for some amount of time (5 minutes maybe), and eventually fails with this:

image

I don't see any information from the homekit integration in the web UI logs. Is there some way to see additional logging information to figure out what's going on (and how I can fix it)?

What version of Home Assistant Core has the issue?

core-2022.11.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

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?

No response

Additional information

My network setup is a little different than usual, in that I have an IoT VLAN network, and most traffic blocked between that and my main LAN (where HA is running) via firewall. The thermostat is on the IoT VLAN. I'm not certain if this is causing problems though, since HA appears to be able to see the thermostat, but not configure it.

home-assistant[bot] commented 1 year 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)

Jc2k commented 1 year ago

If you restart HA is the device still shown as discovered?

You need to turn on debug logging in your configuration.yaml, specifically for aiohomekit. There are docs for the logging stuff in the main site (sorry no link, replying from phone).

jat255 commented 1 year ago

@Jc2k thanks for the super quick help! I restarted HA and it is not shown as discovered, so I guess that might be part of the issue.

I added the following to configuration.yml:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    aiohomekit: debug

Is that the correct syntax for aiohomekit? I see the debug logs for the homekit component after restarting, so hopefully that will give some more info. I'll work on re-pairing and trying to configure again later on today.

Jc2k commented 1 year ago

It's sounds like you did pair it with an iOS device to start with - did it unpair ok? ( you ideally need to do it from the apple home app ). If the device thinks it's still paired it will vanish from the discovery list.

jat255 commented 1 year ago

I think I might have finished the pairing, and that's why it disappeared. I'll give it another go. Factory resetting the thermostat seems to let it go through the whole pairing process again without too much hassle.

Jc2k commented 1 year ago

You probably want debug logs for homeassistant.components.homekit_controller instead of homeassistant.components.homekit btw, but otherwise that config snippet looks fine.

jat255 commented 1 year ago

Ok, this time I left the app open on the "connect your Mysa" screen but did not click "confirm" (as suggested in that reddit post). When try to add a "Homekit controller" integration, I get that there are no unpaired devices, and see the following in the logs:

2022-12-19 16:52:16.435 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
1 (Identifier): (2 bytes/<class 'bytes'>) b'\x01\x00'
2 (Salt): (1 bytes/<class 'bytes'>) b'\x01'
]

When trying to pair via the "HomeKit" option in the iOS app, the thermostat joins my main VLAN, and I see the following in the logs (this makes me think maybe this is a Unifi/routing problem):

2022-12-19 16:41:48.990 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device Mysa-e82240 (AC-V1-0 - F9:FA:FD:95:0E:65)
2022-12-19 16:41:48.991 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] HomeKit device F9:FA:FD:95:0E:65 ignored as already paired
Jc2k commented 1 year ago

See if you can get an mdns browser app, and post what you can see for this device. In particular what ip address it is sharing in mdns.

jat255 commented 1 year ago

Thanks for your help! After fixing my firewall rules, it appears to be working as expected even on my segregated VLAN. I don't think there's an issue with the integration; it was just a configuration issue.