I am looking to change the value (state) of a sensor. This sensor (ads1115) in used downstream in another sensor (ct_clmap). I want to drop all values that would be used in the ct_clamp sensor if the ads1115 received voltage is below a value (0.00005 in this example). the reason is to eliminate erroneous values from noise. This would be a current value of less than 0.01, and on a 50amp ct clamp, that is good enough for me. I am using the ads1115 in A0-A1 differential mode with the ct clamp. I was also thinking about adding a low-pass filter to eliminate the input noise. Doing it in software would be easier…
I tried using a filters: lambda
, but seems that only changes the values that are sent to HA, not the state value and what is used/sent to other downstream sensors. ads1115 → ct_clamp
here is a snippet of the config I am using
sensor:
- platform: ads1115
id: _adc_ads1115
multiplexer: A0_A1
gain: 1.024
accuracy_decimals: 3
update_interval: 2s
internal: true
filters:
- lambda: if (x < 0.00005) return 0.0; else return x;
- platform: ct_clamp
sensor: _adc_ads1115
id: _current_internal
internal: true
update_interval: 2s
unit_of_measurement: "A"
filters:
- calibrate_linear:
- 0.000 -> 0.0
- 1.0 -> 50.0
- platform: template
name: "Current"
id: current
accuracy_decimals: 2
unit_of_measurement: "A"
update_interval: 30s
- platform: template
name: "Power"
id: power
accuracy_decimals: 2
unit_of_measurement: "W"
update_interval: 30s
lambda: !lambda |-
if (id(_current_internal).state) {
return id(_current_internal).state * 120.0;
} else {
return 0.00;
}