[BETA] GivEnergy Forecast Charge

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

3 Likes

Wouldn't you know? The day after I release it one of the forecast providers goes down (Forecast.Solar). I have updated the code with better error handling so that it reports failures more usefully and uses the default charge target in such cases.

Release 0.4: Added the ability to enter a weighting when using Solcast forecast. This value goes from -1.0 to 1.0 and allows tuning the estimate used to be within the 10th percentile up to 90th percentile as described by the Solcast docs.

e.g.
weighting = -1.0 then just the p10 estimates are used
weighting = -0.5 then the values halfway between the p10 and p estimates are used.

If anyone is using this let me know and I can pop it into Hubitat Package Manager to make it easier to get updates.

Release 0.9

  • The app will adjust the charging start time based on the charge target, battery capacity and charge rate. The aim is to have the battery reach the charge target at the charge end time.
  • Requests to the battery API are retried up to 5 times.

Hey @xap - I'm going to use this very shortly as now have GivEnergy solar kit.

As a thought, would it be possible to get Solcast data from the Hubitat Solcast driver that is here if it's installed: GitHub - ke7lvb/Solcast: Hubitat driver for Solcast Solar Estimate API - this would save additional API calls (which are limited) for people already using the Solcast device on Hubitat.