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

changing names for the app (CON-1610) #1339

Open
ravencarcass opened this issue Mar 23, 2025 · 4 comments
Open

changing names for the app (CON-1610) #1339

ravencarcass opened this issue Mar 23, 2025 · 4 comments

Comments

@ravencarcass
Copy link

I have a question about how to change the display of a product in the google home app or other apps. I have a total of 12 endpoints and would like to change the names from “test_product (X)” to another name. Is there any way to do this? Because it irritates me sometimes that I don't know which button is for which output.

Image

@github-actions github-actions bot changed the title changing names for the app changing names for the app (CON-1610) Mar 23, 2025
@Jerry-ESP
Copy link
Contributor

I think you can refer to this example: https://github.com/espressif/esp-matter/blob/main/examples/generic_switch/main/app_main.cpp to use the tag-list attribute in the descriptor cluster to identify every endpoint function.

@ravencarcass
Copy link
Author

I will try it. Thx for the help.

@ravencarcass
Copy link
Author

After took a look to the code but I don't see it how I can relise it. This is my code at the moment:

static const char *TAG = "app_main";
uint16_t light_endpoint_id = 0;
uint16_t light_endpoint_id_1 = 1;
uint16_t light_endpoint_id_2 = 2;
uint16_t light_endpoint_id_3 = 3;
uint16_t light_endpoint_id_4 = 4;
uint16_t light_endpoint_id_5 = 5;
uint16_t light_endpoint_id_6 = 6;
uint16_t light_endpoint_id_7 = 7;
uint16_t light_endpoint_id_8 = 8;
uint16_t light_endpoint_id_9 = 9;
uint16_t light_endpoint_id_10 = 10;
uint16_t light_endpoint_id_11 = 11;

node::config_t node_config;

    // node handle can be used to add/modify other endpoints.
    node_t *node = node::create(&node_config, app_attribute_update_cb, app_identification_cb);
    ABORT_APP_ON_FAILURE(node != nullptr, ESP_LOGE(TAG, "Failed to create Matter node"));

    /*extended_color_light::config_t light_config;
    light_config.on_off.on_off = DEFAULT_POWER;
    light_config.on_off.lighting.start_up_on_off = nullptr;
    light_config.level_control.current_level = DEFAULT_BRIGHTNESS;
    light_config.level_control.on_level = DEFAULT_BRIGHTNESS;
    light_config.level_control.lighting.start_up_current_level = DEFAULT_BRIGHTNESS;
    light_config.color_control.color_mode = (uint8_t)ColorControl::ColorMode::kColorTemperature;
    light_config.color_control.enhanced_color_mode = (uint8_t)ColorControl::ColorMode::kColorTemperature;
    light_config.color_control.color_temperature.startup_color_temperature_mireds = nullptr;*/

    dimmable_light::config_t light_config;
    light_config.on_off.on_off = DEFAULT_POWER;
    light_config.level_control.current_level = DEFAULT_BRIGHTNESS;
    light_config.level_control.on_level = DEFAULT_BRIGHTNESS;
    light_config.level_control.lighting.start_up_current_level = DEFAULT_BRIGHTNESS;

    // endpoint handles can be used to add/modify clusters.
    endpoint_t *endpoint = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id);

///////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_1 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_1);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_1);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_2 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_2);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_2);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_3 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_3);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_3);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_4 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_4);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_4);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_5 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_5);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_5);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_6 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_6);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_6);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_7 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_7);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_7);

//////////////////////////////////////////////////////////////////////////

    endpoint_t *endpoint_8 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
    ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

    light_endpoint_id = endpoint::get_id(endpoint_8);
    ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_8);

//////////////////////////////////////////////////////////////////////////

endpoint_t *endpoint_9 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

light_endpoint_id = endpoint::get_id(endpoint_9);
ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_9);

//////////////////////////////////////////////////////////////////////////

endpoint_t *endpoint_10 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

light_endpoint_id = endpoint::get_id(endpoint_10);
ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_10);

//////////////////////////////////////////////////////////////////////////

endpoint_t *endpoint_11 = dimmable_light::create(node, &light_config, ENDPOINT_FLAG_NONE, light_handle);
ABORT_APP_ON_FAILURE(endpoint != nullptr, ESP_LOGE(TAG, "Failed to create extended color light endpoint"));

light_endpoint_id = endpoint::get_id(endpoint_11);
ESP_LOGI(TAG, "Light created with endpoint_id %d", light_endpoint_id_11);

//////////////////////////////////////////////////////////////////////////

@Jerry-ESP
Copy link
Contributor

You just need to define the taglist and set it to every endpoint

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