Confusion about sensors and filters for power consumption

Issue with BitShake Smartmeter Reader: Incorrect Values Falsifying Statistics

Hi everyone,

I’m using the BitShake Smartmeter Reader to gather data on my energy consumption, but I’m running into an issue where it occasionally reports absurd values, which then falsifies my entire statistics.

I’ve tried applying a filter to my sensors in configuration.yaml, but I’m still seeing these incorrect values every so often. I’m wondering if I’m using the filters correctly and whether they are actually capable of filtering out these erroneous values.

For example, my main energy counter is currently around 21,500.15 kWh and increases slowly and steadily. However, at times, I receive values that are either far above or below this range, as you can see in the screenshots below:

ha_values

This is my code for the sensors and filters:

  - sensor:
    # Stromzähler Haus Verbrauch
    - name: "Stromzähler Haus Verbrauch"
      unique_id: "StromzHausVerbrauch"
      unit_of_measurement: "kWh"
      device_class: "energy"
      state_class: "total_increasing"
      state: >-
        {{ float(states('sensor.bitshake_smartmeterreader_main_counter')) | round(3) }}
  - platform: filter
    name: "Strombezug gefiltert"
    entity_id: sensor.stromzahler_haus_verbrauch
    unique_id: Strombezuggefiltert
    filters:
      - filter: outlier
        window_size: 10
        radius: 0.2
        precision: 3

Am I using these filters properly, and can they effectively handle these kinds of incorrect values? Please help me! :C

Try changing the sensor to this and see if it helps.

  - sensor:
    # Stromzähler Haus Verbrauch
    - name: "Stromzähler Haus Verbrauch"
      unique_id: "StromzHausVerbrauch"
      unit_of_measurement: "kWh"
      device_class: "energy"
      state_class: "total_increasing"
      state: >
        {{ states('sensor.bitshake_smartmeterreader_main_counter')|float | round(3) }}
      availability: >
        {{ has_value('sensor.bitshake_smartmeterreader_main_counter') }}