Found this:
I’m not an expert, but I think it might be possible to automate the transformation to a mostly lossless output if the sample rate is clean enough, as in the case of Tuya. There seem to be other metods like this suggestion: Riemann sum integral sensor not updating while source sensor value is stable · Issue #88940 · home-assistant/core · GitHub
It might also be feasible to perform some gradient analysis or fit a curve to better understand the data’s characteristics and automatically select the most suitable method. Alternatively, the integrations could provide useful insights to help you choose.
Do you think this would be too complicated to implement?