I made a workaround for the EON Hungary use-case, where there is a python script which fetches the data at 4am every day from the utility company and publishes it to MQTT. As the new data arrives, I extended the script to connect to the MariaDB behind HA and update the statistics back in time something like
UPDATE statistics SET state = <value as of yesterday, which we got today>, sum = <value as of yesterday, which we got today> - 5849.866 where metadata_id=291 AND start > <5am yesterday>
where the 5849.866 is the initial value my sensor had when I first connected it to HA (you can find your number in the statistic table). Metadat_id is the sensor’s id.