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

More than 1 accessory support without using bridge #129

Closed
dzungpv opened this issue Mar 24, 2024 · 6 comments
Closed

More than 1 accessory support without using bridge #129

dzungpv opened this issue Mar 24, 2024 · 6 comments

Comments

@dzungpv
Copy link

dzungpv commented Mar 24, 2024

I want to add more than 1 accessory but seem now only have "bridge" and multi service in on accessory mention in: #23 (comment)
But I want multiple accessory for each service in it.
Is there any solution?
Other lib they can define multiple accessory, only difference CID and it can add to HomeKit app: maximkulkin/esp-homekit-demo#102 (comment)
and this: maximkulkin/esp-homekit-demo#102 (comment)

Other reason I do not want to use bridge solution is that some iPhone it could not add like mention in: #104

@shahpiyushv
Copy link
Collaborator

The question is not clear. A single physical device can either have

  • One accessory and multiple service under it (like light, switch, etc.)
  • Multiple accessories, each with own service for light or switch.
    Both of these are as per the HomeKit Specifications which is what this SDK also supports.

1 similar comment
@shahpiyushv
Copy link
Collaborator

The question is not clear. A single physical device can either have

  • One accessory and multiple service under it (like light, switch, etc.)
  • Multiple accessories, each with own service for light or switch.
    Both of these are as per the HomeKit Specifications which is what this SDK also supports.

@dzungpv
Copy link
Author

dzungpv commented Mar 25, 2024

The question is not clear. A single physical device can either have

* One accessory and multiple service under it (like light, switch, etc.)

* Multiple accessories, each with own service for light or switch.
  Both of these are as per the HomeKit Specifications which is what this SDK also supports.

My purpose is: Multiple accessories, each with own service for light or switch. but when I add multiple accessory with

    /* Add the Accessory to the HomeKit Database */
    hap_add_accessory(accessory_second);

for second accessory, a warning show "Primary Accessory already added. Use hap_add_bridged_accessory() instead"
code here: https://github.com/espressif/esp-homekit-sdk/blob/43bab6f68569e26c738f0273960200c809ec0ec9/components/homekit/esp_hap_core/src/esp_hap_acc.c#L384C42-L384C116

Can you give me a sample with I want to add 3 accessory on a single physical device: thermostat, switch and a lightbulb?

@AramVartanyan
Copy link

Hi,

For multiple accessories implementation, you could check this example:

https://github.com/AramVartanyan/esp-homekit-sdk/blob/4e75eb0d6c024a8e10799fc4b010ebb1aca58024/examples/waterbatt/main/app_main.c#L488

Have in mind that it is not updated, but you can follow the concept.

@dzungpv
Copy link
Author

dzungpv commented Mar 25, 2024

Hi,

For multiple accessories implementation, you could check this example:

https://github.com/AramVartanyan/esp-homekit-sdk/blob/4e75eb0d6c024a8e10799fc4b010ebb1aca58024/examples/waterbatt/main/app_main.c#L488

Have in mind that it is not updated, but you can follow the concept.

Your sample is add multiple service to an accessory, I can achieve it already. What I want is multiple accessory on a single esp.

@dzungpv
Copy link
Author

dzungpv commented Apr 18, 2024

Problem solve, I just replace the bridge CID with Thermostat CID and then it same with other SDK.

@dzungpv dzungpv closed this as completed Apr 18, 2024
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

3 participants