Giter Site home page Giter Site logo

Comments (11)

Jc2k avatar Jc2k commented on May 27, 2024

Hi!

It's generally better to post in the HA github in case the upstream library has no idea what HA is, but I'm the maintainer for the bit of HA that uses aiohomekit so it's fine to post here for HomeKit controller stuff! 😀

The 2 most important questions are does it work with iOS and what model bridge is it?

In general if it works with the latest iOS then I consider it a bug to get an error like that. That doesn't mean the bridge isn't doing something buggy or stupid, just that I expect us to be as tolerant of crappy vendors as Apple are.

(The exception to that rule are uncertified home brew devices that are clearly violating the spec).

It's late here and I'm replying in my phone so I can't check but I think M6 is the last step of pairing. I don't think I've seen a pairing get that far and then fail. Wondering if the bridge is sending an extra byte in its M6 that iOS tolerates or if there is a new field your bridge is using that we have not seen before. The full logs would be very useful in figuring that out.

Cheers

from aiohomekit.

espenh-no avatar espenh-no commented on May 27, 2024

Hi again!
Thanks for the superfast response :D

I tried restarting HA after, and then it says the bridge is paired. (I can uninstall, and then install the software again to make it discoverable)

2020-11-18 00:44:24 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device fh_bridge_1 (fh_bridge_1 - 97:26:73:F5:EA:AB)
2020-11-18 00:44:24 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] HomeKit device 97:26:73:F5:EA:AB ignored as already paired

It's a smarthome bridge based on https://github.com/brutella/hc framework for homekit.
Just reinstalled the software on the smarthouse hub, and it paired fine with homekit on an iphone x running iOS 14.2

Here's the full log (dont worry about the Homebridge bridge, as its only paired to HomeKit and not HA):

2020-11-17 02:21:28 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2020-11-17 02:21:28 INFO (SyncWorker_11) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2020-11-17 02:21:28 INFO (MainThread) [homeassistant.core] Timer:starting
2020-11-17 02:21:28 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device Homebridge 88A5 9DE5 (homebridge - 0E:8F:CD:9C:88:B5)
2020-11-17 02:21:28 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] HomeKit device 0E:8F:CD:9C:88:B5 ignored as already paired
2020-11-17 02:21:28 INFO (SyncWorker_20) [homeassistant.loader] Loaded discovery from homeassistant.components.discovery
2020-11-17 02:21:35 DEBUG (MainThread) [homeassistant.components.homekit_controller.config_flow] Discovered device fh_bridge_1 (fh_bridge_1 - 97:26:73:F5:EA:AB)
2020-11-17 02:22:03 DEBUG (MainThread) [aiohomekit.controller.ip.connection] Attempting connection to 192.168.9.22:37247
2020-11-17 02:22:03 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x00
]

2020-11-17 02:22:03 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw request: b'POST /pair-setup HTTP/1.1\r\nHost: 192.168.9.22\r\nContent-Length: 6\r\nContent-Type: application/pairing+tlv8\r\n\r\n\x06\x01\x01\x00\x01\x00'
2020-11-17 02:22:04 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw response: bytearray(b'\x06\x01\x02\x03\xff4\xf8\x81\x11\xd4\xba\xf6\xe8\x02O\x8c\x1b\x1f\xbc\x97\xb9T\x97\xf6\xeb\xe3L\xe0|\xd6\xb2\xce2QJ|\xd1\xf1NZ\x12r\xca\xdc\x98Z\xec\xce\x91\xd4\x89y[2\xf8\xc8#\xde\x8d C\x19\xbe\xfa\xaf6\x92\xe33(\x1d\x1b\x96\x85\xa8\x8eL\xdeo\x04\xb9^r\xa9\\C\xb0G\xa5\x87\xf7@1\xf4\x04\xac\xbeo\x9b#\xa7\n\x8e*M\xf6\xcc\xbe\x08*\xf28_e\x1f\x1e1\x01\xaa_\x8f\xfb2K7\xd7\xe7K\xb4\x8eF \x88\xa1\xa0\x8dj\'\x94m\x83\x9b\xab\x8f\xcaq_\xca\xc2`\xb5\xc1\x16\xd2\xc5^\xab\xf5\x9c\x01\xdf\xa1\xb2M5\xb0\xd3\x98J\x07\xd2r\x87t\x00\xab\xd9\x01\xc9\xa8m\xa6\xc9\xad\x81\x03y0\xd4\x14\x95\xf3!\xcb\xe7\x05\xbc\x81\xb8\x960\x8a\xb1Xk\x82b\x1aY}\xc1\x9c\xbbYq\x01\x7f\xca&\x91\x9fgD!\xcd\x80||!\xdc \xec\xd7By%\x9fg\\\x85\xf2\x1d\x8b\xd9=\x02Xxz,\x10\xf7/\xff\xdb@\r\xd4\x9ea\x03\x81;\xd1\x91\x07\x132\xb7\xe8\x8ejv\xf1t\x9c\x904\xa0\xfc\x15\xcd\xf3\x8f\x98Z\xf8\\8\xf6\xc6\x92b\x9e4\t\xc7\x8e\xf1\xa8\xd1\x9f@\xd3\xack,\x8a\x8f~r)\'\xf2\x127l\xd4\x83\x91.L.4=Xo\xf0\x8fu\xd6\xcaTu\x8c\x08I\t\x9c\x1b0\xcd\xd9\xe53!t\xdfI-\xb7\xd3\xe9n\xd6\xb0C\x9a\x07\xf4\xd5`\xba\x80-\x07\x87\x92\xcb\x0e\x91:\xac\xd81\'\xc8\x9a\xd0\xa3\xaak\x08\xde\x95\x00\x7fHj\xa5\x91\x02\x10\x99\x9a\xfa\xc1\xbc\xd1Et"\xd2\x0e0\xaf*\xe4@')
2020-11-17 02:22:04 DEBUG (MainThread) [aiohomekit.protocol.tlv] receiving [
  6: (1 bytes/<class 'bytearray'>) 0x02
  3: (384 bytes/<class 'bytearray'>) 0x34f88111d4baf6e8024f8c1b1fbc97b95497f6ebe34ce07cd6b2ce32514a7cd1f14e5a1272cadc985aecce91d489795b32f8c823de8d204319befaaf3692e333281d1b9685a88e4cde6f04b95e72a95c43b047a587f74031f404acbe6f9b23a70a8e2a4df6ccbe082af2385f651f1e3101aa5f8ffb324b37d7e74bb48e462088a1a08d6a27946d839bab8fca715fcac260b5c116d2c55eabf59c01dfa1b24d35b0d3984a07d272877400abd901c9a86da6c9ad81037930d41495f321cbe705bc81b896308ab1586b82621a597dc19cbb5971017fca26919f674421cd807c7c21dc20ecd74279259f675c85f21d8bd93d0258787a2c10f72fffdb400dd49e613bd191071332b7e88e6a76f1749c9034a0fc15cdf38f985af85c38f6c692629e3409c78ef1a8d19f40d3ac6b2c8a8f7e722927f212376cd483912e4c2e343d586ff08f75d6ca54758c0849099c1b30cdd9e5332174df492db7d3e96ed6b0439a07f4d560ba802d078792cb0e913aacd83127c89ad0a3aa6b08de95007f486aa591
  2: (16 bytes/<class 'bytearray'>) 0x999afac1bcd1457422d20e30af2ae440
]

2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  6: (1 bytes/<class 'bytearray'>) 0x03
  3: (384 bytes/<class 'bytearray'>) 0x0d71691e4707eb0d61b4802efb21734ccb7dd5e80af254501b81bb95ea3ac9d7ced1c324089f70b462c39311b6acfd271fde1b8094b2f800e8deabfb29a1b36cb24ed28f92cc9f93d140fb12c3001afa141ef4bf9f4c813997ee47b3de332bb67e69a0da9cd8f72add308b52bf088c611b0973ce4a0653027a2132e83e695642e03bf2e5180f90ceeeb569f45b6f175ce128b5c45b2e45436048551ec286823a58c7bf3e417233111adeeb05c55b3f2c29aa609822453870b2bc35f866dc324bc63c55d1efbdcc485155628c42ff34ae60a7c9d76680d00d5123f747b6799a38d082799ed6fc5b3affdecea4deaa2ff26d520c0e3ff55a150a3617c8cb5b2365b53b84669fde3cb5567fadd3cb4272dc0d2e9f9dc447333f14896e1556bf0a40d45e9a937a2723c07ea68dc752d6565f20fe00afc1a86acc185cee664020995368d86b48777741302174f8ba1a035e3d19a449c6c6365a481654bdf3b722d2540d4d6daca46f0134c16b737b11b043d1bdf4f3aecf9f2dbfce4c456e20c563fe
  4: (64 bytes/<class 'bytearray'>) 0x5fc8bc79db0d2646b9483deb8c4d37abc5d613650e81cc719f8c8905131c8206e5ef751a000ec50a61b42c0a4be2a213b6f8bed4c1687c4e15641b0621dd28fc
]

2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw request: b'POST /pair-setup HTTP/1.1\r\nHost: 192.168.9.22\r\nContent-Length: 457\r\nContent-Type: application/pairing+tlv8\r\n\r\n\x06\x01\x03\x03\xff\rqi\x1eG\x07\xeb\ra\xb4\x80.\xfb!sL\xcb}\xd5\xe8\n\xf2TP\x1b\x81\xbb\x95\xea:\xc9\xd7\xce\xd1\xc3$\x08\x9fp\xb4b\xc3\x93\x11\xb6\xac\xfd\'\x1f\xde\x1b\x80\x94\xb2\xf8\x00\xe8\xde\xab\xfb)\xa1\xb3l\xb2N\xd2\x8f\x92\xcc\x9f\x93\xd1@\xfb\x12\xc3\x00\x1a\xfa\x14\x1e\xf4\xbf\x9fL\x819\x97\xeeG\xb3\xde3+\xb6~i\xa0\xda\x9c\xd8\xf7*\xdd0\x8bR\xbf\x08\x8ca\x1b\ts\xceJ\x06S\x02z!2\xe8>iVB\xe0;\xf2\xe5\x18\x0f\x90\xce\xee\xb5i\xf4[o\x17\\\xe1(\xb5\xc4[.EC`HU\x1e\xc2\x86\x82:X\xc7\xbf>Ar3\x11\x1a\xde\xeb\x05\xc5[?,)\xaa`\x98"E8p\xb2\xbc5\xf8f\xdc2K\xc6<U\xd1\xef\xbd\xccHQUb\x8cB\xff4\xae`\xa7\xc9\xd7f\x80\xd0\rQ#\xf7G\xb6y\x9a8\xd0\x82y\x9e\xd6\xfc[:\xff\xde\xce\xa4\xde\xaa/\xf2mR\x0c\x0e?\xf5Z\x15\n6\x17\xc8\xcb[#\x03\x81e\xb5;\x84f\x9f\xde<\xb5V\x7f\xad\xd3\xcbBr\xdc\r.\x9f\x9d\xc4G3?\x14\x89n\x15V\xbf\n@\xd4^\x9a\x93z\'#\xc0~\xa6\x8d\xc7R\xd6V_ \xfe\x00\xaf\xc1\xa8j\xcc\x18\\\xeef@ \x99Sh\xd8kHwwA0!t\xf8\xba\x1a\x03^=\x19\xa4I\xc6\xc66ZH\x16T\xbd\xf3\xb7"\xd2T\rMm\xac\xa4o\x014\xc1ks{\x11\xb0C\xd1\xbd\xf4\xf3\xae\xcf\x9f-\xbf\xceLEn \xc5c\xfe\x04@_\xc8\xbcy\xdb\r&F\xb9H=\xeb\x8cM7\xab\xc5\xd6\x13e\x0e\x81\xccq\x9f\x8c\x89\x05\x13\x1c\x82\x06\xe5\xefu\x1a\x00\x0e\xc5\na\xb4,\nK\xe2\xa2\x13\xb6\xf8\xbe\xd4\xc1h|N\x15d\x1b\x06!\xdd(\xfc'
2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw response: bytearray(b'\x06\x01\x04\x04@\xcc\xe8%}\x8e\x1f\xcb\xe3\xf97\xb9\xcdQ\xcd\xb1 >z_\xc9\x89A\xec\xe9v\\\xe8\xe8\xf3\xca\xf6\x94\x05HAc\x94|s\xfdKGE\xb9\xd6\xbb{\xcc\x8a!\xa6\xb3\x10\xf4\x93\x10\xceV@\xc1Z\xe7\xdaR')
2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.protocol.tlv] receiving [
  6: (1 bytes/<class 'bytearray'>) 0x04
  4: (64 bytes/<class 'bytearray'>) 0xcce8257d8e1fcbe3f937b9cd51cdb1203e7a5fc98941ece9765ce8e8f3caf69405484163947c73fd4b4745b9d6bb7bcc8a21a6b310f49310ce5640c15ae7da52
]

2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  1: (36 bytes/<class 'bytes'>) b'cc45df25-9bb1-4d5d-8156-db96fc487aa8'
  3: (32 bytes/<class 'bytes'>) b'\xc7w5#t\rv.\x96\x0c\xbaq\xcf\xb5\x0c\xb2~C\x87&\x12+y\xcbM\xa8,?\xa4\xd2\xf1\xb3'
  10: (64 bytes/<class 'bytes'>) b"\x9c\x81\xe8e\xfd\xb4\xa4\xf9f\xe6b'\x01\x9d\x88r7X]\x83j\x1f\xfe\xc5\xcb\x9cH\x8fsMI6&\x1dqg=\xeeg\xach\x80;\x97\xae\x0fs&\xa8\xb8\x85\xf1VO\xc8\xf3\x80\x93\x12\xb9-\xe1\xe2\r"
]

2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  6: (1 bytes/<class 'bytearray'>) 0x05
  5: (154 bytes/<class 'bytes'>) b"\xcd}\x8do\xc6\xfb\xdf\xaf\x83\np[\x0c\xc3G\xaa\xeb\xe7\x92\x9b\xd7\x01S\xa7\x8c\xd4R\x8f\xaa\xe3`\xb8\xdb\n\x1bA^s=\xfe\xab\xaf\xeca~\t\xe1ZvJ\xca(\x80A/\xa9]V`H\xa0\xbd\x11\xcbJ\r\xe7k\xc5XQ\xb9l\x1f\x0e\x00\x84\x7fE\xf0\n~\r\x06[\xeb\xef\x8e;\xb5dW\x96\x10\x1c\xd8@EZK\x9c\xd1y\xb8\xea\xd7\xdbb\xf8\xab\x93\xe9\x86D>\x18\xccV#\x90\xf7\xc8\xafQ\xeb\xc2\xe8\xa9\x92'\x0f\x19%~V\x08\xd0\xca\xd9'Y5L\xb7\xac\xa0\x92x\xd2\xe6}C\xdf\xd2"
]

2020-11-17 02:22:14 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw request: b"POST /pair-setup HTTP/1.1\r\nHost: 192.168.9.22\r\nContent-Length: 159\r\nContent-Type: application/pairing+tlv8\r\n\r\n\x06\x01\x05\x05\x9a\xcd}\x8do\xc6\xfb\xdf\xaf\x83\np[\x0c\xc3G\xaa\xeb\xe7\x92\x9b\xd7\x01S\xa7\x8c\xd4R\x8f\xaa\xe3`\xb8\xdb\n\x1bA^s=\xfe\xab\xaf\xeca~\t\xe1ZvJ\xca(\x80A/\xa9]V`H\xa0\xbd\x11\xcbJ\r\xe7k\xc5XQ\xb9l\x1f\x0e\x00\x84\x7fE\xf0\n~\r\x06[\xeb\xef\x8e;\xb5dW\x96\x10\x1c\xd8@EZK\x9c\xd1y\xb8\xea\xd7\xdbb\xf8\xab\x93\xe9\x86D>\x18\xccV#\x90\xf7\xc8\xafQ\xeb\xc2\xe8\xa9\x92'\x0f\x19%~V\x08\xd0\xca\xd9'Y5L\xb7\xac\xa0\x92x\xd2\xe6}C\xdf\xd2"
2020-11-17 02:22:15 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw response: bytearray(b'\x06\x01\x06\x06\x01\x05\x05\x87\xc4\xe5Q\x9a#?B\xa8\xe8v`\xef\x8c5\xb1\xcceB\x86,5\xa1\xe3\xa3\x8cu\x9fz&\xe6`n\x16\xdd\x0e\xe6\xe3X8\xb1\x88F`|+\xc7\x16r\x9b\xf9\x82\xfe\xef\x0e\xd8h&\x0f\x14\x08T\x99IV\xa8\xd0h{\x08\xa1Jh\xa9*\x0f\x06\x97H\x9cCj\x90\xb3\xd8u{\xa8\x8a\xed\xe4:\xd5mo\x04$\xb9z\x94\x08\x8f\xcc\xa6:\r\x9d\x1e;\xad!ly\xe2\x8d\x83\x9d]]Q\xc9\xf2\x12\xad]\x90\xa7J\x02\xcd\xfb(\xb9!\xff\x05')
2020-11-17 02:22:15 DEBUG (MainThread) [aiohomekit.protocol.tlv] receiving [
  6: (2 bytes/<class 'bytearray'>) 0x0605
  5: (135 bytes/<class 'bytearray'>) 0xc4e5519a233f42a8e87660ef8c35b1cc6542862c35a1e3a38c759f7a26e6606e16dd0ee6e35838b18846607c2bc716729bf982feef0ed868260f140854994956a8d0687b08a14a68a92a0f0697489c436a90b3d8757ba88aede43ad56d6f0424b97a94088fcca63a0d9d1e3bad216c79e28d839d5d5d51c9f212ad5d90a74a02cdfb28b921ff05
]

2020-11-17 02:22:15 ERROR (MainThread) [homeassistant.components.homekit_controller.config_flow] Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 297, in async_step_pair
    pairing = await self.finish_pairing(code)
  File "/usr/local/lib/python3.8/site-packages/aiohomekit/controller/ip/discovery.py", line 99, in finish_pairing
    request, expected = state_machine.send(response)
  File "/usr/local/lib/python3.8/site-packages/aiohomekit/protocol/__init__.py", line 243, in perform_pair_setup_part2
    handle_state_step(response_tlv, TLV.M6)
  File "/usr/local/lib/python3.8/site-packages/aiohomekit/protocol/__init__.py", line 81, in handle_state_step
    raise InvalidError(f"Exepected state {expected_state} but got {actual_state}")
aiohomekit.exceptions.InvalidError: Exepected state bytearray(b'\x06') but got bytearray(b'\x06\x05')
2020-11-17 02:22:15 DEBUG (MainThread) [aiohomekit.controller.ip.connection] Attempting connection to 192.168.9.22:37247
2020-11-17 02:22:15 DEBUG (MainThread) [aiohomekit.protocol.tlv] sending [
  6: (1 bytes/<class 'bytearray'>) 0x01
  0: (1 bytes/<class 'bytearray'>) 0x00
]

2020-11-17 02:22:15 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw request: b'POST /pair-setup HTTP/1.1\r\nHost: 192.168.9.22\r\nContent-Length: 6\r\nContent-Type: application/pairing+tlv8\r\n\r\n\x06\x01\x01\x00\x01\x00'
2020-11-17 02:22:16 DEBUG (MainThread) [aiohomekit.controller.ip.connection] 192.168.9.22: raw response: bytearray(b'\x06\x01\x02\x03\xff\x06\xf3\x12\xbd;\xf4u\x1a\xe12j\xde\xb0\xc1\x87S\x19\xc9$\xfcO9\xde\x14|\x84\xbf\xfe\xf2\x81\xb9v\x88l\xd5\xbcs\xbd\x88\xd8w\xe6c\x14b2f\xae\x1bi\xf7\x0b\xe1\xed\x11\x06\xbb\xb5\xf1\x02\xd4\xe3$X#E\x00\te\x175J\xa3\xcb\xc8d\x9f\x8e\x05\xf2@\xd3\xcf\x7f\x91"/_^\x89zJ\x18l\xf2*B\xcc\x00j{v\xfd\x86\xcdCE:P}\x1f\x99\xc8\x1f\xeb\x97\x0f\xcd\xaf\xfe\xe2\xcd\x82\xd6\x919\xc4=\xd2\xd6\x96[\x8f.5\x9d\xa0\x81\xaf\x13\xbf\xdc\xd3\xc1\x15@\xd5K.\t\xd3\xb0\xed}\x17\x89\x1fC\xa6\x84\xc1\x10s\x81=oU\x18<Pf\xe2\x08\xba(\xda?\x94{P\t\x87Z\x8a\xe5\xb2\xd1\x97\x0bN3\xc7so$\x19\xc4\x1f04\x9b\xefj\x1b\x14$@\xe5\x12\xba!\xe3\xa7\xa64\xecE\x029\xba6\xe5Q\xf3\xa85\t\x04Q\xca\xc3_)_\xd7\xfc\x18V\x98\xaa\x19\xc2x\x82\x8b\xff;\x82,S\x06\xb0\\\xb0~\x03\x81\x8d\xbd\xa7\xf9\x01\xeb\xce\x8c\x7f\x0fco\xe0\xfe\xf4VV\xe4\xd2<ncb\xde\xcfq%\x88\x99\xe6\xae\xa6Y\x82CF~\\;2\xba\x19\x06\xb4.\x1eP\xe5\xde\xa5\x1a\x12v\xee\xb9I\xce`\xcfx\xb0ZP1/\x0ci:\xe9\xec\x89\xb0\x98\x7f(?\xec\xe8\xd2b\x9c\xeb\xf3q1\xf9\xc09.?\x8e)\xf5N\xf1S\xe4l\xbbH~\xb1\x88QB5\xdd\x81\n\x01\x088?\xeb\x9c\x03\x89\xf1?\x17\x13\xcc\x9bO\xc7\xcdw\x15\xfa\x02\x10.\xbfK\xe1x\xf7\x8d\x97u"\xfd]\x8a\x9e\xa3\xe1')
2020-11-17 02:22:16 DEBUG (MainThread) [aiohomekit.protocol.tlv] receiving [
  6: (1 bytes/<class 'bytearray'>) 0x02
  3: (384 bytes/<class 'bytearray'>) 0x06f312bd3bf4751ae1326adeb0c1875319c924fc4f39de147c84bffef281b976886cd5bc73bd88d877e66314623266ae1b69f70be1ed1106bbb5f102d4e32458234500096517354aa3cbc8649f8e05f240d3cf7f91222f5f5e897a4a186cf22a42cc006a7b76fd86cd43453a507d1f99c81feb970fcdaffee2cd82d69139c43dd2d6965b8f2e359da081af13bfdcd3c11540d54b2e09d3b0ed7d17891f43a684c11073813d6f55183c5066e208ba28da3f947b5009875a8ae5b2d1970b4e33c7736f2419c41f30349bef6a1b142440e512ba21e3a7a634ec450239ba36e551f3a835090451cac35f295fd7fc185698aa19c278828bff3b822c5306b05cb07e8dbda7f901ebce8c7f0f636fe0fef45656e4d23c6e6362decf71258899e6aea6598243467e5c3b32ba1906b42e1e50e5dea51a1276eeb949ce60cf78b05a50312f0c693ae9ec89b0987f283fece8d2629cebf37131f9c0392e3f8e29f54ef153e46cbb487eb188514235dd810a0108383feb9c0389f13f1713cc9b4fc7cd7715fa
  2: (16 bytes/<class 'bytearray'>) 0x2ebf4be178f78d977522fd5d8a9ea3e1
]

from aiohomekit.

espenh-no avatar espenh-no commented on May 27, 2024

@Jc2k Did the logs provide more info of where the issue might be?

from aiohomekit.

Jc2k avatar Jc2k commented on May 27, 2024

Not had chance to look yet, sorry. The code is expecting an M6 response from the device. In the field where you would expect to see an M6 (i.e. 0x06) we are actually finding 0x06 0x05. I know that the iOS implementation is very forgiving of stuff that is off protocol - it can actually work even if the device sends an M6 without the state value set at all. So i don't know whether the go code is sending off protocol guff that iOS tolerates or whether the bridge implements some newer version of the pairing scheme that isn't supported yet that is throwing the TLV parser off kilter.

Unfortunately the go code doesn't use the same names for things as in the spec so its a bit of an undertaking to see what could be causing the upset.

It would help if you could describe how to make something with hc that has this problem then when i have some time i'll be able to more quickly see whats going on.

from aiohomekit.

dbarrosop avatar dbarrosop commented on May 27, 2024

I ran into this same issue. In my case I commented the line raising the exception and the pairing completed successfully. I understand it is a hack and it'd be nice to have a proper fix but the integration seemed to work just fine after pairing.

from aiohomekit.

Jc2k avatar Jc2k commented on May 27, 2024

Yeah as I alluded go in my last post that might actually be the right fix. iOS is very forgiving of stuff like this. But need to figure out if the target device/framework is just doing something crappy and we need to tolerate it OR if this is a new variant of homekit.

Are you using hc too?

from aiohomekit.

dbarrosop avatar dbarrosop commented on May 27, 2024

Yes, I am using hc too and other than that it seems to work just fine with homekit and with aiohomekit/homeassistant (after pairing commenting those lines)

from aiohomekit.

Jc2k avatar Jc2k commented on May 27, 2024

Thanks for confirming @dbarrosop. To move this forward I think I need either:

  • A pcap of a successful pairing between hc and iOS, this will let me validate that hc generates spurious data for iOS, and that iOS ignores it OR that iOS uses different pairing flags which stop this from happening.
  • Step by step instructions on how to recreate this locally without any external hardware, so I can get a pcap myself. I run a Mac locally, but if there is a docker image that is also great.

from aiohomekit.

dbarrosop avatar dbarrosop commented on May 27, 2024

I am sending you a silly example so you can reproduce yourself. You can start it either using docker-compose up (although I have had problems making it work properly using docker for mac, I suspect docker for mac is somehow interfering with ddns) or directly with go run main.go. When you run it it will create a folder called Lamp in your working directory, you can delete it to "reset" the device.

If you need anything else don't hesitate to let me know.

PIN is 001-02-003

aiohomekit-test.tar.gz

from aiohomekit.

Jc2k avatar Jc2k commented on May 27, 2024

This is really helpful! I'll try and look at this asap

from aiohomekit.

bdraco avatar bdraco commented on May 27, 2024

I'm going to close this since I pair these all the time now without issue anymore

from aiohomekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.