Stop Freezing in the Dark: Build Unbreakable Sensors with the Failover Blueprint
A smart climate setup is a massive quality of life upgrade right until the tiny wireless sensor feeding it drops off your network.
Picture your bedroom on a cold night. Your automation fires up the space heater when the room drops below 18°C (64°F) and shuts it off at 20°C (68°F). At 1:00 AM, the Zigbee temperature sensor on your nightstand runs out of battery. The state flips to unavailable. Your automation goes blind. The heater keeps pumping out heat because the "shut off" threshold is never reached. You wake up three hours later trapped in a sauna.
Automations are incredibly literal. They trust a single source of truth. When that source vanishes, the logic breaks.
Sensor Failover fixes this by building a hierarchy of trust. You point the blueprint at your primary sensor. You give it a list of backups. It wraps them all into a single, unbreakable numeric entity. Downstream automations read this new wrapper sensor and never see the underlying chaos.
Worked Example: Unbreakable Climate Control
You want the nightstand sensor to drive the bedroom climate because it is right next to the bed. If it dies, the thermostat out in the hallway is close enough to keep the room safe. A smart plug across the bedroom also has an internal temperature gauge. It runs a little warm, but it is better than nothing.
You build the failover sensor like this:
template:
- use_blueprint:
path: TheThinkingHome/sensor_failover.yaml
input:
primary_entity: sensor.nightstand_temperature
backup_entities:
- sensor.hallway_thermostat_temperature
- sensor.bedroom_smart_plug_temperature
backup_weights: "80, 20"
sensor_name: Master Bedroom Temperature
unique_id: master_bedroom_temperature_failover
unit_of_measurement: "°C"
device_class: temperature
state_class: measurement
The automation runs on trust. While the nightstand sensor is online, its reading is the only one that matters. If it drops, the blueprint instantly falls back to a weighted average of the hallway thermostat and the smart plug. You give the hallway an 80% weight because it reflects the ambient air better than the plug hardware.
Your climate automation now reads sensor.master_bedroom_temperature_failover. You get to sleep through the night. The dead coin cell battery is just a maintenance task for tomorrow, not a midnight emergency.
More Than Just Climate
This hierarchy of trust works for any numeric reading where a dead sensor causes chaos:
- The Clouded Lux Sensor: You use an outdoor illuminance sensor to turn on the interior lamps when a heavy storm rolls in. But because it is mounted outdoors and far from the edge of your mesh, it frequently loses connection. Pair it with two less-precise indoor window sensors as backups, and your house never mistakenly thinks it is pitch black at noon just because the outdoor sensor dropped offline.
- Wind Speed Safety: You have a local anemometer that retracts your patio awning when the wind picks up. If that local sensor drops off your Zigbee mesh, fall back to a cloud-based weather integration's wind speed. The local sensor is the most accurate, but the cloud fallback is vastly better than leaving the awning out in a storm because your hub lost a ping.
- The Faraday Freezer: A wireless temperature tag buried deep in a chest freezer struggles to push its signal through the thick metal walls and drops offline intermittently. Fall back to a secondary tag sitting near the plastic lid. It reads a little warmer, but it keeps your "freezer is thawing!" safety alarm from crying wolf every time the primary sensor drops a packet.
Get It
The quick way, one click:
Note: This is a template blueprint, which means it does not have a UI for creation. The sensor is created with a few short lines in your configuration.yaml file.
The GitHub Readme covers the full setup, the parameters, and the longer story behind the design choices: Full Write-Up and Documentation
Tested with Home Assistant 2026.5.4 or newer.
Other blueprints in The Thinking Home series:
- Recently Active — Create a "was active recently" sensor from any source, with a configurable look-back window.
- Sensor Failover — Fall back to a secondary sensor when the primary goes unavailable.
- Linked Entities Pro — Two-way sync for any number of entities across switches, lights, input_booleans, fans, and groups.
- Sensor Watchdog — Detect sensors that have stopped responding and power-cycle them back.