Add filter to already existing Entity

Energy entities sometimes report 0 during init. This leads to huge outliers on the energy dashboard. Is it possible to add a filter to pre-existing entities using yaml customize?

I do have the problem that my Solax integration (as well as some shelly) do report 0 for some energy entities. This leads to huge outliers in the energy dashboard. I usualy fix these outliers using the developer tools and fix the statistic values. However, this happens now more often and it is quite anoying of fixing this all the time.
image

Since this is a custom integration, I was hoping that I can add an outlier filter to the entity using yaml. Customize.
Something along like this:

homeassistant:
  customize:
    sensor.battery_input_total:
      device_class: "energy"
      state_class: total
      filter: outlier
        window_size: 4

Is this possible?

I know how to add another entity based on this as an input entity. However, if I exchange the input entity on the energy dashboard I loose all the previous recorded history. Which I really do not want to loose.

Thank you

There is the filter integration, but that creates a new sensor

yeah… is there another solution in where I wouldn’t loose the energy history by changing the input entities?

If you rename the filter entity to the base sensor name (and rename that one, ofc), you’ll keep the long-term statistics

Yes. but this entity is provided from an external integration. Thats why I cannot rename the original entity.

It doesn’t matter. As long it has a unique id, you can rename any entities.

1 Like