Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
A Home Assistant entity can keep its last numeric reading after its device or connection stops delivering useful data. Add a freshness guard before the automation’s consequential action: reject unknown and unavailable, then check whether the entity’s last_updated timestamp is recent enough for that sensor’s normal reporting cadence.
There is no universal “fresh” interval. A check is only as meaningful as the integration’s timestamp behavior and the maximum age you choose for the particular sensor.
Why an automation can act on a dead sensor reading
A trigger reacts to an event; it does not guarantee that the value an automation later uses represents a current physical measurement. When an entity stops receiving useful data, its last numeric state may remain visible. An automation can therefore run using a value that looks valid but is stale.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Home Assistant evaluates conditions after a trigger fires. As the official automation documentation puts it, “A condition checks the current state once, right after a trigger reacts.” A condition is a snapshot check, not a timer: if it is false when checked, it does not wait for the state to change and then resume the same run.
#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.
Add a freshness guard before the action
For an automation that should run when a sensor changes, keep the event trigger and add a condition that verifies both state validity and age before the action. The following is a pattern, not a ready-to-paste automation: replace sensor.example with your entity ID, choose a maximum age based on its reporting cadence, and place the condition in the automation before any consequential action.
{{ states('sensor.example') not in ['unknown', 'unavailable'] and (as_timestamp(now()) - as_timestamp(states.sensor.example.last_updated)) < 600 }}
The example’s 600 represents 600 seconds (10 minutes); it is illustrative, not a recommended interval for every sensor. The first test prevents invalid state strings from being treated as readings. The second compares the current time with the entity’s last_updated timestamp.
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.
Home Assistant documents that numeric state conditions do not pass when an entity is unknown or unavailable. Explicitly rejecting those states also makes the intent clear in a template. See Troubleshooting automations.
Choose a check that matches the behavior you need
Run on a sensor change, but only when the reading is fresh
Use the sensor’s state change as the trigger and the validity-and-age rule as a condition. This prevents an action from proceeding when the trigger arrives but the sensor state is invalid or too old. Remember that the condition is evaluated once after the trigger; it will not hold the run open while waiting for a later update.
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.
Detect a sensor that has gone quiet
A state condition alone cannot detect silence because nothing triggers it when time passes. Use a mechanism that re-evaluates the age, such as a template trigger. Home Assistant’s Template integration documentation explains that template triggers re-evaluate when referenced entities change; a template with no entity reference is evaluated once per minute. Select the pattern deliberately: a quiet-sensor alert needs time-based re-evaluation, while an event-triggered action needs a freshness check at the time of the event.
Use a “for” wait with its restart limitation in mind
A “for” interval can express that a condition must remain true for a duration, but pending intervals are reset if Home Assistant restarts or the automation is reloaded. If the waiting period must survive either event, Home Assistant suggests considering an input_datetime helper instead. The relevant behavior is documented with the Template integration.
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.
Set the age limit for the sensor, not by guesswork
Choose a maximum age based on how often the integration is expected to update the entity and how harmful it would be to act on stale data. A short window can flag normal reporting gaps; a long one can allow old readings to pass. The right balance is specific to the sensor and the action, so an interval such as 10 minutes in an example should not be copied without checking those factors.
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 →The timestamp also has an important limitation: Home Assistant’s last_updated changes when the state or attributes change. For some entities, every report counts as a change even when state and attributes are identical. For others, a report may not produce a changed entity state. Consequently, a recent timestamp is evidence of a recent Home Assistant state update, not universal proof that a new physical measurement was taken. Check how the relevant integration updates the entity before relying on age as a liveness test. See State and state object.
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.
Plan for recovery from unknown or unavailable
Invalid states matter both when data fails and when it returns. Most entity-targeted triggers do not react to transitions from unknown or unavailable; the general state trigger does. If your automation must respond when a sensor recovers, consider that distinction when choosing its trigger. Home Assistant describes the behavior in its Automation triggers documentation.
Keep recovery handling separate from the freshness decision: decide whether a returning valid reading should cause the action, merely clear an alert, or wait for another qualifying event. That choice depends on what the automation controls.
How to validate the guard
- Confirm the entity ID and inspect its state and timestamps in Home Assistant.
- Determine whether the integration updates
last_updatedwhen a relevant report arrives, including reports whose value has not changed. - Test the template with a valid recent state and with
unknownorunavailable; invalid states should fail the guard. - Test an older timestamp against the selected threshold and confirm the consequential action does not run.
- If using a template trigger or “for” wait, check the documented evaluation and restart/reload behavior against the behavior you need.
For troubleshooting an automation that does not behave as expected, Home Assistant’s automation troubleshooting guide covers traces and condition behavior.
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.

