User Tools

Site Tools


zigbee

This is an old revision of the document!


Länkar

Specifikationer och dokument

Andra länkar

ESP specifika saker

Working examples

Adding multiple default configured endpoints (post esp-zigbee-sdk 1.2.0)

This adds two endpoints to the device. The can't be configured any further to my knowledge, but will just have default configured clusters with no possibility of configuration.

// Prepare cluster lists, in plural.
esp_zb_on_off_light_cfg_t light_config = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG();
esp_zb_cluster_list_t *light_cluster_list = esp_zb_on_off_light_clusters_create(&light_config); // This creates several clusters
esp_zb_endpoint_config_t light_ep_config = {
	.endpoint = 2,
	.app_device_id = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID,
	.app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
	.app_device_version = 1};
 
esp_zb_on_off_light_cfg_t light_config2 = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG();
esp_zb_cluster_list_t *light_cluster_list2 = esp_zb_on_off_light_clusters_create(&light_config2); // This creates several clusters
esp_zb_endpoint_config_t light2_ep_config = {
	.endpoint = 3,
	.app_device_id = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID,
	.app_profile_id = ESP_ZB_AF_HA_PROFILE_ID,
	.app_device_version = 1};
 
esp_zb_ep_list_t *endpoint_list = esp_zb_ep_list_create();
esp_zb_ep_list_add_ep(endpoint_list, light_cluster_list, light_ep_config);   // This adds the first bunch of clusters as an endpoint
esp_zb_ep_list_add_ep(endpoint_list, light_cluster_list2, light2_ep_config); // This adds the second bunch of clusters as an endpoint
 
esp_zb_device_register(endpoint_list); // This registers all created endpoints to the stack

Adding multiple default configured endpoints (pre esp-zigbee-sdk 1.2.0)

This adds two endpoints to the device. The can't be configured any further to my knowledge, but will just have default configured clusters with no possibility of configuration.

// Prepare cluster lists, in plural.
esp_zb_on_off_light_cfg_t light_config = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG();
esp_zb_cluster_list_t *light_cluster_list = esp_zb_on_off_light_clusters_create(&light_config); // This creates several clusters
 
esp_zb_on_off_light_cfg_t light_config2 = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG();
esp_zb_cluster_list_t *light_cluster_list2 = esp_zb_on_off_light_clusters_create(&light_config2); // This creates several clusters
 
esp_zb_ep_list_t *endpoint_list = esp_zb_ep_list_create();
esp_zb_ep_list_add_ep(endpoint_list, light_cluster_list, 2, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID); // This adds the first bunch of clusters as an endpoint
esp_zb_ep_list_add_ep(endpoint_list, light_cluster_list2, 15, ESP_ZB_AF_HA_PROFILE_ID, ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID); // This adds the second bunch of clusters as an endpoint
 
 
esp_zb_device_register(endpoint_list); // This registers all created endpoints to the stack
zigbee.1735853635.txt.gz · Last modified: 2025/01/02 21:33 by utedass

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki