API offers 2 slots for times charge of battery?

15 comments started 2023-01-31 last 2023-02-05
Home AutomationGivEnergy Products
G
#1 GEF

Hi everyone. Recently had a GivEnergy inverter and battery installed to compliment a long-had solar installation. It was a long wait for delivery of one last cable, but so far very happy. During the winter we will charge the batteries overnight. I'll write a program to automatically optimise this :-).

My question: On the web portal I seem to have one charge slot (start, end) option but looking at the API it seems to have the option for a second charge slot. Is this just a feature of using the API? Am I missing something on the web portal?

I've done a quick search on this forum, but couldn't find similar question. Apologies if it's been answered before.

Thanks,
Neil.

C
#2 cluelesscris

GEF The second charge slot is not really implemented. Not yet, anyway. Ignore it for now.

#3 TheDragon (GivEnergy)

Ive started using Octopus R&D, their scheduler can use the API and set charging for any number of slots

S
#4 stevelewis

GEF the second charge and discharge slots on the API don't work. Not a big deal... if you're using the API, you put the instructions in your code to charge whenever you want. I have this running in python, happy to share.

G
#5 GEF

Thanks @TheDragon (GivEnergy) - not heard of this app so will check it out. We are on Octopus too.

@stevelewis Yes - I just coded up the same. I think it's all working, but always happy to see how others did it if you can share your code?

S
#6 stevelewis

GEF www.github.com/salewis38/palm Line 586 in palm_soc.py does the second charge, the code also does overnight SoC reduction, based on forecast generation.

M
#7 MattWhitfield

@GEF - Interested to see what you're coming up with. I'm doing something that will do half hourly control - and I've let it loose on my house the last couple of days. It's been a pretty interesting ride so far https://github.com/mattwhitfield/Solarverse

M
#8 MattWhitfield

TheDragon (GivEnergy) I'd be interested in seeing what you get out of Octopus R&D as well. I went to sign up for their labs and it said my account was mid migration so haven't been able to check it out.

#9 TheDragon (GivEnergy)

MattWhitfield so far it is doing exactly what's asked.

S
#10 stevelewis

MattWhitfield good to hear it's coming on (the tale-based generic scheduler is now running in mine)

I've jotted down some thoughts on an algorithm for choosing timeslots considering pricing, PV & consumption at https://github.com/salewis38/palm/issues/1

M
#12 MattWhitfield

stevelewis So the approach I went for ended up being pretty complex. Effectively, it's this:

  • Identify periods that are expensive, and mark those as periods that we want to cover consumption with battery power
  • Apply a forecast model based on historic consumption and Solcast prediction.
  • For the expensive periods, work out what battery power is required to completely cover them.
  • Mark any 'carry forward' periods (so, for example, if 66% charge is needed 9AM -> 12PM, then you can 'carry forward' 34% of charge to be used later by charging the battery before 9AM).
  • For the start of each discharge period, find places where the forecast charge isn't sufficient to cover the predicted demand, then work out how much charge we need. For the amount of charge that can be carried forward, add that to the overnight charging slots. For the amount that can't be carried forward, find charging slots where the battery has spare capacity.
  • Run a second pass, and if there are any periods that aren't fully catered for, then pick the cheapest charging slot where there is battery capacity.
  • Run a third pass, which can mark any periods which would be targeted for discharge and turn them into charging periods if a higher rate period requires charge.

Right now there's a few holes - like it doesn't account for the efficiency factor when choosing to charge / discharge (so effectively price for charge slots should be max 85% or so of the discharge slot price to be effective. But it's getting there... https://github.com/mattwhitfield/Solarverse/blob/main/src/Solarverse.Core/Control/ControlPlanFactory.cs is the part that creates the control plan.

S
#13 stevelewis

MattWhitfield sounds like a very similar approach, nice.

#14 TheDragon (GivEnergy)

MattWhitfield
Overnight charge in the 9 cheapest slots between 0000 and 0800
Day time 0800 1600, if a slot under 26.4p charge up
Evening 2000 to 2300 if a really cheap slot under 20p charge up. Not overly fussed about evenings, as I know overnight it gets filled.

What I also do is at 1600 when I see the octopus notification, I check tomorrows prices and tweak the thresholds down if theres loads of slots.
But 26.4p is the break even point of 33p peak, with round trip charge discharge losses.

M
#15 MattWhitfield

TheDragon (GivEnergy) So does it take into account solar forecast at all to adjust how much charge you need?