Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple endpoint with thermostat and on off switch in Homekit not working (CON-1322) #1071

Open
dzungpv opened this issue Sep 1, 2024 · 1 comment

Comments

@dzungpv
Copy link

dzungpv commented Sep 1, 2024

In Homekit I can create multiple node in master node, but I read from this #1304 can only add multiple endpoint to a single node.
So I add 1 thermostat and 2 on off switch (to simulate dry and fan mode) like this:

    /* Create a Matter node and add the mandatory Root Node device type on endpoint 0 */
    node::config_t node_config;

    // node handle can be used to add/modify other endpoints.
    node_t *node = node::create(&node_config, app_matter_attribute_update_cb, app_matter_identification_cb);
    ABORT_APP_ON_FAILURE(node != nullptr, ESP_LOGE(TAG, "Failed to create Matter node"));
    // Add enpoint to the node
    thermostat::config_t thermostat_config;
    thermostat_config.thermostat.local_temperature = 1900;  // 19 degree
    thermostat_config.thermostat.system_mode = 0;           // OFF state
    endpoint_t *thermostat_endpoint = thermostat::create(node, &thermostat_config, ENDPOINT_FLAG_NONE, NULL);

    thermostat_endpoint_id = endpoint::get_id(thermostat_endpoint);
    ESP_LOGI(TAG_MATTER, "Thermostat endpoint_id = %" PRIu32, static_cast<uint32_t>(thermostat_endpoint_id));

    // Switch for dry mode
    on_off_switch::config_t dry_switch_config;
    endpoint_t *dry_endpoint = on_off_switch::create(node, &dry_switch_config, ENDPOINT_FLAG_NONE, NULL);
    ABORT_APP_ON_FAILURE(dry_endpoint != nullptr, ESP_LOGE(TAG, "Failed to create on off switch endpoint"));

    // Add group cluster to the dry switch endpoint
    cluster::groups::config_t groups_config_d;
    cluster::groups::create(dry_endpoint, &groups_config_d, CLUSTER_FLAG_SERVER | CLUSTER_FLAG_CLIENT);

    dry_switch_endpoint_id = endpoint::get_id(dry_endpoint);
    ESP_LOGE(TAG, "Dry Switch created with endpoint_id %d", dry_switch_endpoint_id);

    // Switch for fan mode
    on_off_switch::config_t fan_switch_config;
    endpoint_t *fan_endpoint = on_off_switch::create(node, &fan_switch_config, ENDPOINT_FLAG_NONE, NULL);
    ABORT_APP_ON_FAILURE(dry_endpoint != nullptr, ESP_LOGE(TAG, "Failed to create on off switch endpoint"));

    // Add group cluster to the dry switch endpoint
    cluster::groups::config_t groups_config_f;
    cluster::groups::create(fan_endpoint, &groups_config_f, CLUSTER_FLAG_SERVER | CLUSTER_FLAG_CLIENT);

    fan_switch_endpoint_id = endpoint::get_id(fan_endpoint);
    ESP_LOGE(TAG, "Fan Switch created with endpoint_id %d", fan_switch_endpoint_id); 

But when I add it to homekit, only thermostat device appear, could not see on off switch enywhere

@github-actions github-actions bot changed the title Multiple endpoint with thermostat and on off switch in Homekit not working Multiple endpoint with thermostat and on off switch in Homekit not working (CON-1322) Sep 1, 2024
@pimpalemahesh
Copy link
Contributor

We are working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants