Re-pairing of a HomeKit device

Hi, I need to re-pair a HomeKit enabled device, specifically a BTicino-Legrand Gateway.

My situation was:

  • the gateway was already paired and working in HomeKit, and I used it with the Apple Home app;
  • in order to pair it with HA I had to reset it;
  • after resetting both the device, its official iOS app, and the entire HomeKit in iOS, I tried to pair it again in HA first

Unfortunately the problem is that HA sees the device as already paired in HomeKit, as the error below shows:

2019-11-11 01:14:39 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device Legrand Gateway (Legrand Gateway - <GATEWAY_ADDRESS>)
2019-11-11 01:14:39 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] HomeKit device <GATEWAY_ADDRESS> ignored as already paired

I tried also to delete the .homekit.state file, with no success.
What should I do?

It seems I managed to clear the “paired” status of the device by:

  • resetting it
  • disabling the fritzbox discovery integration in Home Assistant
  • deleting it from the devices list in the FritzBox modem configuration page

I still don’t get to pair it with Home Assistant on a fresh discovery: it will fail mentioning a generic problem, and after that it’s again in a “already paired” state, from which it seems the only way to get out is another reset.

Anyway I’ll open another topic for that because it’s not related to this.