Trouble with Filter

Hi

I have an ESP32 module with 2 HX711 and one BME280. Both the HX711 sensors give some what looks to be zero values about 2 - 3 times a day. Here is one of the configs:

- platform: hx711
    name: "Gas 1"
    dout_pin: GPIO19
    clk_pin: GPIO18
    icon: mdi:gas-cylinder
    update_interval: 5s
    filters:
      - filter_out: 0.0
      - calibrate_linear:
          - 47800 -> 0
          - -765700 -> 39
    unit_of_measurement: kg
    accuracy_decimals: 2

Here is what the data typically looks like:
image

I have tried various filters to remove the errant data, even lambda function, to no avail.

Does anyone have any ideas?

Thanks!

You could use a moving median with a window size of 3 or 5 values?

That will filter out spike.

Ended up using a lambda filter to get rid of those specific values, else repeat the previous valid value.

So far, so good…

1 Like