Update webhook sensor for past dates

Hi everyone!

This might be well out of scope for most use cases, but it would still be great to find a solution.

I have a webhook sensor that gets updated once a day. The problem is: the source of the data comes delayed, sometimes one, sometimes two days after the measurement.

E.g.

  • day 1 I will get one update (value for day 0)
  • day 2 I might get no update
  • day 3 I might get two updates in short succession. One for day 1 and one for day 2

This means, in Home Assistant I receive all values, but I lose the information, to which day the value belongs.

I would be okay with a one day delay, if it were consistent. But the irregular update makes this problematic.

Is there any way to update values for past dates?

Meaning, can I tell Home Assistant that one webhook value belongs to yesterday, and another to the day before that?

I am already thinking about updating the database directly. But I don’t want to mess anything up, because I don’t really understand the states table and how it works.