Comments (3)
@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.
@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.
@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)
- Cannot Add Accessory (Accessory Already Added)
- Help me understand how homekit works (bridge + thermostat example) HOT 7
- ESP32 Homekit Gateway queries HOT 1
- Errors with example "lightbulb" HOT 4
- How send the led status to the iPhone? HOT 11
- How to re-send WiFi credential after reset HOT 2
- Parameters accessory: what is ".pv" param? HOT 2
- Using local switch without accessory pair HOT 3
- Unable to Add Accessory - This accessory cannot be used with HomeKit HOT 8
- Lightbuld: fast blink on reset HOT 4
- Setup Payload Generator doesn't work with Flash Download Tool HOT 2
- Associated more than one accessory HOT 2
- mbedtls inclusion error, udnefined functions HOT 1
- Unable to find components to build examples for ESP8266 HOT 2
- How to cleanly add or remove accessories ? (bridge) HOT 2
- HTTPD init error HOT 2
- ESP8266无法使用
- Accessory Not Found HOT 6
- Update examples CMakeLists.txt
- hap_platform_httpd_start failing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp-homekit-sdk.