Incorrect Thermostat behavior in Mode Auto

Hi,

I’ve run into unexpected behavior: my thermostat with the Auto feature cannot set the heating temperature higher than the cooling temperature, even when it is currently switched to Heat-only mode.

I checked the driver, and there is indeed such a condition. But the Matter specification clearly says:

The specification explicitly states that the required gap between the heating and cooling setpoints must be maintained if and only if the AUTO feature is supported.

If a client sends a new setpoint that violates the deadband, the thermostat server does not reject the command but automatically adjusts the other setpoint:

  • When trying to raise OccupiedHeatingSetpoint too close to the cooling setpoint, the thermostat automatically increases OccupiedCoolingSetpoint.
  • When trying to lower OccupiedCoolingSetpoint too close to the heating setpoint, the thermostat automatically decreases OccupiedHeatingSetpoint.

So the driver slightly violates the Matter specification.

Details

  • Driver: matter-thermostat, src/thermostat_handlers/capability_handlers.lua, thermostat_set_setpoint_factory(). If the endpoint has the AUTOMODE feature, a heating setpoint above cached cooling setpoint − MinSetpointDeadBand is rejected locally ("Invalid setpoint (…) is greater than the cooling setpoint (…) with the deadband (…)"), the previous value is re-emitted and no write is sent to the device. The cooling setpoint has the mirror check.
    SmartThingsEdgeDrivers/drivers/SmartThings/matter-thermostat/src/thermostat_handlers/capability_handlers.lua at main · SmartThingsCommunity/SmartThingsEdgeDrivers · GitHub
  • Matter SDK: project-chip/connectedhomeip PR #35673 “[HVAC] Thermostat deadband handling” (merged 2024-11-14): instead of rejecting writes that violate the deadband, the server shifts the complementary setpoint and returns an error only if that would exceed the setpoint’s min/max limits.
    https://github.com/project-chip/connectedhomeip/pull/35673
  • Observed: Thermostat (0x0301) endpoint with AutoMode, MinSetpointDeadBand 2.5 °C, SystemMode Heat, heating 17.7 °C, cooling 20.4 °C. In the SmartThings app the heating setpoint could not be raised above 17.9 °C, and no write reached the device. A direct write of OccupiedHeatingSetpoint = 22.0 °C from another Matter controller was accepted by the device, which raised OccupiedCoolingSetpoint to 24.5 °C.
  • Request: send the setpoint write to the device instead of rejecting it in the driver, so the device can adjust the other setpoint as the specification describes.

Smartthings employees appear to not be monitoring the forum any longer. Suggest you either report it to customer support and/or file an issue against the driver here.

Thanks for letting me know. In any case, I’ve already submitted a pull request with the fix to this repository:

Unlikely that they will integrate your pull request. They normally only accept them from vendors with WWST certified products.

First of all: please tell us the manufacturer/vendor/model of your thermostat.

I agree with the underlying bug report: the current Matter Thermostat Edge driver rejects setpoint changes locally when they would violate the deadband relative to the cached complementary setpoint, without giving the Matter server an opportunity to apply the requested change.

There is one architectural aspect of the proposed fix that I think deserves reconsideration.

For a Thermostat endpoint advertising the AutoMode feature, the deadband constraint is:

OccupiedCoolingSetpoint - OccupiedHeatingSetpoint >= MinSetpointDeadBand

However, maintaining that invariant is fundamentally server-side behavior. In the Matter thermostat implementation, a valid write to OccupiedHeatingSetpoint can cause the server to raise OccupiedCoolingSetpoint as necessary; the inverse applies to a cooling-setpoint write! The change implemented in connectedhomeip PR #35673 explicitly handles this, subject to the effective setpoint limits. Your successful test using another Matter controller also demonstrates that your device already supports this behavior.

For your example (heating 17.7 °C, cooling 20.4 °C, deadband 2.5 °C), requesting a heating setpoint of 22.0 °C should therefore require one client write:

WRITE OccupiedHeatingSetpoint = 2200  // 22.00 °C

Expected server-side result, if within limits:
  OccupiedHeatingSetpoint = 2200       // 22.00 °C
  OccupiedCoolingSetpoint = 2450       // 24.50 °C

Rather than calculating the complementary setpoint in the Edge driver and issuing two separate writes, I would favor validating the requested setpoint against its own effective limits, sending that single write, and updating both SmartThings capabilities from subsequent Matter reports.

I see three reasons for preferring this approach:

  1. Non-atomic writes: The two writes proposed in the PR are independent Matter interactions. The complementary-setpoint write may succeed while the requested-setpoint write fails, producing a partial update. Sending them in order reduces transient deadband violations but does not provide transactional semantics.
  2. Stale state and multiple controllers: The driver calculates its adjustment from cached SmartThings state, which may no longer match the thermostat’s current values. For example, if SmartThings still caches a cooling setpoint of 21 °C while another Matter controller has already raised it to 27 °C, requesting 23 °C heating could cause the driver to lower cooling unnecessarily to 25.5 °C. The server can evaluate the request against its authoritative state instead.
  3. Endpoint isolation: The PR retains two of my issues. #3264 documents device-scoped setpoint limits/deadband that should be endpoint-scoped, while #3265 documents AutoMode detection based on whether any Thermostat endpoint supports the feature. These become especially consequential when the driver computes and writes a second setpoint on potentially multi-endpoint devices.

The revised handler could therefore preserve the existing limit validation but remove its cross-setpoint rejection for Auto-capable endpoints. The essential operation would be:

-- Resolve the Thermostat endpoint for the command component.
-- Validate the requested value against that endpoint's effective
-- heating or cooling limits, then let the server enforce the deadband.
device:send(setpoint:write(device, endpoint_id, st_utils.round(value * 100)))

Of course, some older or nonconforming thermostat servers may reject such writes instead of adjusting the other setpoint. I understand why the PR tries to accommodate them, particularly given the reported hub behavior with a multi-attribute write. Still, I would make single-write, server-managed adjustment the default and only consider a targeted compatibility workaround if we can identify devices that actually require it. Such a workaround would also need to account for failed/partial writes and stale complementary-setpoint data.

I would suggest adding tests for both deadband-crossing directions, the effective endpoint-specific limits, multi-endpoint feature detection, and a complementary setpoint changed by another Matter controller. The Edge driver should not optimistically emit either requested or calculated values; its displayed state should follow the device’s reports.

My concern is specifically with moving responsibility for deadband enforcement from the Matter server into the Edge driver, where it introduces additional state and synchronization risks.

The device is Atios KNX Bridge , a KNX-to-Matter bridge.

I fully agree with you that keeping the setpoints within the deadband is the job of the end device. I implemented the driver this way because these checks were already in this driver, and I think my approach may cause fewer problems. I agree that, according to the specification, these checks should be left to the end device, but I assumed that some devices may already work with and rely on the checks on the hub side, so changing this logic could break them. For example, a device that cannot move the setpoint by itself and only rejects the attribute write if the cooling temperature becomes lower than the heating temperature (as the current SmartThings thermostat driver does now).

You are right about stale state: the driver computes the other setpoint from the cached value, so if another controller has changed it in the meantime, the driver can move it unnecessarily. The current driver depends on the same cache, it just rejects instead of writing.

The PR does not emit the requested or calculated values; the displayed state follows the device’s reports. It only re-emits the cached value when a request is rejected locally, as the current driver does.

In any case, if the SmartThings reviewers on GitHub ask me to change the driver, I will do it, but I consider that approach risky and probably undesirable.