Home Assistant HACS custom integration that maps custom forecast sensors to a unified solar forecast format compatible with the Energy Dashboard.
- Config Flow in the UI
- Configurable days: today up to +7 (only enabled days are used)
- Per-day selectable source format:
ml(Solar-Forecast-ML style,attributes.hours)solcast(Solcast style,attributes.detailedForecast)
- Optional fallback integration for historical gaps (for example
solcast_solar) - Energy-compatible sensors (
device_class: energy,state_class: total,unit: kWh) - Registers as a solar forecast provider for the Energy Dashboard
- Add this repository to HACS as a custom repository (type
Integration). - Install the integration.
- Restart Home Assistant.
- Add the
Custom Forecast Solarintegration via the UI.
The Config Flow exposes three fields per day index 0..7:
enabled— enable this day's mappingentity— source sensor entityformat—mlorsolcast
Optional fallback settings:
fallback_enabled— enables backfilling of missing past slotsfallback_domain— integration domain (for examplesolcast_solar)fallback_config_entry_id— selected config entry from that integration
Example:
- Day 0:
sensor.remoteprognose_heute, formatml - Day 1:
sensor.remoteprognose_morgen, formatml - Day 5:
sensor.solcast_pv_forecast_forecast_day_5, formatsolcast
After configuring the integration:
- Open Settings → Energy
- Under Solar, click Add solar generation or consumption
- Select the
custom_forecast_solarintegration - The integration should automatically provide the configured forecasts
The integration registers itself as a solar forecast provider for all configured days.
If enabled, missing past wh_hours slots are backfilled from the configured fallback integration. Current and future slots from this integration are kept as primary.
Note: The Energy Dashboard will only display forecasts when at least day 0 (today) is configured.
attributes.hours: mapping of"HH:00" -> kWh- optional daily value may appear in
stateorattributes.raw
- preferred:
attributes.detailedForecastentries containing:period_startpv_estimate- optional
pv_estimate10,pv_estimate90
- fallback:
attributes.estimateorstate
For each enabled day the integration creates an energy sensor with:
- daily value in kWh
detailedForecast(ISO-formatted timestamps in half-hour intervals)detailedHourly(hourly aggregation)
These sensors are created under sensor.custom_forecast_solar_forecast_* in Home Assistant.
If the Energy Dashboard does not display the forecast:
- Check logs: set logger for
custom_components.custom_forecast_solar - Call the debug service:
custom_forecast_solar.get_forecast_debug - Validate entities: ensure
sensor.custom_forecast_solar_forecast_todayexists - Validate sources: make sure configured source sensors exist and expose valid data
- If a source sensor is missing or provides invalid data, the coordinator update will be marked as failed.
- Changing options will automatically reload the integration.
- The integration provides forecast data to the Energy Dashboard in Wh (watt-hours) per half-hour slot.