Summary
The Thermostat cluster server does not update the three SetpointChange tracking attributes when a setpoint write occurs:
| Attribute |
ID |
Type |
SetpointChangeSource |
0x0030 |
SetpointChangeSourceEnum |
SetpointChangeAmount |
0x0031 |
int16s (nullable) |
SetpointChangeSourceTimestamp |
0x0032 |
epoch_s |
According to the Matter specification (section 4.3.9), these attributes shall be updated whenever OccupiedHeatingSetpoint, OccupiedCoolingSetpoint, UnoccupiedHeatingSetpoint, or UnoccupiedCoolingSetpoint is written.
Expected behavior
After a write to one of the four setpoint attributes:
SetpointChangeAmount is set to new_value − previous_value.
SetpointChangeSourceTimestamp is set to the current CHIP epoch time.
SetpointChangeSource reflects who triggered the change:
Manual (default) when no delegate override is present.
Schedule or External when the application delegate signals so.
Proposed solution
- Add a
GetSetpointChangeSource() virtual method to ThermostatDelegate (default returns Manual) so applications can report the source.
- Save the pre-change value in
MatterThermostatClusterServerPreAttributeChangedCallback (if validation succeeds).
- In
MatterThermostatClusterServerAttributeChangedCallback, compute and write the three attributes using the saved value.
- Enable the three attributes (RAM storage) in the thermostat example ZAP configuration and regenerate the
.matter file.
Related PR
A first implementation of this feature was proposed in #43643, but the thermostat cluster server has since been refactored (split into ThermostatCluster.cpp, ThermostatClusterPresets.cpp, etc.), so a fresh port is needed.
Testing
Summary
The Thermostat cluster server does not update the three SetpointChange tracking attributes when a setpoint write occurs:
SetpointChangeSourceSetpointChangeSourceEnumSetpointChangeAmountint16s(nullable)SetpointChangeSourceTimestampepoch_sAccording to the Matter specification (section 4.3.9), these attributes shall be updated whenever
OccupiedHeatingSetpoint,OccupiedCoolingSetpoint,UnoccupiedHeatingSetpoint, orUnoccupiedCoolingSetpointis written.Expected behavior
After a write to one of the four setpoint attributes:
SetpointChangeAmountis set tonew_value − previous_value.SetpointChangeSourceTimestampis set to the current CHIP epoch time.SetpointChangeSourcereflects who triggered the change:Manual(default) when no delegate override is present.ScheduleorExternalwhen the application delegate signals so.Proposed solution
GetSetpointChangeSource()virtual method toThermostatDelegate(default returnsManual) so applications can report the source.MatterThermostatClusterServerPreAttributeChangedCallback(if validation succeeds).MatterThermostatClusterServerAttributeChangedCallback, compute and write the three attributes using the saved value..matterfile.Related PR
A first implementation of this feature was proposed in #43643, but the thermostat cluster server has since been refactored (split into
ThermostatCluster.cpp,ThermostatClusterPresets.cpp, etc.), so a fresh port is needed.Testing
OccupiedCoolingSetpointorOccupiedHeatingSetpoint.SetpointChangeAmountreflects the correct delta (new − previous value).SetpointChangeSourceTimestampis set to the current CHIP epoch time.SetpointChangeSourcedefaults toManualwhen no delegate is set.GetSetpointChangeSource().