Hello
I am trying to finalize my esphome project and optimize the traffic. I have an ADC sensor and then a copy sensor to filter and average it. I have a delta filter on the copy sensor which suppresses state updates when nothing is changing. This is working (its reading motor current, so its usually 0 when the motor is off).
But the original ADC sensor is spewing out state updates even when the motor is off. That’s despite marking this sensor as internal and not giving it a friendly name. I can’t use a delta filter here due to the following copy filter.
Thanks!
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:46][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:47][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:47][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
[07:23:47][D][sensor:094]: 'motor_current_sense': Sending state 0.00000 A with 3 decimals of accuracy
I have an update interval set to 0.1, and a window filter to average 10 samples. So I get a clean filtered current reading every second.
sensor:
- platform: uptime
name: Uptime Sensor
# Use ADC sensor with the gain of the CS, which is 2.5v per amp
# ADC needs to be on the Max range, 11dB attenuation
# The ADC is terrrible!
# Provide a zero offset, ie when motor not powered it needs to be 0
# It also needs a gain correction and the low current is not accurate
# but we really only use it for over current check (redundant with fault).
- platform: adc
pin: GPIO32
id: motor_current_sense
internal: true
attenuation: 11dB
accuracy_decimals: 3
unit_of_measurement: A
update_interval: 0.1s
filters:
- offset: -0.1420
- multiply: 0.4
# Now copy that sensor and average it becuase ADC is very noisy
- platform: copy
source_id: motor_current_sense
name: "Motor Current"
id: motor_current
entity_category: "diagnostic"
accuracy_decimals: 3
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 10
- delta: 0.010