The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Most automations that stop working are not broken in their logic. They receive an input that is missing, stale, or flickering, and Home Assistant does exactly what its triggers and conditions tell it to do with that input. The reliable fix is usually to change what the automation reads and when it reacts, not to keep rewriting the same YAML. This guide explains the state behavior behind that lesson, shows how to find which part of the chain failed, and sets out the trade-offs for each fix.
What a sensor reports when it stops working
Home Assistant does not treat a silent sensor as a sensor that reads zero. It uses two special states, and they mean different things:
As an Amazon Associate I earn from qualifying purchases.
- unknown means the entity exists, but its value is not known.
- unavailable means the entity cannot currently be reached, which can happen when a device is offline or an integration failed to load.
The distinction matters because the fix differs. An unknown value often points to a sensor that has started but has not yet reported a usable reading. An unavailable value points to a connection or loading problem, so the first place to look is the device and its integration, not the automation. The Home Assistant documentation on working with states defines both states and is the reference to check when you are unsure which one you are seeing.
The official templating patterns page puts the risk plainly: "A sensor that goes unknown or unavailable for a moment can wreck your automations." (Home Assistant documentation, common template patterns; the page does not name an individual author.)
#1 Best Overall
- Accurate Open/Close Monitoring & AAA Battery Powered The sensor requires a Zigbee hub to operate. You can monitor door or window open/close status via App and receive instant phone alerts. Powered by replaceable AAA batteries for long-lasting, stable performance.
- Tamper Alert & Instant Phone Notification Built-in tamper-prevent button allows you to receive real-time phone alerts when the device is removed, enhancing door security.
- Smart Automation for Home Security and more The sensor requires a Zigbee hub to operate. When the open/close/tamper status changes, it can trigger smart scenes such as alarms when open, camera recording, smart lights on, or voice notifications. Perfect for home security, child safety, pet monitoring, and energy-saving automation.
- Versatile Installation to Fit Most Doors & Windows Supports horizontal and vertical magnet installation with up to 30mm detection distance. Ideal for wide door gaps, narrow door frames, apartments, garages, and office security setups.
- Compatible with other Zigbee Ecosystems Easily integrates with Home Assistant via SONOFF Zigbee Dongles and works with Alexa and SmartThings through compatible Zigbee hubs.
Why a sensor that comes back online may not start the automation
Triggers respond to a moment or a change. They do not keep checking whether a condition still holds. That single fact explains most "it came back but nothing happened" reports.
A recovery is a transition, not an "on" state
When a motion sensor drops out and returns, its state history may read off, then unavailable, then on. A trigger that only watches for the move from off to on never sees that sequence as a match, because the previous state was unavailable. The automation triggers reference and the troubleshooting page both describe this previous-state behavior.
The from constraint is the usual trap
Consider a trigger written like this:
trigger: state
entity_id: binary_sensor.hallway_motion
from: "off"
to: "on"
This fires on a clean off-to-on movement and is silent after a dropout. If the goal is to act whenever motion is detected, remove the from line:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 【mmWave Radar Detection】 Features the HLK-LD2401 24GHz mmWave radar, capable of detecting both motion and stationary objects up to 20 ft (6 m) indoors. The compact Seeed XIAO ESP32-C3 and external antenna provide reliable Wi-Fi connectivity with improved range and stability.
- 【Home Assistant Required】 Works exclusively with Home Assistant, an open-source platform for local smart home control and automation. Requires an existing Home Assistant installation. Basic familiarity is recommended.
- 【Integrated Ambient Light Sensor】 LITOS v3 includes an integrated VEML7700 light sensor, as many automations rely on both presence and lighting conditions. Its sensitivity closely matches the human eye, allowing accurate ambient light readings — ideal for rules such as turning lights on only when someone is present and the room is dark.
- 【Refined, Light-Permeable Front Design】 The front panel is made from high-quality 3D-printing filament, allowing ambient light to pass through naturally. This ensures accurate light measurements and adds a subtle, modern aesthetic.
- 【Ready-to-Use ESPHome Firmware】 LITOS v3 comes pre-flashed with ESPHome, making setup straightforward. No manual flashing or additional configuration is required.
trigger: state
entity_id: binary_sensor.hallway_motion
to: "on"
Keep the from constraint only when the automation should respond to that specific prior state and nothing else. Also note that a state trigger with neither from nor to can fire on attribute changes, which produces extra runs rather than missing ones. Set the intended to state if attribute churn is causing noise.
How to diagnose the failure in order
Work through these steps before changing anything. The order separates a sensor problem from a trigger problem and an action problem.
- Open the automation’s trace view. If no trace exists at the expected time, the trigger never fired, so go to step 2. If a trace exists, read the trigger that started it, then the result of each condition, then the action where the run ended. This tells you whether the failure is before the run, in a condition, or in an action.
- Open Settings > Tools > States and check the entity’s raw state. A friendly label such as "Open" or "Detected" may sit on top of a raw state of
on. State triggers compare the raw value, so a mismatch between what the UI shows and what the trigger expects will silently prevent a match. - Open the entity’s History around the failure and identify what happened. Did it become
unavailableorunknown? Did it change briefly and return? Did it bounce around a threshold? Home Assistant keeps state changes for 10 days by default, so a short dropout from last week may already be hard to see. The documentation pages cited here do not state a publication date for these defaults, so confirm them against your version’s documentation. Short-term statistics are saved every 5 minutes, and long-term statistics every hour. These describe data retention and cadence, not reliability. - If the entity was unavailable, check device power and connectivity, then the integration, then Settings > System > Logs for warnings and errors that mention the entity. If the action reported an unavailable target, trace that device separately. The sensor that triggered the run and the device the action controls can fail independently.
- Review the trigger semantics described in the section above. Remove a
fromconstraint only if the automation should respond regardless of the prior state. - If the issue persists, work through the other causes listed below.
Guarding calculations and decisions against unusable values
An automation that uses a live reading in a template or a numeric comparison needs to handle values that are not numbers or not current.
Rank #3
- ZigBee Compatibility: Utilizing the Zigbee 3.0 standard, it is capable of integrating smoothly with a range of Zigbee hubs and devices, including popular Zigbee Echo devices, such as Echo (4th Gen), Echo Plus (1st Gen and 2nd Gen), Echo Show 10 (2nd Gen and 3rd Gen), Echo Studio, Eero 6, Eero Pro 6, SmartThings, Home Assistant (ZHA and Z2M), Hubitat, and Third Reality smart hub Gen2.
- Manually Adjustable Sensitivity: You can easily change the sensitivity levels with 2 physical switches. Featured with four adjustable sensitivity levels, it offering flexibility to cater to a variety of needs and scenarios in your home.Such as garage doors, jewelry drawers, windows, delivery box, etc.
- Siren Alarm with mute switch: Equipped with a 110dB siren alarm for immediate and noticeable alerts. The device also has a physical mute switch that allows for quiet notifications sent directly to your phone, providing adaptable options for different environments and preferences.
- Versatile Usage: Ideal for monitoring various objects and areas in your home such as doors, windows, jewelry drawers, delivery box,, offering a versatile solution for home security and automation.
- Routine Creation: Enables the setup of smart routines when paired with a compatible Zigbee hub, enhancing your smart home experience with automated alerts and notifications. From sending alerts if a window breaks or notifying you when appliances like washing machines or dryers have stopped running. This can contribute to a more efficient and responsive smart home.
Check for a usable value first
The has_value function returns true only when an entity is neither unknown nor unavailable. A guard in a template condition looks like this, with the entity name as an example only:
{{ has_value('sensor.kitchen_temperature') and states('sensor.kitchen_temperature') | float > 20 }}
A numeric state condition is stricter in one respect: it does not pass when the measured entity or a threshold entity is unknown or unavailable. That is useful, but it means the condition quietly returns false, so the automation simply does nothing. Pair it with a trace check so you can tell "condition was false" from "sensor was missing."
Hold the last value, and accept what it hides
The official hold-last-value pattern can keep a downstream calculation stable through a short dropout. The trade-off is that the held value is not a live reading while the sensor is out. If a heating decision or a lock action depends on that value, a held reading can conceal a real change. Add a freshness or availability check wherever acting on old information would be unsafe. The common template patterns page covers the pattern itself.
Rank #4
- [Notes]An Aqara Hub is required and sold separately.(NOTE:Not support hubs from other brands.) Requires a secured 2.4 gigahertz Wi-Fi network connection for Hub M2/ M1S/ E1/M1S Gen2 and Camera Hub G2H Pro/ G2H, and 2.4/ 5 GHz Wi-Fi for Camera Hub G3.(Wired connection via Ethernet RJ45 for Hub M2 is also supported)
- [Proximity] For a sturdy connection, ensure that the Aqara Door and Window Sensor is within 400 inches of the Aqara Zigbee hub, and the hub is within the same range from the Wi-Fi router. Additionally, make sure the hub and the router are on the same local area network (LAN). Zigbee2MQTT and comparable third-party USB dongles are not officially supported by Aqara. Full product functionality may be limited or unavailable.
- [Unauthorized Entry Detection & Home Automation] The Zigbee Door Sensor alerts your phone and triggers the Aqara Hub's local alarm upon unexpected door/window openings. It also controls other Aqara devices based on door/window status. Conveniently check your door or window, kids room and anywhere you want to be notified.
- [0.86 Inch Wide Gap Allowed]The Aqara Door and Window Sensor works with most types of doors, windows, and other fixtures with similar mechanism, such as drawers, cabinets, and more.(Note: Please ensure that the surface where you plan to stick the Aqara Zigbee Door and Window Sensor is flat and easily adhesive, and the allowed gap between the door is up to 0.86 inch.) The main sensor unit dimension:1.61*0.87*0.43 inch, the magnet dimension:0.79*0.39*0.39 inch.
- [Hands-Free Voice Control] Enjoy a hands-free experience compatible with Apple HomeKit and Alexa. No need to go downstairs or pick up your phone again. You'll always know whether your home door is opening or closing. This sensor must be paired with an Aqara Hub to function. Note: This sensor requires an Aqara Hub (sold separately) to function. Without the hub, it cannot send notifications, trigger automations, or connect to HomeKit, Alexa, or IFTTT.
Sensors that bounce between states
A sensor hovering near a threshold, or reporting intermittently, can make an automation fire too often or not at all. Two mechanisms control this.
The for timer resets when the state leaves
A For at least duration starts when the entity enters the trigger state. If the entity leaves that state and returns, the timer resets and starts over. A trigger like this requires two minutes of continuous on before it runs:
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →trigger: state
entity_id: binary_sensor.hallway_motion
to: "on"
for:
minutes: 2
Choose the duration from the sensor’s real behavior in History and from what a delay costs you. A longer delay suppresses more noise, but it also postpones every legitimate response by the same amount.
Best Value
- ZIGBEE STANDARD COMPATIBLE MOTION SENSOR: A Zigbee Hub is required. Compatible with Zigbee hubs and Echo devices with built-in Zigbee hubs, including Echo (4th Gen), Echo Plus (1st & 2nd Gen), Echo Studio, Echo Show 8 (3rd Gen), Echo Show 10 (2nd & 3rd Gen), Echo Hub, Eero 6, Eero Pro 6, Home Assistant, SmartThings (2015/2018), Aeotec, Hubitat, Homey Bridge, Homey Pro, and Third Reality Hub Gen2 Plus.
- CREATE ROUTINES: Using the Alexa app, create your own routines that are triggered when motion is detected. Customize Alexa messages like “Welcome Home” or “Motion Detected in Living Room” when motion is detected.
- SMART LIGHT CONTROL: If you have a smart light or smart plug connected to the Alexa service, you can create a routine in the Alexa app that will enable it to automatically turn on when motion is detected (and off when no motion is detected for a period of time that you specify).
- HASSLE-FREE SETUP: Installs in a few seconds. Just make sure device in paring mode and compatible Echo device automatically discovers it by saying “Alexa, discover devices”. Only for indoor use.
- GREAT RANGE AND LONG BATTERY LIFE : Capable of detecting motion up to 20 feet (6 meters) away. 2 AAA batteries can last for 2 years in typical usage.
Numeric triggers fire on crossings, not on conditions
A numeric-state trigger reacts when a value crosses a threshold. It does not keep firing while the value stays above or below it. If the behavior should repeat while a condition holds, the troubleshooting page recommends a time-pattern trigger combined with a condition, which checks on a schedule and then tests the current state.
Other causes to rule out
The sensor is only one of several documented causes. Check these before concluding the sensor is at fault:
- A raw-state mismatch, where the trigger compares a value that differs from what the interface displays.
- A renamed entity ID, which leaves the trigger pointing at an entity that no longer exists.
- A disabled automation.
- An unmet condition that the trace shows was evaluated and returned false.
- Overlapping triggers, or single-run mode blocking a new run while an earlier one is still active.
- A replaced device, which can produce a new device ID and break a device trigger.
- A device trigger that the integration does not offer. Home Assistant recommends using an entity trigger where the integration supports one.
- A breaking change after an update.
Choosing a strategy
There is no single fix for every home. The table compares the common approaches on the questions that actually decide between them. Where the documentation does not give a fixed value, the cell says so.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute| Approach | Reacts when | Behavior when the reading is missing | Main risk | Best fit |
|---|---|---|---|---|
State trigger with to only |
Entity enters the target state, from any prior state including unavailable |
Does not fire while unavailable; fires on the next valid entry into the state | May run on attribute-only changes if to is omitted |
Actions that should run whenever the state is reached |
State trigger with from and to |
Only the exact prior-to-new transition | Misses recovery transitions from unavailable |
Silent failure after a dropout | Transitions where the prior state genuinely matters |
State trigger with for |
Entity stays in the state for the set duration | Timer resets if the entity leaves and returns | Legitimate responses are delayed | Sensors that flicker and cause false runs |
| Numeric-state trigger | Value crosses a threshold | Not stated in the trigger reference for this scenario; check the trace | No repeated firing while the value stays past the threshold | One-time reactions to a threshold crossing |
| Time-pattern trigger plus condition | On the schedule, then the condition is tested | Condition returns false if the measured entity is unknown or unavailable |
Delay up to the schedule interval | Repeated checks while a state holds |
| Hold-last-value template with freshness check | Each evaluation, using the held value | Uses the last valid value; the held value is not live during the outage | Old data can conceal a real change | Calculations that must survive short dropouts |
When the physical sensor is the problem
If the trace, History, and logs all point to a device that drops out regularly, the sensor or its connection may be unsuitable for the job. Before buying a replacement, verify the integration and radio protocol it uses against your Home Assistant setup. The Home Assistant documentation on sensors describes how sensor entities report values, which helps you judge what a replacement will expose. No specific model is recommended here, because compatibility depends on your hardware and integrations.
Once the automation reads a source you can trust, and reacts to changes in the way you intend, most of the failures in the title stop appearing. The remaining ones are usually the configuration causes listed above, and the trace will show which one applies.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

