batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Compare using previous day's Agile import tariff rates

Open CJDumbleton opened this issue 11 months ago • 9 comments

Describe the bug The midnight run of the new (excellent) compare feature used yesterday's Agile import tariff rates.

Expected behaviour I would expect Predbat's compare feature that ran at midnight this morning to use today's Agile import tariff rates.

Predbat version v8.15.1

Environment details

  • GivEnergy 9.5 kWh battery and 5kW hybrid inverter
  • Standard HAOS installer

Screenshots The left-hand side of the screenshot shows the start of the Agile import plan from today's midnight Compare results. The right-hand side of the screenshot shows yesterday's Agile import tariff downloaded from https://energy-stats.uk/download-historical-pricing-data/. They show that the import tariff rates used by Predbat Compare at midnight this morning were from yesterday. Image

Log file predbat.log Log attached from 2025-02-24 00:00 to 2025-02-24 00:30. Some entries of note: 2025-02-24 00:01:38.346517: Compare Tariff: Agile import/Fixed export 2025-02-24 00:01:41.093458: Download Octopus rates from https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-M/standard-unit-rates/ 2025-02-24 00:01:41.093689: Return cached octopus data for https://api.octopus.energy/v1/products/AGILE-24-10-01/electricity-tariffs/E-1R-AGILE-24-10-01-M/standard-unit-rates/ age 0.1 minutes 2025-02-24 00:01:41.094461: Download Octopus rates from https://api.octopus.energy/v1/products/OUTGOING-VAR-24-10-26/electricity-tariffs/E-1R-OUTGOING-VAR-24-10-26-M/standard-unit-rates/ 2025-02-24 00:01:41.094618: Return cached octopus data for https://api.octopus.energy/v1/products/OUTGOING-VAR-24-10-26/electricity-tariffs/E-1R-OUTGOING-VAR-24-10-26-M/standard-unit-rates/ age 0.0 minutes

Predbat debug yaml file predbat_debug_11_20_00.yaml.txt Note, I manually ran the Compare feature at 11:25 (after I had produced the above debug file). This time Predbat Compare correctly used today's Agile import tariff prices.

CJDumbleton avatar Feb 24 '25 11:02 CJDumbleton

Just a +1, i also see this . - However of course until 4pm using the nordpool rates, so running a compare isn't completely accurate - perhaps compare (for agile) should run when the new rates are published

bigsmelly avatar Mar 28 '25 10:03 bigsmelly

Same here, the midnight automated run uses the previous day's Agile rates. A manual run after that uses the correct day

symonchester avatar Jun 03 '25 10:06 symonchester

I think there is a caching problem that sometimes the Agile compare uses the prior days rates. I have sometimes seen this happen as well.

e.g. last night for me:

current (which is Agile/Fixed): Image

Agile (which should be the same): Image

logfile for this run:

predbat.3.log

gcoan avatar Jun 03 '25 18:06 gcoan

And today's midnight run of the predbat compare has correctly found today's Agile prices both in the 'Current' and 'Agile/Fixed' comparisons.

Not changed the config at all and today it works. Yesterday it got the wrong rates.

gcoan avatar Jun 04 '25 13:06 gcoan

Both of mine showing the previous days again

Image

Image

symonchester avatar Jun 04 '25 13:06 symonchester

As a workaround I run switch.predbat_compare_active at 1am on an automation. maybe the manual run clears the cache before it starts?

symonchester avatar Jun 17 '25 07:06 symonchester

I'm also seeing this problem and just wondering if it is a result of daylight saving. The API agile prices are given as GMT - so are currently 1 hour behind the BST times. That means the 00:00 to 00:30 price for the current day actually comes from the 23:00 to 23:30 price on the previous day in the API call. Having said all that I had the same problem in Feb which was before daylight savings came in.

mogons57 avatar Jul 21 '25 10:07 mogons57

Hi @springfall2008

Did you get a chance to look into this? It happened again last night, very visible as the Agile rates for Sunday were very low.

Image

I’m on Agile + Fixed outgoing.

Compare of ‘current’ gives me the correct rates:

Image

But compare of ‘agile+fixed’ gives the day before rates:

Image

logfile:

predbat.3.log

comparisons.yaml: comparisons.log.yaml

gcoan avatar Sep 07 '25 22:09 gcoan

@springfall2008 this is still regularly happening:

Image

The left most blue line (current rates( should be the same length as the yellow/orange one (agile), but about half the time the compare uses the agile rates from the previous day, thus getting the compare wrong

gcoan avatar Sep 18 '25 08:09 gcoan