Skip to content

CommodityPrice server not initialized in all_device_types_app (TariffUnit read fails) (CON-1911) #1641

@lboue

Description

@lboue

Describe the bug
Creating electrical_energy_tariff via all_device_types_app adds the CommodityPrice cluster without a delegate. The server instance never registers AttributeAccess, so reading TariffUnit (0x0000) fails with InteractionModelError: Failure (0x1).

  • Steps to Reproduce:
    1. Build/flash all_device_types_app (esp32c6 in my case).
    2. In the device console: create --device_type=electrical_energy_tariff.
    3. From chip-tool: chip-tool commodityprice read tariff-unit 1 1.
  • Expected: TariffUnit returns a valid enum value.
  • Actual: Read returns InteractionModelError: Failure (0x1).
  • Suspected Cause: In esp_matter_console_helpers.cpp, cluster::commodity_price::config_t is created without setting delegate, so CommodityPrice::Instance isn’t constructed and its AttributeAccess isn’t registered. No default TariffUnit is set.
  • Suggested Fix: Provide a CommodityPrice::Delegate when creating the cluster and set a default TariffUnit (e.g., TariffUnitEnum::kKWh) after creation so reads succeed immediately.
  • Workaround: Patch the example to set the delegate and write TariffUnit once the cluster is created.

Environment

  • ESP-Matter Commit Id: be8d1e7

  • ESP-IDF Commit Id:

  • SoC (eg: ESP32 or ESP32-C3): ESP32-C6

  • Device Logs (Please attach the log file):

  • Host Machine OS:

  • Host Machine Python version:

  • Commissioner app and versions if present:

  • Home hub app and versions if present:

  • Commissioner's logs if present:

Any additional details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions