Home Assistant release with the issue: 0.90.2
Last working Home Assistant release (if known): Never
Operating environment (Hass.io/Docker/Windows/etc.): Hassos on Raspberry Pi 2 B installed with hassos_rpi2-2.11.img image
Component/platform: Homekit_controller
https://www.home-assistant.io/components/homekit_controller/
Description of problem:
I reset my Xiaomi aqara hub and it didn't show up as a card on the web UI.
I started the pairing process from an iPhone and at this point the wifi connexion on the hub started to work. The device appeared on the web ui, but it was mentioned as "already paired".
So I removed from the iPhone the pairing.
From the web UI Home assistant allows me to enter a HomeKit PIN.
I tried with the 8 digits on the sticker and it didn't work, I tried with the qr code (13 digits) and it didn't work. Error message from the web ui:
Incorrect HomeKit code for Aqara Hub-3171. Please check it and try again.
I tried running directly in a CLI the following:
Discover the homekit device (aqara is showing up)
/config/.homekit # python3 -m homekit.discover
Name: Aqara Hub-3171._hap._tcp.local.
Url: http_impl://192.168.1.247:4567
Configuration number (c#): 1
Feature Flags (ff): Supports HAP Pairing (Flag: 1)
Device ID (id): 02:7A:BE:D1:XX:XX
Model Name (md): Aqara Hub-3171
Protocol Version (pv): 1.1
State Number (s#): 1
Status Flags (sf): Accessory has not been paired with any controllers. (Flag: 1)
Category Identifier (ci): Bridge (Id: 2)
Pairing using python script (and pin provided, not the one below)
/config/.homekit # python -m homekit.pair -d 02:7A:BE:D1:XX:XX -f pairing.json -a aqara -p 12345678 --log debug
2019-04-01 21:38:42,047 __init__.py:0155 DEBUG #5 ios -> accessory: send SRP exchange request
step 5
2019-04-01 21:38:42,051 pair.py:0063 DEBUG step 5
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/homekit/pair.py", line 56, in <module>
controller.perform_pairing(args.alias, args.device, args.pin)
File "/usr/local/lib/python3.7/site-packages/homekit/controller/controller.py", line 337, in perform_pairing
pairing = perform_pair_setup(pin, str(uuid.uuid4()), write_fun)
File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 162, in perform_pair_setup
error_handler(response_tlv[1][1], 'step 5')
File "/usr/local/lib/python3.7/site-packages/homekit/protocol/__init__.py", line 45, in error_handler
raise AuthenticationError(stage)
homekit.exceptions.AuthenticationError: step 5
Problem-relevant configuration.yaml
:
discovery:
enable:
- homekit
ignore:
- xiaomi_gw
logger:
default: warning
logs:
homeassistant.components.homekit_controller: debug
I updated my initial post with my CLI attempt to pair
Looks like you haven't put the dashes in the pin code? Ah, if i remember correctly the Xiaomi gear doesn't print the code on the sticker properly - they leave out the dashes, but these are actually part of the crypto so if you leave them out it won't work.
Your pairing code needs to be formatted like this: 031-45-154
Thank you @Jc2k ! it was exactly this code formatting problem.
Most helpful comment
Looks like you haven't put the dashes in the pin code? Ah, if i remember correctly the Xiaomi gear doesn't print the code on the sticker properly - they leave out the dashes, but these are actually part of the crypto so if you leave them out it won't work.
Your pairing code needs to be formatted like this:
031-45-154