Closed petr-tichy closed 6 months ago
Hi, thanks for reporting! I fixed the await.
Can you please provide your define statement? It looks like the HOMEKIT_ID and PIN is missing in the define.
Please also try to delete the created devices in FHEM and do the define again with the fixed version.
def dirigera fhempy homekit AD:D9:70:... 123-45-678
(not the actual values)
HOMEKIT_ID
and HOMEKIT_PIN
are there in FHEM internals
Please update to the latest fhempy version, delete all homekit devices in FHEM and try again. It could be that the missing await caused the error.
Now at 0.1.697
and KeyError: 'HOMEKIT_ID'
is still there at pairing attempt. About to start VSCode debug.
That's really strange. 2 lines above hash["HOMEKIT_ID"]
is assigned. The only issue could be that args[3]
is None.
I'm not sure this is the root cause, but json.loads(value) throws JSONDecodeError('Expecting property name enclosed in double quotes: line 1 column 2 (char 1)')
as the value
is "{'AccessoryPairingID': 'AD:D9:70...
. when retrieving pairing_data
This prevents restoring pairing_data
and not paired yet
path is always chosen at https://github.com/fhempy/fhempy/blob/42968b234e7372e8a7059feb112b690909c17e33/FHEM/bindings/python/fhempy/lib/homekit/homekit.py#L142C13-L142C29
The #297 fixes the above pairing issue, and #298 fixes naming of devices. With these two, I was able to pair Dirigera and the devices appeared in FHEM. All seems good now.
Great to see that it is working for you! Thank you very much for your contributions!
Just to let you know, the homekit implementation is currently very very basic. The most important thing which is missing is the update loop to poll the current states.
https://github.com/fhempy/fhempy/blob/b2a7729cd23ea325b5b515c66012f91c99350556/FHEM/bindings/python/fhempy/lib/homekit/homekit.py#L147C18-L147C18
When fixed with
await
I get into another issue:I'm trying to pair IKEA DIRIGERA.