ESPHome adds a sensor that estimates the remaining life of replaceable air or water filters from how much they are used. It accounts for both running time and variable operating speed, rather than only counting calendar days.
The remaining-life reading is a percentage from zero to one hundred, and its stored usage survives device restarts. This is a usage-based estimate, rather than a measurement of how dirty a filter is.