Backfill daily/monthly utility import

I have set up a daily import for my electrical usage – a cron job calls a script to scrape my utility’s web portal, then posts yesterday’s usage to a webhook in HA.

In HA, the webhook adds yesterday’s usage to an input_number which resets to 0 on the bill cycle date. After some delay, that shows up on the energy dashboard.

What I don’t like is that it gets treated as momentary usage; yesterday’s entire usage is counted for 6:00-6:05am today, and I expect the monthly gas import will be the same thing but a much larger spike.

Is there a way to spread and backfill the imported data? Even if it’s just splitting it evenly over the appropriate number of hours/days, that will be more correct than a spike at 6am (especially with the CO2 signal; overnight when the import runs we use almost no fossil energy here, but it goes up during the day).

Look here.

1 Like