batpred icon indicating copy to clipboard operation
batpred copied to clipboard

Saving Sessions Export Price Incorrect

Open thephoton opened this issue 10 months ago • 12 comments

Describe the bug When an Octopus saving session is opted-into, PredBat is applying the export rate increase every plan recomputation (until it hits some limit, then resets).

Image

Image

Here, the export rate should be 56p + 15p export = 71p, but seeing 127p after 2 plans, 183p after 3 plans.

It doesn't seem to be changing the rest of the plan around the shown figure (aside from the total).

Expected behaviour For the correct export rate to be shown.

Predbat version

8.11.4

Environment details

  • Inverter and battery setup GivGateway + 2x AIOs + 2x Solax String Inverters
  • Standard HAOS installer or Docker HAOS in Hyper-V
  • Anything else?

Screenshots Attached

Log file Attached

Predbat debug yaml file Attached

predbat debug.zip

Files starting with 2- are taken from when the first screenshot above was displaying, 3-: the second.

thephoton avatar Jan 22 '25 14:01 thephoton

that's super-weird, never seen anything like that. before and my own predbat doesn't experience such behaviour. Did it keep on incrementing indefinitely ?

gcoan avatar Jan 22 '25 17:01 gcoan

Did it keep on incrementing indefinitely ?

No, it reset at some point (highest I saw was almost 400p/slot which would've been nice!), but then carried on incrementing from 15p again.

Only adding in rate override in the apps.yaml file stopped it.

thephoton avatar Jan 22 '25 20:01 thephoton

well weird. Hopefully Trefor can spot something in the logfile because I've never heard of anyone else having this happen to them

gcoan avatar Jan 22 '25 20:01 gcoan

What is in the octopus slot sensor attributes? I'm wondering if the saving session was there twice?

springfall2008 avatar Jan 23 '25 12:01 springfall2008

Right now, not a lot...

I'll have a look next time there's a saving session scheduled (unless you can look at attributes historically?).

Image

thephoton avatar Jan 23 '25 12:01 thephoton

there isn't an easy way to look at attributes historically even though they are stored in the HA database. Would need to start writing direct SQL queries to find the data and even then I don't know how it is formatted

gcoan avatar Jan 23 '25 13:01 gcoan

Struggling to reproduce this, I will try to mock up the saving session data soon (I can see it in the Debug yaml but the source of the calculation isn't stored).

In the meantime I did a new release as the Octopus export URL being used creates a huge structure in memory which is likely the cause of some crashes.

springfall2008 avatar Jan 24 '25 16:01 springfall2008

So I've managed to reproduce this issue!

Screenshot_20250217_132344_Home Assistant.jpg

Screenshot_20250217_123251_Home Assistant.jpg

It appears to be related to settings; a fixed rate in app.yaml. Changing from the fixed rate to the Octopus integration solved this for me.

andyrew616 avatar Feb 17 '25 17:02 andyrew616

What did you put in apps.yaml to reproduce it?

springfall2008 avatar Feb 18 '25 17:02 springfall2008

What did you put in apps.yaml to reproduce it?

I've been having the same issue for the last few seasions and I had my rates set as

rates_import: - start: "23:30:00" end: "05:30:00" rate: 7 - start: "05:30:00" end: "23:30:00" rate: 25.03

Hoo ever i commented it out and used the following for the Octopus integration

metric_octopus_import: "re:(sensor.(octopus_energy_|)electricity_[0-9a-z]+_[0-9a-z]+_current_rate)"

Resolved the issue for me

andyrew616 avatar Feb 18 '25 17:02 andyrew616

Mine has been fine since I switched to the octopus integration sensor for export (after the large data bug!).

For the session later today, switching between the following lines in apps.yaml resolves or reproduces the issue for me:

metric_octopus_export: "sensor.octopus_energy_electricity_XXXX_YYYY_export_current_rate" (works)

rates_export_octopus_url: "https://api.octopus.energy/v1/products/OUTGOING-FIX-12M-BB-23-02-09/electricity-tariffs/E-1R-OUTGOING-FIX-12M-BB-23-02-09-A/standard-unit-rates/" (broken)

thephoton avatar Feb 25 '25 12:02 thephoton

Hmmm... I'm seeing the same issue when I use rates_export_octopus_url (and rates_import_octopus_url)

Saving session rates super high!

Image

And if I comment out the url lines from apps.yaml:

Image

I only see the event once in the attributes:

Image

chibbert avatar Mar 04 '25 17:03 chibbert