Thanks for working on this. Discovered Solcast a couple of days ago, so saves me making a custom_componenet.
Will have a look at adding this to my setup when I get home from work.
Are you using this data to automate anything?
What I would like to do is use it to automate charging my battery system off the grid over night when prices are cheap, if there wont be enough solar to last through to the next day.
What a nice use case! Which battery system do you have? Is it controllable via HomeAssistant?
I am planning to optimize my EV charging in order to estimate, when it will be fully charged using PV power only in my green charging mode (some documentation is here: https://danner-web.de/2020/04/ev-green-charging/).
I still have a bug in the code of the solcast component when using a fast MySQL database as recorder: sometimes wrong values of the historical solcast model are stored at the time of the request. I will have a look to that soon.
It is still on the todo list, I want fix all remaining issues/bugs before. I am also still thinking of improving the forecast data storage in Home Assistant to be able to support more use cases, maybe hourly data instead/in addition to daily forecasts.
Just one small automation for me. I automatically switch on (at the wall) my (very dumb… which actually makes it easier) clothes dryer when my power export exceeds a given level (I think I have it set to 600W at the moment). That way clothes are left in the dryer ready to go the night before, it switches on at a point (avoiding high power use when solar is not yet avaailable).
Hi @wills106… my yaml posted on 3 March creates a sensor whose content you can use to POST your productions data to SolCast for tuning. But it doesn’t actually send the data—you’ll need an automated API call to SolCast for that. I’m on my work computer at the moment so don’t have access to my yaml. Will try to post it at lunchtime.
Yep. On the summary (front) page it’ll show “PV Tuning” and when it got the last data pushed through. Once you click in, you can select the “Accuracy” graph which compares your uploaded data with their estimated actuals and 1-hour forward looking forecast values. My correlation coefficient is around 0.98.
My solcast integration includes a service call to push values to solcast API. My plan is to include an automatic pushing of values in the solcast integration, however I still need to figure out the best way to get the average of a certain period …
push_measurement:
desciption: >
Pushes PV measurements to Solcast for model fine tuning.
fields:
total_power:
desciption: >
The total power of the PV system for the given period.
example: 1.23456
period:
desciption: >
The period of the total power (e.g. PT5M, PT15M, PT30M, ...)
example: PT5M
period_end:
desciption: >
The end period of the total power in UTC timezone
example: 2018-02-02T03:30:00.0000000Z
Good point, at the moment it is hard coded but you can create an automation and use the service call to force pull the current forecast (be aware that the forecast for today will only contain the remaining energy until midnight, the forecast of tomorrow and the day after tomorrow will be for the whole day starting from midnight local timezone).
The json response for the forecast API call only contains future time so I decided to fetch the forecast at midnight to include the whole day (might be more accurate at sunrise actually). I might introduce a parameter for that at next release.
update_forecast:
description: >
Fetches the forecasts from Solcast.
First of all I wanted to thank you for your work and to give it to everybody I just received my solar panels a few days ago and started using home assistant for it, so I’m relatively new to all this.
I’ve been able to run your script and I can get the history data and forecast. However, there is 2 small issues:
I had to change line 112 by adding ssl=False otherwise I wasn’t able to connect
I can’t really use the forecast since I’m using the data in Grafana to display everything I need. Is there any way to get the forecast 30 minutes by 30 minutes as with the history data?
@dannerph Just got this installed, also trying to do what @wills106 was saying, set my Tesla Powerwall to charge overnight (2am) if the next day will be a bad day for solar. The powerwall does sort of do this for you, but it doesn’t seem very accurate and over fills quite often.
Hi @ParalaX,
nice to see people using my code, so it was a good investment of time
I had to change line 112 by adding ssl=False otherwise I wasn’t able to connect
I would avoid ssl=False, as it neglects the SSL certificate check and thus renders transport encryption broken. It might be related to your systems certificate store, maybe the root CA (from Amazon) is missing?
I can’t really use the forecast since I’m using the data in Grafana to display everything I need. Is there any way to get the forecast 30 minutes by 30 minutes as with the history data?
I need to check if I can also publish future events on the event bus and what the integrated recorder component, which is compatible with multiple backends, is doing with them. But i remember something that it was no possible that’s why I created another solution. I will check again when I find some time.
actually, I have not yet setup the pushing of measurements by myself (had still to fix reading from the smart meter, which is working now). In addition, I still need to figure out how to aggregate the measurement values on the time dimension (my meter is pushing on 2-3 seconds resolution) before I can forward them to solcast.