iDevices and Home Assistant, not playing together

Thanks for the information! I’ll give it a try again on 0.115 and report back.
Appreciate all the work you’re doing on HA.

Now it all works (0.117.0), thanks for your suggestions!

An important idea that I just realized - it looks like iDevices can be paired only to one device. If it is paired to the phone, it will not pair to HomeAssistant.

Also, the blue light needs to blink when you enter the device’s code.

1 Like

Hi there, I’m looking at helping a buddy of mine pair all of his iDevice light switches to HA. I was wondering if there are any updates to the pairing process since it’s been about 6 months since the last post, and there are several new versions of HA available. Would someone be able to provide an up-to-date step-by-step guide on how to do it?
Much appreciated!

No updates:

Don’t pair them with HomeKit

  1. Install the HomeKit Controller Integration
  2. Put them in Pairing Mode, noting each switch’s 6-digit HomeKit Code
  3. They should then show up in HA as available
  4. Enter the 6-digit code
  5. Cross fingers and pray

Interesting, I’ve been using my iDevices dimmers, switches and outlets paired to the HK Controller for over a year with no issue. I followed this portion of the HK Controller docs and it worked for me. Maybe I just got lucky.

as another point of references all my iDevices are working with HA as well.

I would really like to have my iDevice switches and thermostats on HA however I’m running into an error when I try and pair them.

Starting with the switches:

  • I previously had them paired using the Home.app
  • I removed the accessory from the Home.app
  • I went into HA, added the Homekit Controller integration, it found the switch
  • Immediately it sent back the error: “An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently.” before I was asked to enter the pairing code.
  • I enter the pairing code and get the very same error: “An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently.”

In my logs I see this:

Logger: homeassistant.components.homekit_controller.config_flow
Source: components/homekit_controller/config_flow.py:345
Integration: HomeKit Controller ([documentation](https://www.home-assistant.io/integrations/homekit_controller), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+homekit_controller%22))
First occurred: 8:41:14 PM (9 occurrences)
Last logged: 9:39:11 PM

Pairing attempt failed with an unhandled exception

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 345, in async_step_pair self.finish_pairing = await discovery.start_pairing(self.hkid) File "/usr/local/lib/python3.8/site-packages/aiohomekit/controller/ip/discovery.py", line 78, in start_pairing request, expected = state_machine.send(response) File "/usr/local/lib/python3.8/site-packages/aiohomekit/protocol/__init__.py", line 129, in perform_pair_setup_part1 raise InvalidError("M2: Accessory did not send public key") aiohomekit.exceptions.InvalidError: M2: Accessory did not send public key

For my thermostats, I unpair the thermostats and they don’t even show up in the Homekit Controller in HA.

Update, I was able to get HA to find the thermostat by resetting the thermostat completely, then using the wifi settings pane on iPhone to join it to the wifi network.

It showed up immediately as a homekit controller discovered device however when I try and add it either through the discovered device or by adding a homekit controller it returns back the following error.

2021-04-05 21:20:30 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception

Then after a failed attempt the device is no longer visible.

If I pull the power to the device (remove it from the wall) and then start the power again it remembers the wifi and HA finds the device again but it just repeats the same issues above.

This has been my experience with iDevices the entire time and why I purged them (and all HomeKit) out of my home. I still use the HomeKit integration to selectively push HA devices into HomeKit, but HomeKit devices themselves were a dead-end for me from an automation standpoint.

I purged all of my iDevices as well. They are garbage. At best they were mediocre when connected directly to HomeKit. With HomeKit controller they would work for a day and then lose their connection.

However, aside from this craptastic brand, I have had a very good experience adding HomeKit devices to HA. I have Koogeek switches, Hunter fans, MyQ, and more, and they all work flawlessly.

Further update on the thermostat. I was able to get my three devices added using the following method:

  • If you already have them paired with the Home.app remove them using the iDevices app
  • On the thermostat go into settings and reset the device
  • When the device reboots it will ask you to configure your thermostat, set all of the details about the HVAC but when it asks to star the process to connect it, abandon the wizard using cancel
  • Using your iPhone, go to settings > wifi.
  • You will see the device below in the section that says join devices to network, follow the steps apple says
  • If you have a mesh network (i.e. eero) you may want to have the device just sit on the network for about 12 hours before proceeding so it can be discovered by all of the mesh nodes as your home assistant and thermostat could be on separate nodes
  • When you are ready to pair, be prepared to move quickly through these next steps.
  • From the HA console go to config > integrations, by now the Homekit Controller should have found your thermostat, press configure to begin, wait until it starts to ask for a pairing code
  • When HA asks for a pairing code go into settings on the thermostat > sync > iOS device
  • This will generate the HomeKit code
  • Quickly add it to HA in the format xxx-xx-xxx

If you do any of this out of sequence or wait too long I ran into issues where the pairing code failed. The only solution for this is to completely reset the thermostat and start again if that happens.

It’s been 6 months since the last post on this topic so I thought I’d check in and see if it’s worth trying to bring this into HA via HomeKit Controller. I

I tossed all of my iDevices out of my network, since there was no way to use them, so I’m good. :slight_smile:

1 Like

I took a chance and tried it anyway. It took a little bit of fiddling with but I got it to work by:

  1. Delete from native app
  2. Turn off 5ghz on my router
  3. Pair into HomeKit and immediately deleting
  4. Restart Home Assistant to begin a fresh discovery
  5. Select device from discovery (HomeKit Controller)
  6. Start pairing process (as per HomeKit and native app instructions) and enter HomeKit code
  7. Reserved static IPs for the switches (not sure if this matters)

From earlier posts in this thread it seems that device connection became unstable within a day so I will keep an eye on it before adding any more switches.

image

The only issue I’ve noticed so far is that one of the switches lost the night light feature. The other one remains blue. I don’t see a way to change that setting from within Home Assistant. Will keep playing with it.

What’s also interesting is that although these switches are not found in the native idevices app anymore, it is still somehow tied to it via IFTTT. I have an automation where if my Nest Hello Doorbell rings (Smartthings) these iDevices switches (native integration) turn on. I also made sure the HomeKit Controller integration is still working in parallel.

So I was reading the iDevice documentation for turning on the night light on the wall switch:

It looks like there is a way to do it with Siri:
"On iOS devices you can also ask Siri® to turn the night light on or off. For example, "Hey Siri, Turn off my Wall Switch night light.”

Is there a way to emulate a Siri command to HomeKit controller devices?

Alex, when I had these added, the Night Light and the actual Switch were added to HomeKit as different components. So, they could be controlled independently. Unfortunately, I don’t think this works when they’re added via the Controller to HA, it doesn’t see the Night Light as a separate device.

So I didn’t understand the point of these two entities as I didn’t notice that they controlled the night light:

image

So I de-activated them earlier just to clean up my dashboard. Realizing that this could be the night light, I re-activated them. They were in fact entities controlling the night light and all is working. There is even an option to change the color of the night light using HK Controller:

1 Like

Is it possible to restore the power monitoring functionality once ported in via HomeKit Controller? I would really like to pull this into Home Assistant to trigger automations!

You just saved me thousands for not having to replace all of our idevices because of the blue light… o.O