Tomorrow's Solar generation forecast?

Hi - would someone please suggest what I’m doing wrong!

I’ve an automation that runs in the evening and gets the ‘sensor.energy_production_tomorrow_2’ value to feed into a choices list to determine how much to charge my battery up to overnight. The problem I’m seeing is that that value seems to fluctuate wildly depending upon the time it’s read, e.g. between 4 and 29 kW, so I’m wondering what I’m missing…

Screenshot 2023-09-07 at 21.07.14

You are not missing anything. That is what this particular entity often does, and this is one of the fundamental challenges of the forecast.solar integration.

In case you are wondering if this is an HA issue, no it is not. I call the forecast.solar API directly and build my own data model, giving me a forecast for ‘today’. Clearly this is for ‘yesterday’ up to midnight, but the picture below is the entity history for ‘today’ now we are in the evening.

Today has been a particularly bad day. At midnight, today was forecast to be about 10kWh. Then it went down and up. This morning it was suggesting around 3 kWh, which for a partially sunny day in early September is nonsense.

My visual forecast graph was up and down all day. First very poor, then mediocre, then poor again, then up, then down, then up, then down.

You will see that, by the end of the day, it had settled out to 10.8 kWh. My actual for today? 10.7 kWh. So, generally, by the time the sun has set, the forecast for today has often settled down and is quite accurate.

You might, of course, be wondering how to use this data for anything useful. Fortunately it is not always as ‘interesting’ as it has been today. I am recording the forecast (hourly) to a long term database, and reporting the actual to forecast ratio, so that I hope eventually to have a better idea of how best to use this entity value. At the moment, my best guess seems to be - take the average of the first 5 hours after midnight.

Alternatively, wait until sunset and use the actual generated. That figure is almost 100% accurate.

Thanks, a bit to think about… I do recall hearing that the chances of the weather ‘tomorrow’ being much like ‘today’ is >50%, so maybe that is the best option!