Statistics sensor not going to zero

Why is my statistics sensor not reading the zero value? It permanently stays high.

platform: statistics
    name: "meross watts (5m)"
    entity_id: sensor.meross_switch_mss310_power_w_main_channel
    state_characteristic: mean
    sampling_size: 15

The statistics sensor reads the last 15 unique values.
By the looks of your data, you have 0, then 10, 25, 15, 450 or something and so on.
To us it looks like you have 0,0,0,0 but that is not how HA sees it.

I know there is a custom component that reads it as that.
But what happens if you add a max_age to it?

Change that to:

state_characteristic: average_linear

As that takes time into account it should return to zero the longer the value is zero.

Thanks @Hellis81 yeah that seems like the issue. @tom_l that doesn’t seem to have fixed it.

Any other suggestions for how to fix this? How would a max_age help?

  - platform: statistics
    name: "meross watts (5m)"
    entity_id: sensor.meross_switch_mss310_power_w_main_channel
    state_characteristic: average_linear
    sampling_size: 15