Yurik72 / ESPHap

ESP32/ESP8266 Arduino library for native Apple Homekit Accessory Protocol (HAP)
MIT License
264 stars 60 forks source link

multi accessory #110

Closed Julius971 closed 2 years ago

Julius971 commented 2 years ago

Hi, can you upload examples for scenarios, where i have multiple outlets ore something like that.

Julius971 commented 2 years ago

And in addition to this, is it possible to combine a light and another one, even a simpler toggle device would be awesome

Yurik72 commented 2 years ago

Examples of multiaccessory looks like this https://github.com/Yurik72/ESPHap/blob/master/examples/EspHap_RGB_Motion/EspHap_RGB_Motion.ino

for first(main acessory) you call hapservice= hap_add_lightbulb_service("Led",led_callback,(void)&led_gpio); for any nexts light bulb or other devices you should call like this hapservice2= hap_add_lightbulb_service_as_accessory("Led2",led_callback2,(void)&led_gpio2); // change param or duplicate them

As well this is a liitle mentioned in readme