Gas meter consumption with irregular reset dates

Hi all, I'm working on a script that reads the gas meter usage from my gas company website and updates in the HA energy dashboard. So far I can get the cumulative value for the billing cycle which resets every month or so. Sometimes on the 31st, other times on the 2nd or 3rd. The other challenge is that the data I get from the site isn't real time. It's the previous day and sometimes it skips a day then it catches up. I went this direction to see if I could do it with code instead of building a esp32 based camera system and 3d printed mount. I would rather use the least number of components in my rube Goldberg. I also fully accept that my cumulative usage will be off by a day.

I get the billing dates in the payload and cumulative total for the month as well as rolling 12mo worth of data.

It's a python script that logs into the site, retrieves usage data, then sends the cumulative value to a Mqtt server.

I think I'm close, I just need a nudge in the right direction.