[BUG] Thermostat cluster SetpointRaiseLower sometimes fails when mode is Both #31214
Labels
app-clusters
Application cluster work
bug
Something isn't working
hvac
needs triage
spec
Mismatch between spec and implementation
Reproduction steps
These correspond to that the heating should be turned on when the temperature gets below 20.00 degrees Celsius and cooling should be turned on when the temperature gets above 26.00 degrees Celcius.
The server app outputs:
This failure was discovered when trying to execute the test TC-TSTAT-3.2 by first increasing Both values by 12.7 degrees and then decreasing Both values by 12.7 degrees against the test harness.
The failure occurs in thermostat-server.cpp:
and
The problem is that it first tries to write the cooling attribute followed by the heating attribute in a non-atomic fashion. When both values are to be lowered at the same time, the condition that fails
(requested < OccupiedHeatingSetpoint + DeadBandTemp)
for the cooling setpoint should not be tested until both values have been written. Alternatively, I think it will also work if the attributes are written in reverse order when we decrease the values.Note that in order for the bug to trigger, initial values for the two attributes must be such that the condition will trigger. The default start-up values for the two example apps will make the bug trigger.
Also note that the second attribute will be written even if the first write failed, which is a bit strange.
Bug prevalence
Always
GitHub hash of the SDK that was being used
6ea3c34
Platform
core
Platform Version(s)
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: