From 336af995c27f8165d2d82bb6db41287bf4375f15 Mon Sep 17 00:00:00 2001 From: mayerwin Date: Thu, 19 Feb 2026 19:51:10 -1000 Subject: [PATCH] Always fire update callbacks even when sensor value is unchanged Currently, EcoWittSensor update callbacks only fire when the sensor value changes. This means HA entities don't call async_write_ha_state() for sensors with stable values (e.g., rain rate = 0.0 when not raining), causing `last_reported` to go stale even though the gateway is pushing data every 60 seconds. This makes it impossible to reliably detect whether a sensor has stopped communicating, which is the entire purpose of `last_reported` (introduced in HA 2024.3). Fix: Remove the early-return guard in EcoWittSensor.value setter so callbacks always fire when data is received from the gateway, regardless of whether the value changed. HA already has logic in place to not create duplicate records (but only update `last_reported`) if the data hasn't changed. --- aioecowitt/sensor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/aioecowitt/sensor.py b/aioecowitt/sensor.py index c31b203..586623f 100644 --- a/aioecowitt/sensor.py +++ b/aioecowitt/sensor.py @@ -37,8 +37,6 @@ def update_value( self.last_update_m = last_update_m # Set the value - if self.value == value: - return self.value = value # notify listeners