I have a Solar PV system that includes a GivEnergy battery. One of the great things about this battery is that it exposes a local interface that can be used to query power states but also adjust settings for the battery. Another great thing about this battery is that you can set it to charge itself from the grid during the cheaper night rates (usually called EV tariffs in the UK).
I have written a simple app that executes a query once a day to a solar forecast API and then based on the forecast it can adjust the level the battery charges up to. I use this so that on cloudy days I can make more use of the cheaper electricity but on sunny days the battery instead charges from the solar generation.
This app should be considered beta in that there is much more that could be done to it. However it is definitely useful for me as it is! So, I thought I would share it in case it is of use to anyone else out there who has a similar setup.
In order to use this app you will also need to run the GivTCP service on your network, this exposes the local TCP interface offered by the battery as a more easily consumable REST service.
This service is available as a docker image at:
https://hub.docker.com/r/britkat/giv_tcp-ma
The app currently supports either of two solar forecasting services:
Solcast - you need to create a free account and configure where your house is and the roof orientation etc.
Forecast.Solar - no account needed for this app to work, you instead provide the house location and roof orientation in the app itself.
Here's the app code (I haven't bothered adding this to Hubitat Package Manager but if enough people are interested I probably will)
https://raw.githubusercontent.com/xap-code/hubitat/master/givenergy/apps/givenergy_forecast_charge.groovy