Skip to content

Predbat discharging randomly over afternoon instead of evening #2240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Eeebygum23 opened this issue Apr 14, 2025 · 37 comments
Open

Predbat discharging randomly over afternoon instead of evening #2240

Eeebygum23 opened this issue Apr 14, 2025 · 37 comments
Labels
enhancement New feature or request

Comments

@Eeebygum23
Copy link

Predbat always used to maintain the available SOC until it knew it was safe to discharge to 4% at the end of the day. This usually commenced at about 21:30hrs to 22:30hrs dependant on the SOC in the battery.

Now, it plans partial discharges throughout the afternoon period, occasionally as early as 16:30hrs. This is not ideal since occasionally I have periods of high load if the Hot tub kicks in to do a reheat.

Attached is a logfile to assist in understanding the issue.

predbat.log

@springfall2008
Copy link
Owner

Can you attached the debug yaml please?

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 16, 2025 via email

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 16, 2025

Debug file as requested.

predbat_debug_07_45_00.txt

@ma9mwah
Copy link
Contributor

ma9mwah commented Apr 18, 2025

I get the same thing. I would expect the evening dump to be as close to the cheap rate period as possible to stop the possibility of running out of battery before then.

Image

Image

@springfall2008
Copy link
Owner

This maybe fixed in 8.18.7, please check and feedback?

@ma9mwah
Copy link
Contributor

ma9mwah commented Apr 19, 2025

Looks too be the same for me, but I'll wait till tomorrow morning to see if that changes the plan.

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 19, 2025 via email

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 19, 2025 via email

@gcoan
Copy link
Collaborator

gcoan commented Apr 20, 2025

I will check in the morning Trefor. My only worry is that if it doesn’t work, I may not be able to go back to v8.17.6. Everytime I seem to go back and forth between versions, the oldest one seems to ‘fall’ off the list. Is there a way to guarantee that I can go back to this version if the most recent one still has errors?

The control select.predbat_update contains the last 10 or so versions of predbat, at the moment the oldest one shown is 8.17.6:
image

So future versions of predbat will mean 8.17.6 drops off the update list

You can always manually update to any version of predbat by going to github https://github.com/springfall2008/batpred/releases and downloading the appropriate code release into the predbat addon folder

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 20, 2025 via email

@gcoan
Copy link
Collaborator

gcoan commented Apr 20, 2025

@springfall2008 I'm seeing similar problem of unwanted exports in the afternoon

image

which when its sunny and I was trickle charging the batteries to reduce clipping, when the inverters swap to exporting the grid voltage goes over limit and the inverters stop generating solar

both inverters had shutdown solar generation, H just came back and voltage already at 257V

Image

I had to change predbat to Control Charge mode (from Charge and Discharge) to stop the exporting so the batteries carry on trickle charging which reduces the grid export and grid voltage drops as well

Image

predbat 8.18.7

logfile

predbat.log
predbat.1.log

debug file

predbat_debug_14_55_00.txt

predbat_debug_15_00_00.txt

predbat_debug_15_05_00.txt

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 21, 2025 via email

@springfall2008
Copy link
Owner

@springfall2008 I'm seeing similar problem of unwanted exports in the afternoon

image

which when its sunny and I was trickle charging the batteries to reduce clipping, when the inverters swap to exporting the grid voltage goes over limit and the inverters stop generating solar

both inverters had shutdown solar generation, H just came back and voltage already at 257V

So this doesn't happen with GivEnergy, I'm thinking of adding an option to change how this is modelled. E.g. inverter can charge during export?

@gcoan
Copy link
Collaborator

gcoan commented Apr 21, 2025

So this doesn't happen with GivEnergy, I'm thinking of adding an option to change how this is modelled. E.g. inverter can charge during export?

Think some confusion here Trefor. I have two Gen 1 hybrid GivEnergy inverters.
What I was describing was a problem with the latest predbat planning and executing extra exports in the afternoon rather than holding onto the SoC.

My particular additional problem is with the large number of solar panels I have (and doubtless influenced by more neighbouring houses having solar). I do not have any DNO imposed export limit but what happens is that when its sunny the amount of electricity being exported causes the grid voltage to rise above the 253V maximum, and once it gets to about 258V the inverters will stop generating PV, the grid voltage drops, the inverters start generating PV, and the cycle repeats.
I call this "grid clipping" and to avoid it happening I use inverter_limit_charge to set the inverter charge rate to trickle charge the batteries, and this stops excess energy going to the grid.

All of this works fine except in the example I posted above where Predbat decides to start exporting in the afternoon. The forced export causes the grid voltage to spike over limit and the inverters shutoff PV as a result. It has happened several times. I can do a force demand but then a later slot is planned for export. Other than doing lots of forced demand the only way round out is to set mode to Control charge until the sun goes down.

@springfall2008
Copy link
Owner

Would you not model that by setting an export limit in Predbat roughly the same as your battery export rate?

@springfall2008
Copy link
Owner

Would you not model that by setting an export limit in Predbat roughly the same as your battery export rate?

Together with this new option?

@springfall2008
Copy link
Owner

Can you try this please:

  • Take the version from main
  • set 'inverter_can_charge_during_export' to False in apps.yaml
  • Set an export limit roughly equal to maximum amount you can export before the PV starts to clip.

And then report back on your plan?

@springfall2008 springfall2008 added enhancement New feature or request and removed fixed labels Apr 21, 2025
@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 21, 2025 via email

@gcoan
Copy link
Collaborator

gcoan commented Apr 21, 2025

Would you not model that by setting an export limit in Predbat roughly the same as your battery export rate?

I did think of that, setting the export limit to 5200W (2x 2.6kW).
But I thought export limit was only used in the predbat plan modelling, Predbat didn't use it to set the export rate. If setting export limit would help encourage Predbat to not export when PV is already high then that might get the desired result.
I see from the documentation that the new apps.yaml setting takes account of export limit and dynamically adjusts the export rate, which will help.

I'll give it a go. Very grey today, grid voltage at 241V and not a lot of solar so not going to get any evidence from the change today.

@springfall2008
Copy link
Owner

Would you not model that by setting an export limit in Predbat roughly the same as your battery export rate?

I did think of that, setting the export limit to 5200W (2x 2.6kW). But I thought export limit was only used in the predbat plan modelling, Predbat didn't use it to set the export rate. If setting export limit would help encourage Predbat to not export when PV is already high then that might get the desired result. I see from the documentation that the new apps.yaml setting takes account of export limit and dynamically adjusts the export rate, which will help.

I'll give it a go. Very grey today, grid voltage at 241V and not a lot of solar so not going to get any evidence from the change today.

Export limit is indeed just for modelling, but this together with the new option set to False would model the lost PV energy which should steer Predbat away from exporting during these times - it will have no impact on the actual inverter controls.

@springfall2008
Copy link
Owner

My issue is similar to Geoffreys. The more recent updates cause my system to export randomly in the afternoon instead of leaving it while the last minute. Also, the manual force export doesn’t seen to work anymore. Is there any correlation to the problems that others are having?

I'm not seeing any issues with the manual force export, can you please give more specific details on what version, what happens, what is in the logfile etc?

@gcoan
Copy link
Collaborator

gcoan commented Apr 21, 2025

Export limit is indeed just for modelling, but this together with the new option set to False would model the lost PV energy which should steer Predbat away from exporting during these times - it will have no impact on the actual inverter controls.

that sounds like it would be helpful to my issue, but, I read the documentation:

  • inverter_can_charge_during_export - Global setting, defaults to True.
    During a force export period if the generated solar exceeds the inverter limit or the export limit then the inverter will scale back the export rate.
    If this setting is True then the inverter can end up charging the battery from PV while still in Force Export mode.
    If this setting if False then the inverter will not charge the battery and the excess PV will be lost.

I took it that I didn't need to set it as the default value is True, and when True Predbat will reduce the export rate so that the battery can be charged from solar during force export mode.

But reading it again, it doesn't say that,

I think I now understand it to say that this is how predbat models the inverter behaviour, not controls the inverter discharge/export rate when solar exceeds inverter limit/export rate.

And (per earlier) in discharge mode, I don't believe the GivEnergy inverters will charge from solar, so we're saying the setting should be set to False so predbat recognises that the extra PV will be lost.
And by recognising that the PV will be lost this skews Predbat away from force exporting that causes export to exceed the inverter export limit.

Phew!

Why out of interest set the default to True?

@gcoan
Copy link
Collaborator

gcoan commented Apr 21, 2025

@springfall2008 not sure this new feature is working/adding much to my issue

have set export limit to 2600 & 2600 (my two inverter max discharge rate) and set inverter_can_charge_during_export to false in apps.yaml

plan for tomorrow shows plenty of sun but two lots of exporting:

Image

the 12:30 slot for example, 3.25 of solar + 2.6 of force export will mean (if Predbat is calculating correctly) that 0.6 of the solar will be discarded in favour of the export

instead, since the batteries are not full, why not just continue charging the batteries ?

Really what would be much more sensible is if (as suggested on #1206) predbat did a slower rate charge after the freeze export so the batteries don't fill up so quickly

log & debug files:

predbat.log

predbat_debug2104.txt

@springfall2008
Copy link
Owner

Hmm, I ran your plan but it doesn't show what you have above, instead I get something with no force export during the peak solar period. I do see a fair amount of clipping modelled during that time period

Image

@springfall2008
Copy link
Owner

If I turn back on 'inverter_can_charge_during_export' I get a totally different plan with way more export:

Image

@springfall2008
Copy link
Owner

I don't believe the GivEnergy inverters will charge from solar, so we're saying the setting should be set to False so predbat recognises that the extra PV will be lost.

I'm not 100% sure on this but I see no reason why you can't DC charge a hybrid while exporting the AC limit?

And for an AC Coupled the PV is already AC so you can charge the battery and export.

It all depends on the software...

@CJDumbleton
Copy link
Contributor

My GivEnergy gen 2 hybrid 5 kW inverter can charge from solar while exporting the AC limit.

@Eeebygum23
Copy link
Author

My issue is similar to Geoffreys. The more recent updates cause my system to export randomly in the afternoon instead of leaving it while the last minute. Also, the manual force export doesn’t seen to work anymore. Is there any correlation to the problems that others are having?

I'm not seeing any issues with the manual force export, can you please give more specific details on what version, what happens, what is in the logfile etc?

So, in a morning, if i know that my car battery is scheduled an Octopus intelligent based charge outside the normal 6 hour window, I know that there will be cheap rate leccy and the battery will automatically charge. So what I do is to force discharge for say, half an hour beforehand at 15p before the extra cheap rate slot starts. That way, it gives the battery more headroom to charge at the cheap rate while it is charging the battery. I hope that makes sense. Regarding version, I know it does it from v8.18 but I am reluctant to try the earlier versions in case i lose my 17.6 option to return back to.

@gcoan
Copy link
Collaborator

gcoan commented Apr 23, 2025

If I turn back on 'inverter_can_charge_during_export' I get a totally different plan with way more export:

I think I'll see how I do with the version as it is for a while. I want to get Predbat to do an early morning discharge to empty the batteries so I can charge during the day and reduce clipping, and then not to do a force export during the day which causes the grid voltage to rise too high.

Am slightly concerned about having had to set inverter_limit and export_limit to false values to 'trick' predbat into doing what I want, but as long as I also change inverter_limit_charge at the right times to control the trickle charging, I am getting what I want when the plan executes.

The predicted plan doesn't always look as good, but as I control inverter_limit_charge outside of predbat, the plan execution seems (so far) OK.
The new config and setting inverter_can_charge_during_export has made an improvement I think, will keep an eye on it.

@springfall2008
Copy link
Owner

I guess the over voltage is not modelled in Predbat, I don't know how that would work?

@gcoan
Copy link
Collaborator

gcoan commented Apr 24, 2025

I guess the over voltage is not modelled in Predbat, I don't know how that would work?

Potentially it could be modelled, its a bit like battery temperature and the way temp affects on charging. There is a baseline range that grid voltage operates in. As more power is exported (either PV or forced export), grid voltage will rise, and when it reaches a threshold the inverter will stop operating. So there could be logic to model this in predbat and ensure that predbat doesn't let too much get exported. The existing export_limit in apps.yaml provides a proxy for this, except there is a dynamic bit that effectively the limit varies with grid voltage (as does charging rate with battery temperature).

Unfortunately the suggested workarounds of setting export_limit didn't work today, predbat started exporting at 15:20 this afternoon. I set predbat mode to Control charge only to stop it

Image

I'll try and capture logs from it happening again

@gcoan
Copy link
Collaborator

gcoan commented Apr 27, 2025

@springfall2008 example of predbat planning to do an export this afternoon that really made no sense to me:

image

I think it maybe be due to the rate override I have to prevent export in the DFS peak rate period?

And Predbat actually did do an export:
image

And by doing the export from 15:30 to 16:00, the export drove the grid voltage up to 258V and this stopped the solar generation:
image

logfile:

predbat.log

@gcoan
Copy link
Collaborator

gcoan commented Apr 27, 2025

8.19.0 with the rate export override set to -5p as I have had it for ages:

image

Predbat planning two export slots which I don't want (for all the reasons above)

I reduced the rate export override to -2p which should still hopefully be enough to prevent predbat planning forced export in the DFS peak period, and has also stopped the pre-4pm exports being planned:

image

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 28, 2025 via email

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 28, 2025 via email

@gcoan
Copy link
Collaborator

gcoan commented Apr 28, 2025

Yes. That happened to me and I am still on v8.17.6I did a force demand to override it.Kind RegardsChris

What rate does Predbat show for your export in the plan, in particular before and after when you have been seeing the afternoon exports?

Do you have any rate import or export overrides in your apps.yaml?

I had -5p export override in mine for the peak period to encourage predbat to not export in the DFS saving session time period, but I think this was causing predbat to want to export just before the peak. I've changed my override to -2p (and may remove it entirely) and so far it's not planning an afternoon export. Will see what happens today

@Eeebygum23
Copy link
Author

Eeebygum23 commented Apr 28, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants