30-min data vs 1-hour data #237
-
This is probably not a bug, but more likely my lack of understanding as to how you treat the forecasting data returned from Solcast. This issue came to light when I started using @Webreaper excellent SolisAgile. I noticed that his daily solar forecast was exactly double what I was receiving from your HA integration, despite both sourcing their forecast data from Solcast using the same API key. So I did some diagnostic work of my own.... Firstly, I downloaded my PV arrays data from Solcast and just simply totalled the 30-minute slots that it provides and found that they agreed spot on with SolisAgileManager and were double what I was seeing in HA. I then looked at the 'Attribute' data that arrives with the 'sensor.solcast_pv_forecast_forecast_today' entity and discovered something that might sort of explain what's happening. When I totalled the "Detailed Forecast" 30-minute slots from the attributes, they agreed spot on with both my Solcast CSV downloads and SolisAgileManager. However, when I looked further down the attribute data I noticed "Detailed Hourly" 1-hour slots. I then totalled these and discovered that they came to exactly half of what the 30-minute slots added up to and agreed to the penny with what I was seeing in HA. I have attached a snapshot of my XL spreadsheet which illustrate my findings. What I need to understand is why the 1-hour slots total to half of the 30-minute slots and more importantly, why do the 1-hour slots give me a much more accurate forecast than the raw 30-minute slots from Solcast???? Sorry in advance if I am being a pain here! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 14 replies
-
Without the source data in your spreadsheet, this is only a guess - but it looks like you are summing power (kW) rather than summing energy (kWh). Hard to tell from an image of the spreadsheet. Share more if you would like a more detailed explanation. But the key point is that the Solcast forecasts are power forecasts. You can convert them to energy (and the integration does this for the daily and remaining energy sensors). |
Beta Was this translation helpful? Give feedback.
-
Hi, many thanks for the quick response. Analysis.xlsx |
Beta Was this translation helpful? Give feedback.
-
A more detailed eplanation, @HarryFlatter. #38 (comment) |
Beta Was this translation helpful? Give feedback.
-
OK, @HarryFlatter, you're definitely trying to sum half hourly or hourly power predictions. That's not how Power works :) The HA Attributes are the data as returned by Solcast, which are also Power (kW) estimates - even though these attributes are on an energy sensor (such as Forecast Today) which is in kWh. They represent Solcast's estimate of the average power over either 30 minutes or one hour, depending on which series you're looking at. You can accidently correctly sum the 60 minute power figures, because 1kW over 1 hour is 1kW/h of energy. But 1kW over 30 minutes is 0.5kW of energy. Imagine if you had a flat curve that was 1kW from 6am to 6pm. If you figure that out, that's 12kWh, because the 1kW was generating for 12 hours. Now, if you happen to sum up 1 over 12 hourly buckets, you get 12. But the power estimates for half-hourly power will still be 1kW - that's the estimate for that particular half hour. But if you sum up 24 half hourly buckets from 6am to 6pm, you'll get 24 now. That's because you're summing power, rather than converting to energy first. 1kW for 30 minutes is 0.5kWh. See attached spreadsheet with corrected workings (highlighting your values vs corrected values). Often you might see "convert kW to kWh by dividing by 2" when it talks about 1/2-hourly power forecasts, but the correct way is to multiply by the integration period (30 minutes) divided by an hour (60 minutes) to convert a power figure for a period of time to the energy for that period of time. |
Beta Was this translation helpful? Give feedback.
-
Yes, thanks @BJReplay - this is really useful. Currently I'm calculating forecast power by taking the 30-min forecast reading in kW and dividing by 2. However, I think your approach of taking the current and next reading and using them to make an average across the 30-minute period is liable to be much better, as it'll reflect the delta for that period. Appreciate the explanations! |
Beta Was this translation helpful? Give feedback.
-
My app is intentionally completely independent from HA, so has absolutely nothing to do with it. So that's not really an option (and I'm trying to get away from HA, not integrate more closely with it, so....
I guess my point is that my app can be installed locally, on every platform, or via docker, on every platform. HA is the same. I just don't really want the support overhead of trying to help people match up their different installation etc. Again, one of my goals here is to make HA redundant, because I'm tired of maintaining it for the minimal value it provides. That's one of the primary reasons I'm writing my app. But... thanks for the info and suggestions. If my stance changes in future, or I find myself with excessive time, I'll certainly consider what you've suggested. But given that I don't run solcast in HA at all (ever since the dev deleted the repo and broke the solcast integration I just deleted it and haven't bothered looking back since) there's not much value in this for me. :) |
Beta Was this translation helpful? Give feedback.
OK, @HarryFlatter, you're definitely trying to sum half hourly or hourly power predictions. That's not how Power works :)
The HA Attributes are the data as returned by Solcast, which are also Power (kW) estimates - even though these attributes are on an energy sensor (such as Forecast Today) which is in kWh.
They represent Solcast's estimate of the average power over either 30 minutes or one hour, depending on which series you're looking at.
You can accidently correctly sum the 60 minute power figures, because 1kW over 1 hour is 1kW/h of energy. But 1kW over 30 minutes is 0.5kW of energy.
Imagine if you had a flat curve that was 1kW from 6am to 6pm. If you figure that out, that's 12kWh, b…