Skip to content

Zara-Toorox/Solar-Forecast-ML

Repository files navigation

Solar Forecast ML V18 "Sarpeidon"

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

Version 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. 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

Website & Documentation


☀️ 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

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

Hubble AI 3.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 V3.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.

🧠 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.

🌍 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.

🧠 AI & Machine Learning

  • Hubble ensemble with Attention mechanisms for temporal reasoning.
  • Automatic daily training and hyperparameter tuning.
  • Feature importance analysis to reveal what drives your predictions.
  • 28 engineered features: time, weather, astronomy, history, panel geometry.
  • Data filtering for anomalies (inverter clipping, zero-export limits, snow days).

🌦️ Weather Intelligence

  • Blends 5 sources (Open-Meteo, Bright Sky, Pirate Weather, wttr.in, ECMWF) with expert weighting.
  • Multi-stage corrections: rolling biases, hourly adjustments, condition-specific tweaks.
  • Fog/haze detection and cloud trend/volatility tracking.

🕵️ Detection & Protection

  • Shadow mapping and pattern learning for fixed and moving obstacles.
  • Frost/fog warnings via dew point and visibility analysis.
  • Full zero-export & battery-full curtailment support.
  • Self-healing transactional SQLite database with crash recovery and 30-day backup retention.

❄️ Seasonal Intelligence

  • Automatic Winter Mode (Nov–Feb) with low sun-angle adjustments.
  • Rolling DNI tracking for real-time atmospheric clearness monitoring.

📐 Panel Group Support

  • Up to 4 independent panel groups with different orientations, tilts, and capacities.
  • Individual efficiency learning and per-group AI predictions.

📊 Sensors

Forecast

Sensor Description
solar_forecast_ml_today Today's forecast (kWh)
solar_forecast_ml_tomorrow Tomorrow's forecast (kWh)
solar_forecast_ml_day_after_tomorrow Day after tomorrow (kWh)
solar_forecast_ml_next_hour Next hour prediction (kWh)
solar_forecast_ml_peak_production_hour Best production hour today

Production

Sensor Description
solar_forecast_ml_production_time Production hours (start/end/duration)
solar_forecast_ml_max_peak_today Peak power today (W)
solar_forecast_ml_max_peak_all_time All-time peak power (W)
solar_forecast_ml_expected_daily_production Daily production target

Statistics

Sensor Description
solar_forecast_ml_average_yield Cumulative average yield
solar_forecast_ml_average_yield_7_days 7-day rolling average
solar_forecast_ml_average_yield_30_days 30-day rolling average
solar_forecast_ml_monthly_yield Current month total
solar_forecast_ml_weekly_yield Current week total

AI & Diagnostics

Sensor Description
solar_forecast_ml_model_state Active prediction model (AI / Rule-Based)
solar_forecast_ml_model_accuracy Current prediction accuracy (%)
solar_forecast_ml_ai_rmse Model quality (Excellent / Very Good / Good / Fair)
solar_forecast_ml_training_samples Available training samples
solar_forecast_ml_ml_metrics MAE, RMSE, R² metrics

Shadow & Weather

Sensor Description
solar_forecast_ml_shadow_current Current shadow level (Clear / Light / Moderate / Heavy)
solar_forecast_ml_performance_loss Shadow-related production loss (%)
solar_forecast_ml_cloudiness_trend_1h 1-hour cloud trend
solar_forecast_ml_cloudiness_trend_3h 3-hour cloud trend
solar_forecast_ml_cloudiness_volatility Weather stability index

📈 Learning Lifecycle

Phase 1 — Day 0: Physics-Backbone active immediately. Solid baseline (~70% accuracy) from the very first day.

Phase 2 — Day 10+: "Miss Ridge" AI activates. Early-stage learning begins, geometry converges. (~85–90% accuracy)

Phase 3 — Day 30+: Full Hubble Transformer activation. Complete ensemble blending at peak precision. (93–97% accuracy)

Phase Timeline Accuracy
Fresh Install Day 0 ~70% — Physics backbone active
Early Learning Day 1–10 Miss Ridge activates, geometry learning
Calibration Day 10–30 Ensemble blending, tilt/azimuth to ±3°
Full Activation Day 30+ Hubble at peak, 93–97% accuracy

💡 Shortcut: Have old data? Use bootstrap_physics_from_history to import up to 6 months of Home Assistant history and hit 90%+ accuracy on Day 1.


🚀 Installation

HACS (Recommended)

  1. HACS > Integrations > Custom repositories
  2. Add https://github.com/Zara-Toorox/ha-solar-forecast-ml (Integration category)
  3. Install Solar Forecast ML
  4. Restart HA, wait 10–15 minutes, then restart once more.

Manual

  1. Download the latest release.
  2. Copy to config/custom_components/solar_forecast_ml.
  3. Restart HA twice as above.

Configuration

Add via Settings > Devices & Services. Key inputs:

  • Power sensor (W) + Daily yield sensor (kWh, must reset at midnight) — required
  • System capacity (kWp) + Panel groups (Power(Wp)/Azimuth(°)/Tilt(°)/[EnergySensor]) — recommended
  • Optional sensors: temperature, lux, radiation, humidity, wind

🧩 Companion Modules

Install via the install_extras service:

Module Description Platform
SFML Stats Complete solar & energy dashboard: real-time flows, historical charts, forecast vs. actual, cost tracking. x86_64 only
Grid Price Monitor Dynamic electricity spot prices for DE/AT. All

📋 Requirements

  • Home Assistant 2026.3.0+
  • Power sensor (W) + Daily yield sensor (kWh, midnight reset)
  • ~50 MB disk space · ~200 MB RAM during AI training
  • Runs on x86_64, ARM, Raspberry Pi 4/5 (SFML Stats: x86_64 only)
  • Optional but recommended: lux sensor, temperature sensor, solar radiation sensor

❓ Troubleshooting

  • Low predictions? Verify kWp matches total installed power. Check that yield sensor resets at midnight and reads in kWh.
  • AI stalled? Check solar_forecast_ml_training_samples — minimum 10 needed. Allow 3–7 days for initial collection.
  • Shadows off? Add a lux sensor. System needs clear-sky days to establish baseline patterns.
  • Logs: /config/solar_forecast_ml/logs/solar_forecast_ml.log

🛡️ Your Data Stays Yours — A Privacy Commitment

Solar Forecast ML was designed from day one with one non-negotiable principle: your data never leaves your home.

This isn't a marketing claim. It's an architectural fact:

No Large Language Models involved — There is no connection to ChatGPT, Claude, Gemini, Grok, or any other AI service. Every calculation, every prediction, every learning step happens entirely within your own Home Assistant instance. The "AI" in Solar Forecast ML is your AI — running on your hardware, trained on your data.

No telemetry, no analytics, no tracking — The integration contains no usage tracking, no error reporting endpoints, no analytics libraries, and no background callbacks of any kind. I have no visibility into whether you've installed this, how you use it, or what your system produces.

No data shared with me or anyone else — Your production data, your sensor readings, your location, your learned model weights — none of it is ever transmitted anywhere. Not to me as the developer, not to third parties, not to weather services beyond the standard forecast requests that you explicitly configure.

Free weather APIs only — The integration fetches raw weather forecasts from public APIs (Open-Meteo etc.). These requests contain only coordinates — no personal data, no identifiers, no usage metadata.

Fully offline-capable — Once installed, Solar Forecast ML operates entirely within your local network. No internet connection is required for the AI to learn, predict, or correct forecasts.

In short: What happens in your Home Assistant, stays in your Home Assistant.


🔐 Protected Code Notice

Some files in this integration are obfuscated (encrypted) with an official PyArmor version.

Why is the code protected?

  1. Protection against AI Training — I want to prevent my source code from being used to train AI models like ChatGPT, Claude, Gemini, or other Large Language Models (LLMs) without permission.
  2. Intellectual Property Protection — The algorithms for solar forecasting, AI-learning, and weather analysis were developed with considerable effort and represent my intellectual property.
  3. Open Source with Limits — This integration is free for personal use, but the source code is proprietary and subject to a Non-Commercial License.
  4. Unfortunately necessary — Since code has been copied without my consent, incorporated into commercial applications, and attempts have been made to read and modify it using AI in the past, I unfortunately feel compelled to protect the source code.
  5. Transparency — If you have a legitimate interest, I'm happy to provide information about the code or disclose it. Just contact me via GitHub Issues or Discussions.

The obfuscation has no impact on functionality. The integration works identically to the non-obfuscated version. Runtime overhead is minimal.

Solar Forecast ML — Copyright (C) 2026 Zara-Toorox · Protected with PyArmor 9.2.3


📄 License

Proprietary Non-Commercial — free for personal and educational use. See LICENSE.


👤 Credits

Developer: Zara-Toorox

Thanks to Simon42 and the users & contributors of the German-speaking HA Forum "simon42" for their testing, feedback, and discussion.

Support-Forum: simon42 Community | Issues | Discussions


Developed with ☀️, late-night passion, and a stiff glass of Grog during Germany's wintertime.

About

SFML is the first fully local AI solar forecast for Home Assistant, powered by a local Attention Transformer. No external AI — such as ChatGPT, Gemini, or Grok — required. Runs entirely on your device for complete privacy.

Topics

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Languages