espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
178 stars 31 forks source link

Properly setting up Manufacturer and Model (TZ-1185) #441

Closed aknarts closed 2 months ago

aknarts commented 2 months ago

Question

I am having bit of a trouble with setting up my manufacturer and model and having Zigbee2MQTT recognize it properly.

For some reason the name is reported in wrong.

Here is my general code around that part

#define MANUFACTURER_NAME               "\x06""Acheta"
#define MODEL_IDENTIFIER                "\x0C""Depth.Sensor"

static esp_zb_cluster_list_t *
custom_distance_sensor_clusters_create(esp_zb_analog_output_cluster_cfg_t *distance_sensor)
{
    esp_zb_cluster_list_t *cluster_list = esp_zb_zcl_cluster_list_create();

    esp_zb_basic_cluster_cfg_t basic_cfg =
            {
                    .zcl_version = ESP_ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE,
                    .power_source = ESP_ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE,
            };
    esp_zb_attribute_list_t *basic_cluster = esp_zb_basic_cluster_create(&basic_cfg);
    ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MANUFACTURER_NAME_ID,
                                                  MANUFACTURER_NAME));
    ESP_ERROR_CHECK(esp_zb_basic_cluster_add_attr(basic_cluster, ESP_ZB_ZCL_ATTR_BASIC_MODEL_IDENTIFIER_ID,
                                                  MODEL_IDENTIFIER));
    ESP_ERROR_CHECK(
            esp_zb_cluster_list_add_basic_cluster(cluster_list, basic_cluster, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE));

What I did try so far is to erase the flash, erase the partitions, move to a different cluster.

For whatever reason z2m still sees the old cluster and the name is reported wrong.

[2024-09-27 12:07:35] debug:    zh:ember:ezsp: ezspIncomingMessageHandler(): callback called with: [type=UNICAST], [apsFrame={"profileId":0,"clusterId":32772,"sourceEndpoint":0,"destinationEndpoint":0,"options":3392,"groupId":0,"sequence":200}], [packetInfo:{"senderShortId":30904,"senderLongId":"0xFFFFFFFFFFFFFFFF","bindingIndex":255,"addressIndex":255,"lastHopLqi":160,"lastHopRssi":-60,"lastHopTimestamp":0}], [messageContents=4800b87810010401f2ff0003000003000d00010300]
[2024-09-27 12:07:35] debug:    zh:ember: <~~~ [ZDO SIMPLE_DESCRIPTOR_RESPONSE from=30904 {"nwkAddress":30904,"endpoint":1,"profileId":260,"deviceId":65522,"deviceVersion":0,"inClusterList":[0,3,13],"outClusterList":[3]}]
[2024-09-27 12:07:35] debug:    zh:controller:device: Interview - got simple descriptor for endpoint '1' device '0x543204fffe073044'
[2024-09-27 12:07:35] debug:    zh:controller:device: Interview - completed for device '0x543204fffe073044'
[2024-09-27 12:07:35] debug:    zh:controller:database: Writing database to '/config/zigbee2mqtt/database.db'
[2024-09-27 12:07:35] info:     zh:controller: Succesfully interviewed '0x543204fffe073044'
[2024-09-27 12:07:35] info:     z2m: Successfully interviewed '0x543204fffe073044', device has successfully been paired
[2024-09-27 12:07:35] warning:  z2m: Device '0x543204fffe073044' with Zigbee model 'DepthSe' and manufacturer name 'Acheta�es' is NOT supported, please follow https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

I am happy to provide any additional info but I am lost now.

Additional context.

Please ignore the crude code, I am trying stuff and breaking stuff in this but the current state of my code is here: https://github.com/aknarts/depth_sensor

No response

aknarts commented 2 months ago

I am now fairly certain the issue is somewhere on the network/z2m side, I did load the HA temperature sensor example and that did not update the manufacturer either.

aknarts commented 2 months ago

Tried on my second esp32c6 chip and there it works just fine, so the code is not the problem. How do I properly remove a device from zigbee network and z2m?

aknarts commented 2 months ago

Closing this, wiped the mqtt out of the face of the earth, and reinstalled it... It was somehow somewhere cashing the data and I could not find it.