I have an ultrasonic sensor in ESPHome that updates every second, with a few filters in place. There are times when it updates immediately in HA, and other times where it doesn’t for 15-20 minutes. Currently I’m looking at values tick by in the ESPHome web portal, but I am not seeing an update to the sensor in HA.
Here’s my sensor config in ESPHome
- platform: ultrasonic
trigger_pin: GPIO 5
echo_pin: GPIO 18
name: "Car_position"
update_interval: 1s
pulse_time: 10us
timeout: 15m
filters:
- filter_out: nan
- sliding_window_moving_average:
window_size: 5 #creates a moving average of the last 3 values
send_every: 1 #sends the moving average at every measurement (but only if it passes the delta filter below))
send_first_at: 1 #after startup immediately start sending the result rather than wait for the first 10 measurements
- delta : 0.7
I believe it should send a reading every second, unless that specific reading is 0.7 different from the moving average of the prior 3 readings. Currently the reading is stable, so I should be seeing regular updates. I understand HA will ignore it when the current and prior reading is the same. But in this case, the sensor is reporting 2.07 (+/- 0.1) repeatedly and the sensor in HA is showing 1.5 or so.
I don’t see any issues in the HA logs.
Anything else I’m missing that could. cause HA to drop readings?
I do wonder if I’m misunderstanding how the sliding window average is working with the delta. I assume if I have a reading get discarded by the delta, it still gets incorporated into the new moving average. But if it doesn’t, obviously I could get stuck at a reading.