MCPcopy Index your code
hub / github.com/Zara-Toorox/Solar-Forecast-ML

github.com/Zara-Toorox/Solar-Forecast-ML @V32.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release V32.1.0 ↗ · + Follow
2,930 symbols 10,469 edges 196 files 679 documented · 23% updated 1d agoV32.1.2 · 2026-07-06★ 24917 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Solar Forecast ML V32 "Hubble"

The World's 1st Local Transformer-AI Solar Forecast for Home Assistant — 100% Local, 100% Private

Version Codename HACS License Platform

Your roof. Your data. Your AI. Solar Forecast ML builds a digital twin of your specific solar setup using a custom Transformer architecture that runs entirely on your Home Assistant hardware. It learns your roof geometry, local shading, microclimate, and inverter behavior — delivering 3-day hourly forecasts with up to 97% accuracy. Version 32 introduces the SFML Source-of-Truth architecture: critical production and energy calculations are handled inside SFML's own database instead of relying on Home Assistant's recorder-derived energy helpers. No cloud, no subscriptions, no data leakage. Just pure local intelligence.

Fuel my late-night ideas with a coffee? I'd really appreciate it — keep this project running!

Buy Me a Coffee


☀️ Stop Guessing. Start Knowing.

Solar Forecast ML — AI-Powered Solar Forecasting

While others provide generic solar estimates, Solar Forecast ML uses the Hubble AI Stack to build a digital twin of your specific roof. It's the first native Attention & Transformer AI designed to run entirely on your Home Assistant hardware — learning your unique setup from the ground up: roof geometry, local shading, microclimate, and inverter behavior.

Powered by proprietary AI models, a local machine learning engine, and a solar physics backbone, it delivers 3-day hourly forecasts with up to 97% accuracy after calibration. Everything runs on your hardware with a transactional SQL database for reliability. No cloud dependencies, no subscriptions, no data leakage. Your smart home gains foresight, optimizing energy use before the sun even rises.


🚀 Why Is This Different From Other Solar Forecasts?

Most integrations (like Forecast.Solar or Solcast) use static cloud models. They don't know about your neighbor's tree or why your yield drops every November. Solar Forecast ML is the evolution:

Feature Standard Cloud Forecasts Solar Forecast ML (Hubble AI)
Logic Static APIs / Generic Formulas SOTA Transformer & Attention AI
Privacy Data sent to the cloud 100% Local & Private
Shadows None or very basic Dynamic Seasonal Shadow Mapping
Environment Ignores local anomalies Detects Snow, Fog, Pollution & Altitude
Adaptability One size fits all Learns your specific inverter/panel quirks
Reliability "Black Box" predictions Physics-Backbone + AI Safeguard

🧭 Version 32.0.2 — Source of Truth Architecture

Version 32 makes SFML the authoritative runtime layer for solar production data. Home Assistant remains the interface, but SFML now owns the critical calculations, validation, and persistence path for its solar truth.

  • SFML-owned database truth — Actual production, panel-group values, forecast rows, diagnostics, and companion-module reads are backed by the SFML database.
  • Panel-group power first — Configuration is built around the power sensors (W) of the individual strings or panel groups. Daily-reset energy helpers are no longer required for the core solar setup.
  • Internal energy integration — SFML derives hourly and daily kWh values from validated group power data, reducing recorder drift, reset issues, and rounding errors.
  • Read-only Home Assistant relationship — SFML reads configured sensors from Home Assistant but keeps its own validated solar state, so HA recorder issues do not become SFML truth.
  • SOT sensors for automations — Total and per-group power/energy sensors mirror the SFML database state back into Home Assistant for dashboards, rules, and energy automations.
  • HA event-loop protection — Heavy EOD and forecast work is moved away from the main Home Assistant event loop where possible, keeping the UI responsive during model training and daily processing.

🏗️ The "Hubble" AI Stack — Enterprise Intelligence built for Home Assistant

Hubble AI 8.0 — Solar Forecast ML

"It's kind of like building a Hubble telescope in your living room just to check if the fridge light is on in the kitchen… simply because it's cool."Basti, Tester

The heart of this integration is the AI-Stack codename Hubble, a custom-built AI ensemble. I didn't just wrap a library — I built a native Transformer architecture from the ground up to fit into Home Assistant's resource limits, without needing TensorFlow or PyTorch.

This isn't a single model. It's a sophisticated ensemble of specialized AIs working in harmony:

Component Purpose What It Does
Hybrid-AI V8.0 Core Neural Engine Stacked LSTM with Multi-Head Attention and Transformer elements. Analyzes 24-hour sequences for per-panel-group forecasts, capturing complex temporal patterns.
Miss Ridge Quick-Start Model High-stability model for early-phase predictions (from Day 10 onward), bridging the gap to full ensemble activation.
Frau Holle Weather Correction AI Multi-layer perceptron that non-linearly adjusts weather data based on local sensors and historical biases.
Kalman Tracker Real-Time Adjustment Adaptive filter monitoring minute-by-minute bias, dynamically responding to weather volatility.
Physics Backbone Geometric Foundation Calculates theoretical output with a PhysicsCalibrator that learns deviations from real production (shading, efficiency, aging).
Graduated Safeguard Ensemble Oversight Monitors model agreement; blends confidently when aligned, falls back to physics during divergence. No hallucinations.
Subprocess Trainer HA Performance Guard Runs CPU-intensive EOD model training (LSTM/MLP) in an isolated Python worker process, preventing HA event-loop blockages.

🧠 How Hubble "Sees" Your Energy

Multi-Head Attention — Instead of looking at weather as a simple list, Hubble understands temporal context: how a cloudy morning should influence your battery strategy for the afternoon. It reasons across time, not just snapshots.

Graduated Safeguard — No AI "hallucinations." If the models diverge too strongly, the Physics-Backbone (pure solar geometry) steps in as a safety anchor. The AI knows when to be confident — and when to step back.

Efficiency Drift Detection — Most forecasts go wrong because they don't know your panels are dirty or aging. Hubble tracks your real-world efficiency over time and tells you when it's time to clean them.

Additional self-monitoring layers ensure long-term accuracy: - Drift Monitor & Seasonal Adjuster — Detects biases and learns seasonal patterns from real data, not calendars. - Grid Search "The Professor" — Fully automated hyperparameter optimization, extracting the maximum from your specific hardware. - Subprocess training (HA-Performance-Fix) — CPU-intensive model training runs in a separate Python process to prevent Home Assistant UI lags.


🌍 Real-World Awareness — Beyond the Horizon

Real-World Awareness — Beyond the Horizon

Solar Forecast ML is the only solar forecast integration that understands the messy reality of your environment. While other systems treat every roof as identical, Hubble monitors the real-world conditions that actually impact your production — from snow-covered panels to seasonal shadows, from coastal salt haze to altitude-dependent air mass. Every factor is learned, tracked, and applied automatically.

❄️ Snow Logic — Recognizes when panels are covered and stops contaminated data from polluting your AI training. A snow day doesn't corrupt your model.

Fog & Visibility — Uses a learned visibility tracker to evaluate which weather source is most accurate for your specific coordinates.

🌬️ Atmospheric Depth — Adjusts for actual air mass. Crucial if you live at altitude or near the sea — your atmosphere is not the same as your neighbor's.

🌳 The Moving Shadow — Learns how shadows from trees and buildings change across seasons, accounting for leaves in summer and bare branches in winter.

🌿 Air Pollution Awareness — Detects atmospheric aerosols: rapeseed pollen, coastal salt haze, industrial smog. All of it affects your production, and Hubble knows it.

🔋 MPPT & Battery Intelligence — Detects inverter clipping and battery-full curtailment. These events are excluded from AI training, so your model reflects true panel capacity — not artificially limited output.


⚡ Key Capabilities

🔮 Forecasting

  • 72-hour hourly forecasts for today, tomorrow, and the day after.
  • Dynamic scheduling tied to actual sunrise.
  • Adaptive midday re-forecasts when conditions shift significantly.
  • Per-panel-group predictions with confidence scores.
  • Clean forecast evaluation separates real physical production from curtailed or excluded hours, so MPPT throttling, clipping, and weather-alert exclusions do not distort forecast-quality metrics.
  • Rain-Gating for Similar Weather Relaxation: Automatically suppresses historical similarity scaling when rain is forecast (precipitation > 0.3 mm or rain overcast regime), preventing overoptimistic spikes on wet days.
  • Service-Triggered Reforecast Coupling: Instantly recalculates rest-o

Core symbols most depended-on inside this repo

get
called by 1505
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/lib/vue.global.prod.js
get
called by 315
custom_components/solar_forecast_ml/extra_features/sfml_stats/utils/cache.py
t
called by 314
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/i18n/runtime.js
get
called by 258
custom_components/solar_forecast_ml/core/core_user_messages.py
set
called by 166
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/lib/vue.global.prod.js
error
called by 148
custom_components/solar_forecast_ml/extra_features/grid_price_monitor/helpers/logger.py
info
called by 141
custom_components/solar_forecast_ml/extra_features/grid_price_monitor/helpers/logger.py
debug
called by 122
custom_components/solar_forecast_ml/extra_features/grid_price_monitor/helpers/logger.py

Shape

Function 2,144
Method 659
Class 127

Languages

TypeScript73%
Python27%

Modules by API surface

custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/lib/echarts.min.js1,282 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/lib/vue.global.prod.js585 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/pages/home.js79 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/pages/solar.js52 symbols
custom_components/solar_forecast_ml/__init__.py52 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/frontend/pages/energy.js27 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/storage/db_connection_manager.py25 symbols
custom_components/solar_forecast_ml/extra_features/grid_price_monitor/coordinator.py25 symbols
custom_components/solar_forecast_ml/config_flow.py25 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/sensors/price_sensors.py24 symbols
custom_components/solar_forecast_ml/extra_features/sfml_stats/config_flow.py24 symbols
custom_components/solar_forecast_ml/extra_features/grid_price_monitor/sensors/price_sensors.py24 symbols

For agents

$ claude mcp add Solar-Forecast-ML \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact