Closed cab113 closed 4 years ago
Hi, @cab113,
To add your own accessories, just do the following things:
In ir_hub/accessories/, create a pair of .c/.h for your own accessory, for example, panasonic_ac.c and panasonic_ac.h.
The only function you need to expose is the initialization function (panasonic_ac_init(homekit_accessory_t* accessory);
in panasonic_ac). In the init function, you need to create services and characteristics for your device. Read Apple’s HomeKit Accessory Protocol Specification for more details.
When you create the characteristics, you may need to create some callback functions, for example, to transmit some IR codes when turn on/off is received. Here’s some transmit functions in transmit.c, you can call them or write your own transmit function.
Call your init function in homekit_task.c, like this:
homekit_add_accessory(&homekit_server_config, NEW_HOMEKIT_ACCESSORY());
panasonic_ac_init(homekit_server_config.accessories[1]);
You can make Pull Request if you would like to share your accessories with us.
The issue is now closed. You can re-open it at any time if you still have the issue.
Hi, thank you for this project, would you please explain how i can create and add custom accessory, i want to make a remote Carrier heat pump?