Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-device support #181

Closed
alparr opened this issue Jan 6, 2023 · 6 comments
Closed

Multi-device support #181

alparr opened this issue Jan 6, 2023 · 6 comments

Comments

@alparr
Copy link

alparr commented Jan 6, 2023

Hello,

I have an issue that I can't get this library to work with multiple devices. E.g. if I'm pairing with my phone, the devices are showing up on my iPad and on my watch, but it tells me that there is no response from them. (If I'm pairing with my iPad then they only work on the iPad).
Am I doing something wrong? Or is this use-case not supported?

Maybe it is also worth mentioning that I'm not using a hub. Would it be different if I would also use a hub?

IMG_0153
IMG_0154

@yfre
Copy link
Contributor

yfre commented Jan 6, 2023

multiple paired devices are supported. i have around 8 in my home :)
but you need to implement management of users see. HomekitAuthInfo.createUser/listUsers/.. , which holds the key for each device (called users here the class). so, if you have multiple devices you need to have multiple users managed / stored somewhere

@alparr
Copy link
Author

alparr commented Jan 7, 2023

@yfre Could you elaborate on this a little bit more, or provide some code example? I'm basically using the code from the sample application, MockAuthInfo:createUser is already storing multiple users if it receives them, but it is only called once when I'm doing the initial pairing. So what else do I have to do for it to work also on the other devices?

@yfre
Copy link
Contributor

yfre commented Jan 9, 2023

checked MockAuthInfo and it looks good and should work with multiple devices (i have not tested though).
another implementation is in openHAB (but pretty openHAB specific)
https://github.com/openhab/openhab-addons/blob/main/bundles/org.openhab.io.homekit/src/main/java/org/openhab/io/homekit/internal/HomekitAuthInfoImpl.java

probably, the best approach would be to add more logging to MockAuthInfo to see which users are created and which are requested.

@alparr
Copy link
Author

alparr commented Jan 10, 2023

createUser is only called once, when I'm doing the pairing.
getUserPublicKey is also called with different usernames occasionally, but it is returning null because it only has the public key for the initially paired device.

I also tried to start the bridge with allowUnauthenticatedRequests set to true (I don't know if this has anything to do with my issue), but it is still not working.

@alparr
Copy link
Author

alparr commented Jan 10, 2023

Can it be related to the new HomeKit architecture? https://community.openhab.org/t/homekit-ios-16-2-issues-dont-upgrade/142069

I guess I upgraded my app to 16.2 because I don't have the option in the settings. Seems like it is already fixed in OpenHAB.
openhab/openhab-addons#13949

UPDATE: Sorry, I haven't seen the release 2.0.5 (it is not showing up under Releases on the projects github page). It is working now on my iPad and Mac, but it is still not working on my watch.

@yfre
Copy link
Contributor

yfre commented Jan 10, 2023

ok. so, it was related to new homekit architecture. good that it is working with new release.
regarding watch - we have no influence on the watch, it gets the data from the iphone. so, we need to wait for apple to fix (hopefully) the new architecture and see how it will behave

@alparr alparr closed this as completed Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants