This is a custom integration for Home Assistant to retrieve solar forecast data from the solarprognose.de service and provide it as sensors.
Read this document in other languages: Deutsch
- A running Home Assistant instance.
- A user account at solarprognose.de to obtain a personal Access Token.
The easiest way to install this integration is through the Home Assistant Community Store (HACS).
-
(Coming Soon) Via the HACS Default Repository:
- Navigate to HACS > Integrations and search for "Solar Prediction".
- Click "Install".
-
Manual Installation via a Custom Repository:
- Navigate to HACS > Integrations.
- Click the three-dots menu in the top right and select "Custom repositories".
- Add the URL to this repository:
https://github.com/code-chicken/ha-solar-prediction - Select the category "Integration".
- Click "Add".
- The integration will now appear in the search, and you can install it like any other.
After installing via HACS, you need to configure the integration in Home Assistant.
- Navigate to Settings > Devices & Services.
- Click the + Add Integration button in the bottom right.
- Search for "Solar Prediction" and select it.
- In the configuration dialog, enter your Access Token and your Project (e.g., your email address).
The integration creates one device with the following sensors:
- Today Total: The total predicted solar energy for the current day in kWh.
- Tomorrow Total: The total predicted solar energy for the next day in kWh.
- API Status: Shows the connection status to the
solarprognose.deAPI ("OK" or an error message).
The "Today Total" sensor also contains the detailed hourly forecast in its attributes, which can be used for visualizations.
Here is an example using the ApexCharts-Card to display the hourly forecast curve and the daily total value:
type: vertical-stack
cards:
- type: entity
entity: sensor.solar_prediction_today
name: Solar Prediction Today (Total)
- type: custom:apexcharts-card
graph_span: 24h
span:
start: day
series:
- entity: sensor.solar_prediction_today
name: Power Forecast
unit: kW
type: area
curve: smooth
stroke_width: 2
data_generator: |
const forecast = entity.attributes.hourly_forecast;
if (!forecast) return [];
return Object.entries(forecast).map(([timestamp, values]) => {
return [new Date(parseInt(timestamp) * 1000), values.power_kw];
});
yaxis:
- min: 0
decimals: 2Note: You may need to replace sensor.solar_prediction_today with the correct entity ID of your sensor.
Issues and feature requests are welcome! Please open an issue in this GitHub repository.
This project is licensed under the MIT License.