If a Temperature Sensor Goes Offline, Should the Underfloor Heating Keep Running?

A displayed temperature can be stale. Separate sample freshness, MQTT replay, hysteresis and local fallback, with ten reproducible supervisory-control checks.

At 10 p.m., the living room’s wireless temperature sensor last reported 20°C, while the target temperature was 22°C. Then the sensor’s battery died, but the central control page still displayed 20°C. An automation that “requests heat when the temperature is below the target” might keep concluding that the room is not warm enough.

The question is not whether the temperature reading looks reasonable. It is: Is that reading still valid for use in control?

Continuing the earlier plan for a five-story unfinished villa, I would leave local temperature control and protection to the manufacturer’s thermostats, while using central control for schedules, zone settings, and comfort optimization. If a wireless sensor goes offline, the priority is to withdraw the higher-level adjustments that depend on it and return to local control according to a previously validated plan. “Withdraw” does not mean cutting power to the entire underfloor heating system, nor does it mean every room should continue heating.

For this article, I checked the official Home Assistant documentation and ran a state-machine model that depends only on the Python standard library. It checks the logic of data validity periods and control requests. It was not connected to underfloor heating, did not run a Home Assistant instance or measure room temperature, and does not establish energy savings or equipment safety.

1. Determine Who Controls the Feedback Loop Before Deciding What Happens When a Sensor Goes Offline

Raising the temperature by two degrees on a phone can correspond to two fundamentally different systems underneath.

In the first, central control sends a target temperature to the manufacturer’s thermostat, which uses its own valid probe to decide whether to actuate a valve or heating output. Whether the equipment continues working to that setting after central control loses connectivity depends on the thermostat, its wiring, and its configuration.

In the second, a wireless probe sends temperature readings to Home Assistant; central control compares the temperature and operates a load through a switch. Home Assistant’s Generic Thermostat is an integration that implements temperature control using a sensor and a switch. Having “thermostat” in its name does not automatically make it equivalent to a wall-mounted device with an independent probe and protection chain.[1]

The two systems have different failure paths. The first may lose remote optimization while retaining a local feedback loop. In the second, the probe, battery, wireless link, gateway, central controller, and actuator interface may all become necessary parts of the temperature-control path. Asking only “Does it support Matter?” during procurement cannot answer these questions.

For this five-story home, I would first confirm each zone’s manufacturer-provided local feedback loop, probe-fault handling, overtemperature limit, and frost-protection strategy before considering an external wireless probe. If the local controller itself depends on the same probe that has gone offline, “return to local control” cannot be written into the plan as a fallback. Nor can the heat source, circulation pump, zone valves, and electric heating loads in an underfloor heating system be treated as one generic switch. Which request to withdraw and which protections to preserve must be specified in the HVAC and electrical design.

2. An Unchanged Temperature Does Not Mean the Sensor Has Stopped Reporting

A room might stay at 21°C for half an hour. If the sensor measures and reports 21°C every minute, those are continuing new observations. If the sensor’s battery died half an hour ago and the page merely retains 21°C, that is an old observation. The temperature graphs could look identical.

The three timestamps on a Home Assistant state object need to be understood separately.[2][3]

Field General meaning Does it directly prove the physical probe just took a sample?
last_changed When the state value last changed No; sampling may continue even when the temperature does not change
last_updated When the state value or attributes last changed No; a change to an attribute such as battery level may also update it
last_reported When the integration last wrote the entity’s state to the state machine Not on its own; it depends on what prompted the integration to write it

The official documentation also notes that some integrations omit state writes for duplicate values. Thus, even if a device sends the same value again, last_reported may not change with every device report. Conversely, if a gateway repeatedly reports a cached value, a “new write” received by the state machine does not establish that the probe made a “new measurement.”

Acceptance testing therefore needs to ask: Does the timestamp come from sampling at the device, packet receipt at the gateway, or a platform refresh? Does a report include a sampling time or sequence number? Is the same temperature reported periodically? If the device reports only when the value changes, is there another way to establish that the probe and measurement path are still working? Without that information, a template alone cannot justify a claim that offline protection is complete.

3. Write Down the Freshness Budget, Not Just a Timeout in Seconds

The age of data has at least two parts: how old the sample already was when it reached the controller, and how much time has passed since the controller received it. For a data source whose time semantics have been validated, this can be expressed as:

Current sample age = age on arrival + time elapsed since receipt
Eligible for control: current sample age < validity period

For example, suppose the validity period is 180 seconds. If a reading was sampled 120 seconds before it arrived, it has at most 60 seconds of useful life left; it does not get a new 180-second period. In this article, a sample is also considered invalid at the exact moment it expires, to avoid ambiguity at the boundary.

This calculation has prerequisites: device times must be comparable, or the adapter must be able to estimate the sample’s age on arrival reliably. An unsynchronized device clock, an unidentifiable cached reading, or a sequence number reused after a reset can all invalidate those prerequisites. A local monotonic clock can measure elapsed time, but it cannot directly compare clocks on two machines, and a timing value from a previous process cannot simply be reused after that process restarts.

The 180 seconds is only a parameter in a software experiment, not a purchasing standard for all wireless probes. Suppose a product guarantees a maximum reporting interval of 60 seconds, the project decides to tolerate one missed report, and 30 seconds is reserved for scheduling and transmission. Then 150 seconds could be a starting point for testing. Sleep behavior, the actual longest interval, and fault-detection requirements would still need checking. A product that reports only when temperature changes and offers no reliable evidence that it is still operating does not meet the prerequisites for this calculation.

A sensor being online does not prove its temperature is correct: the probe might drift, come loose, or get stuck at one value. Freshness checks address only part of the problem of “old data still controlling the system.” Installation position, calibration, and anomalous-value handling need separate validation; a shorter timeout cannot replace them.

4. MQTT Expiration Settings Help, but Do Not Block Every Old Message

Home Assistant’s MQTT Sensor provides expire_after: if no update arrives within the specified number of seconds, the entity becomes unavailable. The default is 0, meaning it does not expire automatically by default.[4] This is one mechanism that can be used.

But the official documentation also warns that if a state message is retained by the MQTT Broker, Home Assistant will receive the last retained value when it restarts or reloads. This can make an expired state appear available again, so retaining messages for this kind of sensor state is not recommended. The documentation also says Home Assistant itself saves state relevant to restoration and calculates the remaining validity time.[4]

At least three cases must be distinguished: a genuinely new sample, an old sample arriving after a network delay, and a retained message replayed after reconnection. Restarting a timer merely because “a message arrived” treats all three as the same thing. A device’s sampling sequence number, time information, and session identifier can help distinguish them, but whether a product supplies them and whether they can be trusted must be checked.

Likewise, a Broker connection being online only proves that one part of the communication path is still active. A gateway sending heartbeats does not mean a downstream temperature probe is still measuring. Do not substitute the gateway’s online status for the data quality of each critical probe.

Generic Thermostat’s keep_alive serves a different purpose again: it periodically triggers the switch according to the current thermostat state.[1] It does not determine whether a temperature sample is fresh. Adjusting hysteresis, cycle duration, or keep-alive cannot replace a data-quality check. How a particular version and combination of integrations responds to unavailable should be verified on an isolated test setup; this article does not assume every version will automatically stop its output.

5. The Offline Policy Should Be a Set of State Transitions

My design would divide higher-level optimization into three states: “waiting for a valid observation,” “optimization permitted,” and “paused and reverted.” On startup, it waits. Optimization is permitted only after a verifiably new observation arrives. When data expires, is invalid, or an operator pauses the system, the optimization request is withdrawn.

The optimization request might, for example, be “permit comfort adjustments using an external probe.” After it is withdrawn, the manufacturer’s controller’s local target, whether frost protection remains active, and how abrupt changes are avoided must all be agreed in advance. If a controller accepts only one persistent target temperature, then after central control writes 26°C, simply ceasing to send messages will not automatically restore 22°C. Stopping messages and withdrawing a command that has already taken effect are two different things.

For systems with a suitable interface, a time-limited temporary override is worth considering: the receiving device applies the higher-level request only for its validity period, then follows a configured local policy when it expires. That way, even if the entire central-control process stops, expiration does not depend on central control running.

But a “lease” is not a universal capability of Matter thermostats, Mesh gateways, or relays. If a device has no receiving-side timer and fallback interface, a delayed task in central control cannot be presented as though it provides one. In that case, use a local-control method the device actually supports, or choose a controller that explicitly supports the required capability. Simulating fallback by cutting power to the whole unit could also disrupt circulation, protection, and frost prevention; it should not be the default approach.

Recovery needs rules too. At startup, the host must not treat an old temperature in its database as a new report. A device reconnecting must not immediately replay every old target. After a manual disable, receipt of another low-temperature reading should not restore the optimization on its own. Recovery authorization, sample validity, and actuator state need to be checked separately.

6. Hysteresis Handles Chatter; Data Validity Handles Loss of Contact

Suppose the target is 22°C. The model requests heat at or below 21.7°C, withdraws the request at or above 22.3°C, and retains the existing request between those thresholds. This is the article’s symmetric hysteresis model: its thresholds and comparison operators are explicit modeling choices, not a claim about how every thermostat works.

Feed the model 21.6, 21.9, 22.1, 21.9, 22.3, and 22.1°C in sequence, and the outputs are “request, request, request, request, withdraw, withdraw.” Temperature fluctuating near the target does not cause a switch every time it crosses 22°C.

But if the last reading is 21.6°C and the probe then goes offline, hysteresis will keep the existing request. Hysteresis does not know that the reading has expired. Observation validity therefore needs to be checked before normal temperature-control logic runs.

Underfloor heating also has thermal inertia, valve actuation times, and constraints such as a heat source’s minimum run time. This article does not prescribe equipment settings by saying “set the hysteresis to 0.3°C,” nor does it claim that doing so saves energy. The priority relationship between minimum run times in normal control and protection or fallback during faults must be determined by the specific equipment and system design.

7. What Did the Model Run Actually Verify?

I put the logic above into a Python program that does not interact with equipment. Its inputs are manually constructed sampling events and times; its output indicates whether a higher-level request is valid. The program does not simulate water temperature, thermal inertia, network protocols, or real valves. Run it with:

python3 freshness_model.py

The source and results are available for download: state-machine program and results from this run. All 10 checks passed. The most important are listed below.

Constructed input Actual software result What it shows
New 20°C samples received at seconds 0, 60, and 120; validity period 180 seconds Request permitted at second 250; invalid at second 300 New samples with the same value can extend validity
Sample taken at second 0; cache merely replayed at second 170 Invalid at second 180 Replay did not extend validity
New-sequence-number report of 23°C, followed by an old-sequence-number report of 20°C Old sequence number rejected; no request generated Out-of-order reports within one session do not overwrite a new observation
At second 100, a sample arrives that is already 120 seconds old Expiration time is second 160 Receipt time is not sampling time
Local receiving side obtains a 90-second temporary request at second 0; central control does not run afterward Temporary request expires at second 90 With local timing capability, expiration does not require another message from central control
Sample expires at second 180; an attempt is made at second 170 to renew the request for 90 seconds Request still expires at second 180 Renewal cannot extend beyond the observation’s validity period

Four other checks cover invalid values and ages, the hysteresis sequence, a new sample arriving after manual disablement, and a cached reading being unable to activate a request after a restart. The program’s “local receiving side” is only a software object, not evidence that any particular hardware supports leases.

The model also makes deliberate simplifications: the adapter supplies a trustworthy sample age; all events use one synthetic monotonic timeline; sequence numbers are compared only within a confirmed device session; and execution messages are delivered immediately and in order. Real products must also handle sequence numbers resetting after a device restart, clock discrepancies across machines, delayed and out-of-order commands, lost acknowledgments, and old commands from before a restart. The program in this article cannot be used directly to control underfloor heating.

8. Turn Purchasing Questions Into Testable Acceptance Criteria

In engineering terms, it is more useful to ask whether a supplier can explain offline behavior down to the device and interface level than to watch a demonstration of temperature adjustment from a phone.

Requirement Test setup acceptance method Unacceptable substitute for evidence
Detect loss of contact with each critical probe Separately stop sampling, block reports, and keep the gateway online; record state changes Unplugging the internet cable once
Establish that a sensor remains active even at an unchanged temperature Keep measurement conditions stable; inspect actual reports and the meaning of their timestamps Looking only at whether the graph is flat
Prevent old messages from restoring control eligibility Simulate retained-message replay, delay, and out-of-order delivery in an isolated environment Testing only normal real-time reporting
Define behavior after central control stops Stop central control after a request takes effect; inspect the receiving side and local thermostat A “turn off later” task in central control
Give manual intervention and recovery defined priorities After manually pausing, restore the network and restart central control; check whether the pause is overridden Checking only that the device is online after recovery

Each test should record, at a minimum, the device and firmware versions, control mode, probe source, reporting interval, data expiration time, request withdrawal time, actuator state, and on-site observations. A valve’s logical state, its mechanical position, circulating water flow, and room temperature are not the same quantity. Acceptance testing must state which layer was actually measured.

Fault injection should start on a test setup without a real heating load connected. Verification involving the heat source, pump, valves, electric heating, or protection chain should be conducted by the relevant professionals according to the product procedures. The purpose is not to force a conclusion that “always cutting power after a sensor goes offline is correct,” but to confirm that the selected degraded-mode policy can be carried out without undermining the system’s own protective responsibilities.

9. How I Would Implement This in the Five-Story Home

First, I would list the relationship between “local thermostat, local probe, actuator, and protection logic” for each room and HVAC zone. Then I would list what the higher-level wireless probes and central control can and cannot change. One gateway per floor does not prove that each floor has independent temperature control, and protocol interoperability does not replace this control-relationship diagram.

Next, I would choose one representative zone for a test setup. I would first establish that the manufacturer’s local feedback loop behaves as agreed while central control is offline, and only then add external optimization. I would not copy the same automation across all five floors until the sensor, interface, and fault policy had been validated. The budget should retain the cost of manufacturer-provided control and test setup verification, rather than comparing only wireless probe prices.

Finally, I would put three settings in the handover materials: when data expires; how a higher-level request is withdrawn and who times it; and exactly what the local device does after withdrawal. Without the third, “automatically turns off when offline” may be no more than interface text. Without the second, it cannot even be carried out when central control crashes.

Following villa gateway capacity design and whole-home fault acceptance testing, this article addresses a more specific question: Give every temperature reading a validity period, and give the control authority it receives an exit condition. A temperature-control system that can be maintained over the long term should be able to explain both when it trusts data and how it hands back control when that basis is lost.

Sources checked on: 2026-11-16. The strategies, time parameters, and state machine in this article are design examples. The official documentation is used to explain the relevant platform mechanisms; it does not represent hardware test results.

  1. Home Assistant: Generic Thermostat, the sensor-and-switch structure and the roles of hysteresis and keep_alive.
  2. Home Assistant: State and state object, the three state timestamps and limitations of integration writes.
  3. Home Assistant: New state timestamp State.last_reported, 2024-03-20, the design background for state writes and duplicate-value events.
  4. Home Assistant: MQTT Sensor, the boundaries of expire_after, the default of no expiration, retained messages, and state restoration.

AI-generated scene illustration, not a photograph of this project or a wiring instruction.

Discussion

Share a question or your experience. Comments appear after moderation. Your email is never displayed publicly. Comment privacy

Loading comments…