Closed ericklil closed 4 years ago
Well, to implement an accessory you need to add apropriate services which in turn have proper characteristics. Setup codes are either hard-coded inside firmware (and printed somewhere on packaging or on the accessory itself),
or you add a screen to accessory and show randomly generate setup code or even QR code.
Thank you for your quick reply, I erred in my question
I meant to ask; how to create an accessory other than the sample you provided. i.e a Light with HSV values such as a Neopixel or a Fan with speed, direction and other characteristics or services
?
Where to find the accessory category code
as you mention in yourreadme.md
In the sample is the .setupId="1QJ8"
random generated?
Well, the main read is Homekit Accessory Protocol Specification (you need to create an Apple Developer account to access it). You can find it on this page: https://developer.apple.com/homekit/
In esp-homekit all services and characteristics for the spec are defined in homekit/characteristics.h. For convenience, service definitions in that header file are provided with list of required and optional characteristics.
Accessory categories can also be found in HAP spec. In esp-homekit they are defined in homekit/types.h.
And finally, yes, setupId is a random hexadecimal 4-char sequence that is used for identifying accessory based on QR code.
Thank you for your work!
If I wanted to change the
accessory
to say a Light withHSV
values, Or make this control a fan with speed, direction etc, basically addingcharacteristics
to theaccessory
. How would one find the setup code for that.