Skip to content

GregECAT/smartinghome-homeassistant

Repository files navigation

Smarting HOME — Autonomous Energy Management

Smarting HOME — Autonomous Energy Management

Professional AI-powered Home Energy Management System for Home Assistant

HACS Home Assistant License Version Python

🌐 Website📖 Documentation🐛 Issues🛒 Buy License

Created by GregECATSmarting HOME 🇵🇱


🎯 What is Smarting HOME?

Smarting HOME is a commercial-grade HACS integration that transforms your Home Assistant into an intelligent energy command center. It autonomously manages solar production, battery storage, grid trading, and home loads — maximizing savings on the Polish energy market.

💡 Built for real-world Polish prosumers — optimized for G13 tariff, RCE dynamic pricing, net-billing, GoodWe inverters, and Lynx batteries.


✨ Key Features

🧠 3-Layer HEMS Engine

Autonomous decision making with three strategy layers:

  • W1 — G13 Schedule: Time-based tariff optimization
  • W2 — RCE Dynamic: Real-time market price reactions
  • W3 — SOC Safety: Battery and grid protection

🤖 AI Energy Advisor

Integrated AI for intelligent recommendations:

  • Google Gemini 2.5 Pro — Energy optimization advice
  • Anthropic Claude Sonnet — Natural language reports
  • Anomaly detection & forecast-aware decisions

💰 Financial Optimization

  • G13 tariff zones: off-peak 0.63, morning 0.91, afternoon 1.50 PLN/kWh
  • RCE PSE dynamic sell prices with trend analysis
  • Night arbitrage: charge at 0.63, sell at 1.50 PLN = ~177 PLN/month
  • G13 vs RCE spread calculation & sell evaluation

🛡️ Safety Cascades

  • Voltage protection: 252V → 253V → 254V tiered response
  • PV surplus: 2kW → 3kW → 4kW progressive load activation
  • SOC emergency: Force charge at < 20%
  • SOC checkpoints: 11:00 (50%) and 12:00 (70%)

📊 100+ Sensors & Entities

  • 33 computed sensors (grid, tariff, RCE, forecasts, economics)
  • 3 binary sensors (peak detection, license status)
  • 5 control switches (auto mode, arbitrage, cascade)
  • 2 selects (EMS mode, strategy) + 3 number controls

🎨 Ready-to-Use Dashboards

  • ⚡ Power Flow — Animated Sunsynk card (3-phase, 2 MPPT)
  • 🤖 HEMS Control — Full control panel with quick actions
  • 💲 Economics — Financial analytics & arbitrage calculator

🔧 Supported Hardware

  • Inverter: GoodWe BT series (3-phase hybrid) — UDP / Modbus RS485
  • Battery: Lynx Home U 10.2 kWh (LiFePO4) — Via inverter
  • Grid: Polish market (Tauron, Enea, PGE, Energa) — G13 / G11 / C-tariff
  • Market Data: RCE PSE dynamic pricing — REST API
  • Forecast: Solcast / Forecast.Solar — HA integration

📦 Installation

Via HACS (Recommended)

  1. Open HACS in your Home Assistant instance
  2. Click the menu → Custom repositories
  3. Add URL: https://github.com/GregECAT/smartinghome-homeassistant
  4. Select category: Integration
  5. Search for "Smarting HOME" and click Download
  6. Restart Home Assistant

Manual Installation

# Clone the repository
git clone https://github.com/GregECAT/smartinghome-homeassistant.git

# Copy to your HA config directory
cp -r smartinghome-homeassistant/custom_components/smartinghome /config/custom_components/

# Restart Home Assistant

⚙️ Setup Wizard

After installation, add the integration via Settings → Devices & Services → Add Integration → Smarting HOME.

The setup wizard guides you through:

Step 1 — Choose License Mode 🔑

Choose between FREE (no license needed) or PRO (license key required):

Feature 🆓 FREE ⭐ PRO 🏢 ENTERPRISE
Sensors (33) ✅ All ✅ All ✅ All
G13 Tariff + RCE
HEMS Auto Mode
Night Arbitrage
Voltage/PV Cascades
AI Advisor
Export Limit Control
Blueprints 2 basic 7 full 7 full
Dashboards 1 basic 3 full 3 full
Multi-site

💡 FREE mode works immediately — no license server, no registration needed.

Step 2 — Inverter Configuration ⚡

Enter your GoodWe device ID (found in GoodWe integration). Optionally enable Modbus RS485 for extended diagnostics.

Step 3 — Tariff Selection 💶

Choose your electricity tariff:

  • G13 (recommended) — 3-zone time-of-use with winter/summer schedules
  • G11 — Single rate
  • C-tariff — Commercial rates

Enable RCE PSE dynamic pricing for real-time market data.

Step 4 — AI Configuration 🤖 (PRO only, optional)

Provide your own API keys for AI energy advisory:


🔄 Upgrade FREE → PRO

Already installed as FREE? You can upgrade to PRO without reinstalling:

  1. Go to Settings → Devices & Services → Smarting HOME
  2. Click Configure (⚙️ gear icon)
  3. Enter your PRO license key in the 🔑 License Key field
  4. Click Submit — license is validated automatically
  5. Restart Home Assistant to activate all PRO features

💡 Buy PRO license at smartinghome.pl/buy

After upgrade you'll unlock: Night Arbitrage, Voltage/PV Cascades, AI Advisor, Export Limit Control, all 7 Blueprints, 3 full Dashboards.


🖥️ Dashboards

Automatic — Sidebar Panel

After setup, Smarting HOME panel appears automatically in the HA sidebar with 5 tabs:

  • 📊 Przegląd — Live PV/Grid/Battery/Load, SOC bar, daily stats
  • ⚡ Energia — 3-phase voltage, PV forecast, quick actions
  • 💰 Taryfy & RCE — G13 zones, RCE prices, trends
  • 🔋 Bateria — SOC, energy, runtime, arbitrage calculator
  • 🤖 HEMS — Mode control, AI advisor, reports

Click ⊞ Pełny ekran for fullscreen (kiosk) mode — perfect for wall-mounted tablets.

Manual — YAML Dashboards

For additional dashboards, add to configuration.yaml:

lovelace:
  dashboards:
    smartinghome-hems:
      mode: yaml
      title: "HEMS Control"
      icon: mdi:brain
      show_in_sidebar: true
      filename: custom_components/smartinghome/dashboards/hems_control.yaml
    smartinghome-power:
      mode: yaml
      title: "Power Flow"
      icon: mdi:solar-power-variant
      show_in_sidebar: true
      filename: custom_components/smartinghome/dashboards/power_flow.yaml
    smartinghome-economics:
      mode: yaml
      title: "Economics"
      icon: mdi:currency-usd
      show_in_sidebar: true
      filename: custom_components/smartinghome/dashboards/economics.yaml

Restart Home Assistant after adding.


📊 HEMS Strategy — Trójwarstwowy System

┌─────────────────────────────────────────────────────────────┐
│                    SMARTING HOME HEMS                         │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌─── W3 — SAFETY ──────────────────────────────────────┐   │
│  │  SOC Emergency (<20%) │ Voltage Cascade │ SOC Checks  │   │
│  │  ↓ overrides W1+W2                                    │   │
│  └───────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌─── W2 — RCE DYNAMIC ─────────────────────────────────┐   │
│  │  Real-time market prices │ Cheapest/Expensive windows │   │
│  │  ↓ adjusts W1 decisions                               │   │
│  └───────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌─── W1 — G13 SCHEDULE ────────────────────────────────┐   │
│  │  07:00 Sell │ 13:00 Charge │ 16:00 Peak │ 21:00 Night │   │
│  │  Base layer — time-of-use optimization                │   │
│  └───────────────────────────────────────────────────────┘   │
│                                                              │
└─────────────────────────────────────────────────────────────┘

W1 — G13 Schedule (Taryfa czasowa)

Time (Winter) Zone Price Action
07:00–13:00 ☀️ Morning peak 0.91 PLN/kWh Block charging, export PV to grid
13:00–16:00 🔋 Off-peak 0.63 PLN/kWh Charge battery from PV
16:00–21:00 💰 Afternoon peak 1.50 PLN/kWh Battery → Home, minimize import
21:00–07:00 🌙 Off-peak 0.63 PLN/kWh Auto-consumption, night arbitrage
Weekends 🌙 Off-peak 0.63 PLN/kWh All day off-peak

ℹ️ Summer schedule: Peak shifts to 19:00–22:00

W2 — RCE Dynamic (Ceny dynamiczne)

RCE Price Level Action
< 0 PLN/MWh 💚 Negative Charge + enable all loads (free energy!)
< 150 PLN/MWh 🟢 Cheap Prioritize grid charging
150–300 PLN/MWh 🟡 Normal Standard operation
300–500 PLN/MWh 🟠 Expensive Sell energy, minimize import
> 500 PLN/MWh 🔴 Very expensive Maximum export, disable loads

W3 — SOC Safety (Bezpieczeństwo)

Condition Trigger Action
SOC < 20% Immediate ⚠️ Emergency charge
SOC < 50% at 11:00 Checkpoint Enable charging
SOC < 70% at 12:00 Checkpoint Enable charging
Voltage > 252V Cascade T1 Boiler ON
Voltage > 253V Cascade T2 Boiler + AC ON
Voltage > 254V Cascade T3 All loads + restore charging
Voltage < 248V (5 min) Recovery Cascade OFF

🤖 AI Energy Advisor

The AI Advisor uses your live system data to provide context-aware energy management recommendations.

# Ask AI for real-time optimization advice
service: smartinghome.ask_ai_advisor
data:
  question: "Should I export energy to the grid right now?"
  provider: auto  # auto | gemini | anthropic

# Generate a comprehensive daily report
service: smartinghome.generate_report

Capabilities:

  • ⚡ Real-time charge/discharge optimization
  • 📊 AI-generated daily energy reports
  • 🔍 Anomaly detection in usage patterns
  • 🌤️ Forecast-aware scheduling recommendations
  • 💰 Arbitrage opportunity identification

🔐 Requires PRO license and your own AI API key (Google or Anthropic)


🔧 Services

  • ⚙️ smartinghome.set_mode
    Zmień tryb HEMS: auto, sell, charge, peak_save, night_arbitrage, emergency, manual (DEMO+)
  • 🔋 smartinghome.force_charge
    Force battery charging at max current (18.5A) (DEMO+)
  • smartinghome.force_discharge
    Force battery discharge (block charging) (DEMO+)
  • 🔌 smartinghome.set_export_limit
    Set grid export power limit (0–16000W) (PRO+)
  • 🤖 smartinghome.ask_ai_advisor
    Query AI energy advisor with a question (PRO+)
  • 📊 smartinghome.generate_report
    Generate AI-powered daily energy report (PRO+)

📋 Automation Blueprints

7 ready-to-use automation blueprints included:

  • ☀️ Morning Sell Mode [Layer W1]
    Schedule: 07:00 weekdays — Block charging, enable max export.
  • 🔋 Midday Charge Mode [Layer W1]
    Schedule: 13:00 weekdays — Enable battery charging from PV.
  • 🌙 Night Arbitrage [Layer W1]
    Schedule: 23:00 daily — Off-peak charge for peak discharge.
  • 💰 RCE Cheapest Window [Layer W2]
    Schedule: Dynamic — Auto-charge during cheapest prices.
  • 🔥 RCE Expensive Alert [Layer W2]
    Schedule: Dynamic — Alert during peak prices.
  • ☀️ PV Surplus Cascade [Layer W3]
    Schedule: Dynamic — Progressive load activation (2/3/4 kW).
  • Voltage Protection [Layer W3]
    Schedule: Dynamic — Cascade protection (252/253/254V).
  • ⚠️ SOC Emergency [Layer W3]
    Schedule: Dynamic — Emergency charge when SOC < 20%.

All blueprints are located in custom_components/smartinghome/blueprints/.


🎨 Dashboards

Three pre-configured Lovelace dashboard configs:

Dashboard Description Required HACS Cards
Power Flow Animated 3-phase power flow with 2 MPPT sunsynk-power-flow-card
🤖 HEMS Control Full system controls, G13/RCE status, AI buttons None (core)
💲 Economics Financial analytics, autarky, arbitrage calculator None (core)

Dashboard YAML files: custom_components/smartinghome/dashboards/


🌍 Internationalization

Language Config Flow Entities Errors
🇬🇧 English
🇵🇱 Polish

📁 Repository Structure

smartinghome-homeassistant/
├── .github/workflows/validate.yml       # CI/CD pipeline
├── assets/banner.png                    # Brand assets
├── hacs.json                            # HACS manifest
├── LICENSE                              # Commercial license
├── README.md                            # This file
├── info.md                              # HACS store page
└── custom_components/smartinghome/
    ├── __init__.py                      # Integration entry point
    ├── api.py                           # License API client
    ├── ai_advisor.py                    # Gemini + Claude advisor
    ├── binary_sensor.py                 # Binary sensor platform
    ├── config_flow.py                   # 4-step setup wizard
    ├── const.py                         # Constants & definitions
    ├── coordinator.py                   # Data coordinator (60+ sensors)
    ├── energy_manager.py                # 3-layer HEMS engine
    ├── license.py                       # License management
    ├── manifest.json                    # HA integration manifest
    ├── number.py                        # Number platform
    ├── select.py                        # Select platform
    ├── sensor.py                        # Sensor platform (33 sensors)
    ├── services.py                      # Service handlers
    ├── services.yaml                    # Service definitions
    ├── strings.json                     # Default strings
    ├── switch.py                        # Switch platform
    ├── translations/                    # i18n
    │   ├── en.json
    │   └── pl.json
    ├── blueprints/                      # Automation blueprints
    │   ├── hems_morning_sell_mode.yaml
    │   ├── hems_midday_charge_mode.yaml
    │   ├── hems_night_arbitrage.yaml
    │   ├── hems_soc_emergency.yaml
    │   ├── hems_voltage_protection.yaml
    │   ├── hems_rce_cheapest_window.yaml
    │   └── hems_pv_surplus.yaml
    └── dashboards/                      # Lovelace configs
        ├── power_flow.yaml
        ├── hems_control.yaml
        └── economics.yaml

📞 Support & Contact

Channel Link
🌐 Website smartinghome.pl
🛒 Buy License smartinghome.pl/buy
📖 Documentation smartinghome.pl/docs
🐛 Bug Reports GitHub Issues
📧 Email kontakt@smartinghome.pl
💬 Community Home Assistant Community

👨‍💻 Author

GregECAT
GregECAT

Founder • Developer • Energy Enthusiast
Smarting HOME 🇵🇱

📄 License

This software is proprietary and protected under the Smarting HOME Commercial License.

A valid license key is required for PRO and ENTERPRISE features. DEMO mode is available for evaluation with limited functionality.

See the full LICENSE file for details.


© 2026 Smarting HOME by GregECAT
Built with ❤️ for the Polish energy market

smartinghome.pl

About

Smarting HOME — Autonomous Energy Management Professional AI-powered Home Energy Management System for Home Assistant

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors