-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Summary
When a Matter controller sends a SetActivePresetRequest command to a thermostat, the ActivePresetHandle attribute is correctly updated on the device side (confirmed via a subsequent read), but no subscription report is sent to notify subscribers of the change. This means controllers relying on subscriptions (such as python-matter-server / Home Assistant) never learn about the new value unless they explicitly poll the attribute.
Root cause
In thermostat-server-presets.cpp, SetActivePreset() calls delegate->SetActivePresetHandle() but does not call MatterReportingAttributeChangeCallback afterwards to mark the attribute as dirty:
Status ThermostatAttrAccess::SetActivePreset(EndpointId endpoint, DataModel::Nullable<ByteSpan> presetHandle)
{
// ...
CHIP_ERROR err = delegate->SetActivePresetHandle(presetHandle);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Failed to set ActivePresetHandle with error %" CHIP_ERROR_FORMAT, err.Format());
return StatusIB(err).mStatus;
}
return Status::Success;
// ← MatterReportingAttributeChangeCallback(..., ActivePresetHandle::Id) is missing here
}Expected behavior
After a successful SetActivePresetHandle, the framework should be notified that ActivePresetHandle has changed, so that all active subscriptions receive a Report Data message with the new value.
Proposed fix
Add a call to MatterReportingAttributeChangeCallback after the delegate call succeeds:
CHIP_ERROR err = delegate->SetActivePresetHandle(presetHandle);
if (err != CHIP_NO_ERROR)
{
ChipLogError(Zcl, "Failed to set ActivePresetHandle with error %" CHIP_ERROR_FORMAT, err.Format());
return StatusIB(err).mStatus;
}
MatterReportingAttributeChangeCallback(endpoint, Thermostat::Id, ActivePresetHandle::Id);
return Status::Success;- Commission a thermostat supporting the Presets feature (e.g. Eve Thermo, or the Linux thermostat example)
- Subscribe to
ActivePresetHandle(attribute0x004E, cluster0x0201) - Send
SetActivePresetRequestwith a valid preset handle - Observe: no subscription report is received, even after several minutes
- Send a
read active-preset-handle→ the new value is returned correctly
Impact
Any Matter controller using subscriptions (the standard approach) will never receive the updated ActivePresetHandle value after a SetActivePresetRequest. Workarounds such as optimistic local state updates are required on the controller side to maintain a consistent UI.
Confirmed against: Linux thermostat example (examples/thermostat/linux) and Eve Thermo hardware.
Bug prevalence
always
GitHub hash of the SDK that was being used
Platform
linux
Platform Version(s)
No response
Anything else?
No response