Giter Site home page Giter Site logo

Comments (3)

shahpiyushv avatar shahpiyushv commented on June 24, 2024

@adukale , you can check the bridge example to understand how to add multiple accessories under the same node. However, if the multiple accessories (switches in your case) are co-located i.e. part of a single physical device, you just need to add multiple switch services into the same accessory. You can either have independent callbacks for each or add some private data to each switch service (some identifier or GPIO number) and have a common callback. This line shows how to add private data and that same is used here in the callback.

from esp-homekit-sdk.

adukale avatar adukale commented on June 24, 2024

@shahpiyushv Thank you for quick response.
Your suggestions helped. I have modified esp_rainmaker/example/homekit_example to have 6 switches.
Here is the code sample: https://github.com/adukale/homekit_6switch

I can see 6 switches in Home app in ios/HomeKit. But turning on/off anyone of them results in rebooting esp32 and it goes into bootloop sometimes. Also, the connected gpios/relayes does not change the state.

Thanks in advance.

from esp-homekit-sdk.

adukale avatar adukale commented on June 24, 2024

@shahpiyushv I resolved the error. The issue was in callback functions for homekit service. Have seperated out each callbacks for services.
Now control from ESP Rainmaker App & HomeKit app works flawlessly, the only issue is state is not persisted in homekit.
I noticed the code: app_homekit_start(DEFALT_POWER); in app_main.c. This set power to default set and does not retain the previous state.
Is there any workaround for this?
Updated code: https://github.com/adukale/homekit_6switch
Thank You

from esp-homekit-sdk.

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.