Open Gazelle84 opened 3 weeks ago
@Gazelle84 ,
The code below registers five endpoints to the device. You can use it as a reference for your project.
esp_zb_on_off_switch_cfg_t switch_cfg = ESP_ZB_DEFAULT_ON_OFF_SWITCH_CONFIG();
esp_zb_ep_list_t *ep_list = esp_zb_ep_list_create();
for (int i = 0; i < 5; i++) {
esp_zb_endpoint_config_t endpoint_config = {
.endpoint = HA_ONOFF_SWITCH_ENDPOINT + i,
.app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
.app_device_id = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID,
.app_device_version = 0,
};
zcl_basic_manufacturer_info_t info = {
.manufacturer_name = ESP_MANUFACTURER_NAME,
.model_identifier = ESP_MODEL_IDENTIFIER,
};
esp_zb_ep_list_add_ep(ep_list, esp_zb_on_off_switch_clusters_create(&switch_cfg), endpoint_config);
esp_zcl_utility_add_ep_basic_manufacturer_info(ep_list, HA_ONOFF_SWITCH_ENDPOINT + i, &info);
}
esp_zb_device_register(ep_list);
Superb, thanks, i will give it a try and report back.
Doesnt work for me. I only see the first endpoint in coordinator app
Question
Hi, I’m trying to create multiple endpoints for an esp32-h2 and just cannot get more than one to register in zigbee2mqqt. I’m using the zigbee HA light example which works fine with the provided code. I have used the same code and some snippets to try and add a switch, which compiles but doesn’t register the switch.
if I comment out the light code, it builds and registers the switch, but with both there it only registers the light.
Do I need to create a list of endpoints and register the list? Or do I register them individually? I have tried numbering them from 1 and it behaves the same.
I want to connect around 5 devices to the gpio pins and control them individually. They will be a simple on/off switch. I can’t find any example where multiple endpoints are registered.