Statistics clean-up after zero-data input by SMA integration

Early this morning the SMA integaration and/or my solar inverter sent some bad data into the yield entity

image

but restored itself to the original value a couple of hours later. The consequence is that the Energy dashboard recorded this as a 141kWh entry at 06:00.

I have tried with updating the statistics SQL entries for the failing two hours, both the states field as well as correcting the following sum field, but the correction is not reflected in the entity history nor in the Energy dashboard.

update "statistics_short_term" set state=141.625 where  metadata_id=190 and state=0

and

update "statistics" set state=141.625 where  metadata_id=190 and state=0

Is there any additional table that needs to be updated in order to set things straight?

To prevent this happening again:

Thank you.

I will (try) to revert the sum field, as it seems like, contrary to what to expect, the sum correction has to be to increase the preceding entries rather than decreasing the succeeding entries.

Actually decressing worked as well, although the entity history graph is not corrected the Energy Dashboard display correct values.

I will look into the filtering option pending my update of HA and the correction of the integration