diff --git a/README.md b/README.md index 2dff35b5..55f016bf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Growatt Modbus Integration for Home Assistant โ˜€๏ธ ![HACS Badge](https://img.shields.io/badge/HACS-Custom-orange.svg) -![Version](https://img.shields.io/badge/Version-0.0.2b-blue.svg) +![Version](https://img.shields.io/badge/Version-0.0.3-blue.svg) [![GitHub Issues](https://img.shields.io/github/issues/0xAHA/Growatt_ModbusTCP.svg)](https://github.com/0xAHA/Growatt_ModbusTCP/issues) [![GitHub Stars](https://img.shields.io/github/stars/0xAHA/Growatt_ModbusTCP.svg?style=social)](https://github.com/0xAHA/Growatt_ModbusTCP) @@ -22,26 +22,51 @@ Based on the official **[Growatt Modbus RTU Protocol V1.39](https://shop.franken - ๐ŸŒก๏ธ **Complete diagnostics** - Temperatures, fault codes, derating status - ๐Ÿ’พ **No cloud dependency** - Local polling, your data stays yours - ๐Ÿ”„ **Grid power inversion** - Fix backwards CT clamp installations with one click -- ๐ŸŽ›๏ธ **Multi-model support** - Profiles for MIN, MID, MAX, SPH, and MOD series +- ๐ŸŽ›๏ธ **Multi-model support** - 14 profiles covering MIN, MID, MAX, SPH, MOD, TL-XH, MAC, MIX, SPA, and WIT series --- ## ๐Ÿ”Œ Supported Inverter Models -The integration supports multiple Growatt inverter series with dedicated register maps: +The integration supports **14 different Growatt inverter profiles** with dedicated register maps: -| Inverter Series | Model Range | Type | Phase | Tested | Notes | -|----------------|-------------|------|-------|--------|-------| -| **MIN 3000-6000TL-X** | 3000-6000TL-X | Grid-tied | Single | โš ๏ธ Untested | 2 PV strings, 3-6kW | -| **MIN 7000-10000TL-X** | 7000-10000TL-X | Grid-tied | Single | โœ… **Tested** | 3 PV strings, 7-10kW | -| **MID 15000-25000TL3-X** | 15000-25000TL3-X | Grid-tied | Three | โš ๏ธ Untested | Commercial, 15-25kW | -| **MAX 50000-125000TL3-X** | 50000-125000TL3-X | Grid-tied | Three | โš ๏ธ Untested | Industrial, 50-125kW | -| **SPH 3000-10000** | SPH 3000-10000 | Hybrid | Single | โš ๏ธ Untested | Battery storage, 3-10kW | -| **MOD 6000-15000TL3-XH** | MOD 6000-15000TL3-XH | Hybrid | Three | โš ๏ธ Untested | 3-phase hybrid, 6-15kW | +### Single-Phase Grid-Tied Inverters + +| Inverter Series | Model Range | PV Strings | Tested | Notes | +|----------------|-------------|------------|--------|-------| +| **MIN 3000-6000TL-X** | 3000-6000TL-X | 2 | โš ๏ธ Untested | Grid-tied, 3-6kW | +| **MIN 7000-10000TL-X** | 7000-10000TL-X | 3 | โœ… **Tested** | Grid-tied, 7-10kW | + +### Single-Phase Hybrid Inverters (with Battery) + +| Inverter Series | Model Range | PV Strings | Tested | Notes | +|----------------|-------------|------------|--------|-------| +| **TL-XH 3000-10000** | TL-XH 3000-10000 | 3 | โš ๏ธ Untested | Hybrid with battery, 3-10kW | +| **TL-XH US 3000-10000** | TL-XH US 3000-10000 | 3 | โš ๏ธ Untested | US version hybrid, 3-10kW | +| **SPH 3000-10000** | SPH 3000-10000 | 2 | โš ๏ธ Untested | Storage hybrid, 3-10kW | +| **MIX Series** | Various | 2 | โš ๏ธ Untested | Legacy storage (merged into SPH) | +| **SPA Series** | Various | - | โš ๏ธ Untested | AC-coupled storage | + +### Three-Phase Grid-Tied Inverters + +| Inverter Series | Model Range | PV Strings | Tested | Notes | +|----------------|-------------|------------|--------|-------| +| **MID 15000-25000TL3-X** | 15000-25000TL3-X | 2 | โš ๏ธ Untested | Commercial, 15-25kW | +| **MAC 20000-40000TL3-X** | MAC 20000-40000TL3-X | 2 | โš ๏ธ Untested | Compact commercial, 20-40kW | +| **MAX 50000-125000TL3-X** | MAX 50000-125000TL3-X | 3 | โš ๏ธ Untested | Industrial, 50-125kW | +| **MAX 1500V Series** | MAX 1500V | 3+ | โš ๏ธ Untested | High-voltage, up to 150kW | +| **MAX-X LV Series** | MAX-X LV | 3+ | โš ๏ธ Untested | Low-voltage, up to 125kW | + +### Three-Phase Hybrid Inverters (with Battery) + +| Inverter Series | Model Range | PV Strings | Tested | Notes | +|----------------|-------------|------------|--------|-------| +| **MOD 6000-15000TL3-XH** | MOD 6000-15000TL3-XH | 3 | โš ๏ธ Untested | Modular hybrid, 6-15kW | +| **WIT TL3 Series** | WIT TL3 | 3+ | โš ๏ธ Untested | Business storage, up to 50kW | **Legend:** - โœ… **Tested** - Confirmed working with real hardware -- โš ๏ธ **Untested** - Profile created from documentation, needs validation +- โš ๏ธ **Untested** - Profile created from official documentation, needs validation > ๐Ÿ’ก **Help us test!** If you have a model marked as untested and can confirm it works, please open an issue or PR to update the documentation! @@ -51,49 +76,49 @@ The integration supports multiple Growatt inverter series with dedicated registe Different inverter models create different sensors based on their capabilities: -| Sensor | MIN 3-6k | MIN 7-10k | MID | MAX | SPH | MOD | -|--------|:--------:|:---------:|:---:|:---:|:---:|:---:| +| Sensor | MIN 3-6k | MIN 7-10k | TL-XH | MID/MAC | MAX | SPH | MOD/WIT | +|--------|:--------:|:---------:|:-----:|:-------:|:---:|:---:|:-------:| | **Solar Input** | -| PV1 Voltage/Current/Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| PV2 Voltage/Current/Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| PV3 Voltage/Current/Power | โŒ | โœ… | โœ… | โœ… | โŒ | โœ… | -| Solar Total Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| PV1 Voltage/Current/Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| PV2 Voltage/Current/Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| PV3 Voltage/Current/Power | โŒ | โœ… | โœ… | โŒ | โœ… | โŒ | โœ… | +| Solar Total Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | | **AC Output (Single-Phase)** | -| AC Voltage/Current/Power | โœ… | โœ… | โŒ | โŒ | โœ… | โŒ | -| AC Frequency | โœ… | โœ… | โŒ | โŒ | โœ… | โŒ | +| AC Voltage/Current/Power | โœ… | โœ… | โœ… | โŒ | โŒ | โœ… | โŒ | +| AC Frequency | โœ… | โœ… | โœ… | โŒ | โŒ | โœ… | โŒ | | **AC Output (Three-Phase)** | -| AC Phase A/B/C Voltage | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | -| AC Phase A/B/C Current | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | -| AC Phase A/B/C Power | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | -| AC Total Power | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | +| AC Phase R/S/T Voltage | โŒ | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | +| AC Phase R/S/T Current | โŒ | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | +| AC Phase R/S/T Power | โŒ | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | +| AC Total Power | โŒ | โŒ | โŒ | โœ… | โœ… | โŒ | โœ… | | **Grid Power (Calculated)** | -| Grid Export Power | โœ… | โœ… | โœ… | โœ… | โŒ | โŒ | -| Grid Import Power | โœ… | โœ… | โœ… | โœ… | โŒ | โŒ | -| Self Consumption | โœ… | โœ… | โœ… | โœ… | โŒ | โŒ | -| House Consumption | โœ… | โœ… | โœ… | โœ… | โŒ | โŒ | +| Grid Export Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Grid Import Power | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Self Consumption | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| House Consumption | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | | **Grid Power (From Registers)** | -| Power to Grid | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | -| Power to Load | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | -| Power to User | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | +| Power to Grid | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | +| Power to Load | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | +| Power to User | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | | **Battery (Hybrid Only)** | -| Battery Voltage/Current/Power | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | -| Battery SOC | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | -| Battery Temperature | โŒ | โŒ | โŒ | โŒ | โœ… | โœ… | +| Battery Voltage/Current/Power | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | +| Battery SOC | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | +| Battery Temperature | โŒ | โŒ | โœ… | โŒ | โŒ | โœ… | โœ… | | **Energy Totals** | -| Energy Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| Energy to Grid Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| Load Energy Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Energy Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Energy to Grid Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Load Energy Today/Total | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | | **System & Diagnostics** | -| Inverter Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| IPM Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| Boost Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | -| Status/Derating/Faults | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Inverter Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| IPM Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Boost Temperature | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | +| Status/Derating/Faults | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | โœ… | **Legend:** - โœ… Available for this model - โŒ Not available (hardware limitation) -> ๐Ÿ“ **Note:** Hybrid models (SPH/MOD) have power flow measured directly from registers. Grid-tied models (MIN/MID/MAX) calculate power flow from solar production vs AC output. +> ๐Ÿ“ **Note:** Hybrid models (TL-XH, SPH, MOD, WIT) have power flow measured directly from registers. Grid-tied models (MIN, MID, MAC, MAX) calculate power flow from solar production vs AC output. --- @@ -169,14 +194,37 @@ Growatt COM Pin 4 (B) โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Adapter RS485-B (or D-) ### Inverter Series Selection +Choose the profile that matches your inverter model: + +#### Single-Phase Grid-Tied | Selection | When to Use | |-----------|-------------| | **MIN 3000-6000TL-X** | 2 PV string models (3-6kW single-phase) | | **MIN 7000-10000TL-X** | 3 PV string models (7-10kW single-phase) | -| **MID 15000-25000TL3-X** | Commercial 3-phase grid-tied (15-25kW) | -| **MAX 50000-125000TL3-X** | Industrial 3-phase grid-tied (50-125kW) | -| **SPH 3000-10000** | Single-phase hybrid with battery (3-10kW) | -| **MOD 6000-15000TL3-XH** | 3-phase hybrid with battery (6-15kW) | + +#### Single-Phase Hybrid (with Battery) +| Selection | When to Use | +|-----------|-------------| +| **TL-XH 3000-10000** | 3 PV string hybrid with battery (3-10kW) | +| **TL-XH US 3000-10000** | US version 3 PV string hybrid (3-10kW) | +| **SPH 3000-10000** | 2 PV string storage hybrid (3-10kW) | +| **MIX Series** | Legacy storage system | +| **SPA Series** | AC-coupled storage system | + +#### Three-Phase Grid-Tied +| Selection | When to Use | +|-----------|-------------| +| **MID 15000-25000TL3-X** | Commercial 3-phase (15-25kW) | +| **MAC 20000-40000TL3-X** | Compact commercial 3-phase (20-40kW) | +| **MAX 50000-125000TL3-X** | Industrial 3-phase (50-125kW) | +| **MAX 1500V Series** | High-voltage commercial (up to 150kW) | +| **MAX-X LV Series** | Low-voltage commercial (up to 125kW) | + +#### Three-Phase Hybrid (with Battery) +| Selection | When to Use | +|-----------|-------------| +| **MOD 6000-15000TL3-XH** | Modular 3-phase hybrid (6-15kW) | +| **WIT TL3 Series** | Business storage 3-phase (up to 50kW) | ### TCP Connection Settings @@ -195,9 +243,9 @@ Access via **Settings** โ†’ **Devices & Services** โ†’ **Growatt Modbus** โ†’ ** | **Device Name** | "Growatt" | - | Friendly name (appears before all sensor names) | | **Scan Interval** | 30 seconds | 5-300s | How often to poll inverter | | **Connection Timeout** | 10 seconds | 1-60s | How long to wait for responses | -| **Invert Grid Power** ๐Ÿ†• | OFF | ON/OFF | **Reverse import/export if CT clamp backwards** | +| **Invert Grid Power** | OFF | ON/OFF | **Reverse import/export if CT clamp backwards** | -### ๐Ÿ”„ Invert Grid Power (New in v0.0.2!) +### ๐Ÿ”„ Invert Grid Power Got your CT clamp installed backwards? No problem! Just enable this option: @@ -233,9 +281,9 @@ Got your CT clamp installed backwards? No problem! Just enable this option: | `sensor.{name}_pv2_voltage` | PV2 Voltage | V | String 2 DC voltage | | `sensor.{name}_pv2_current` | PV2 Current | A | String 2 DC current | | `sensor.{name}_pv2_power` | PV2 Power | W | String 2 power output | -| `sensor.{name}_pv3_voltage` | PV3 Voltage | V | String 3 DC voltage (MIN 7-10k, MID, MAX, MOD only) | -| `sensor.{name}_pv3_current` | PV3 Current | A | String 3 DC current (MIN 7-10k, MID, MAX, MOD only) | -| `sensor.{name}_pv3_power` | PV3 Power | W | String 3 power output (MIN 7-10k, MID, MAX, MOD only) | +| `sensor.{name}_pv3_voltage` | PV3 Voltage | V | String 3 DC voltage (selected models) | +| `sensor.{name}_pv3_current` | PV3 Current | A | String 3 DC current (selected models) | +| `sensor.{name}_pv3_power` | PV3 Power | W | String 3 power output (selected models) | | `sensor.{name}_solar_total_power` | Solar Total Power | W | Combined PV power | **Attributes:** @@ -256,15 +304,15 @@ Got your CT clamp installed backwards? No problem! Just enable this option: | Entity ID | Name | Unit | Description | |-----------|------|------|-------------| -| `sensor.{name}_ac_voltage_a` | AC Voltage Phase A | V | Phase A voltage | -| `sensor.{name}_ac_voltage_b` | AC Voltage Phase B | V | Phase B voltage | -| `sensor.{name}_ac_voltage_c` | AC Voltage Phase C | V | Phase C voltage | -| `sensor.{name}_ac_current_a` | AC Current Phase A | A | Phase A current | -| `sensor.{name}_ac_current_b` | AC Current Phase B | A | Phase B current | -| `sensor.{name}_ac_current_c` | AC Current Phase C | A | Phase C current | -| `sensor.{name}_ac_power_a` | AC Power Phase A | W | Phase A power | -| `sensor.{name}_ac_power_b` | AC Power Phase B | W | Phase B power | -| `sensor.{name}_ac_power_c` | AC Power Phase C | W | Phase C power | +| `sensor.{name}_ac_voltage_r` | AC Voltage Phase R | V | Phase R voltage | +| `sensor.{name}_ac_voltage_s` | AC Voltage Phase S | V | Phase S voltage | +| `sensor.{name}_ac_voltage_t` | AC Voltage Phase T | V | Phase T voltage | +| `sensor.{name}_ac_current_r` | AC Current Phase R | A | Phase R current | +| `sensor.{name}_ac_current_s` | AC Current Phase S | A | Phase S current | +| `sensor.{name}_ac_current_t` | AC Current Phase T | A | Phase T current | +| `sensor.{name}_ac_power_r` | AC Power Phase R | W | Phase R power | +| `sensor.{name}_ac_power_s` | AC Power Phase S | W | Phase S power | +| `sensor.{name}_ac_power_t` | AC Power Phase T | W | Phase T power | | `sensor.{name}_ac_power_total` | AC Total Power | W | Total 3-phase power | | `sensor.{name}_ac_frequency` | AC Frequency | Hz | Grid frequency | @@ -469,8 +517,9 @@ custom_components/growatt_modbus/ โ”œโ”€โ”€ __init__.py # Integration setup โ”œโ”€โ”€ binary_sensor.py # Binary sensors (inverter connectivity) โ”œโ”€โ”€ config_flow.py # Configuration UI with inverter series selection -โ”œโ”€โ”€ const.py # Register definitions for all models (V1.39) +โ”œโ”€โ”€ const.py # Register definitions for all 14 models (V1.39) โ”œโ”€โ”€ coordinator.py # Data coordinator with night-time handling +โ”œโ”€โ”€ device_profiles.py # Inverter profile definitions โ”œโ”€โ”€ growatt_modbus.py # Modbus communication (pymodbus 2.x & 3.x) โ”œโ”€โ”€ manifest.json # Integration metadata โ”œโ”€โ”€ sensor.py # Sensor platform with model-specific sensors @@ -491,15 +540,21 @@ To view device information: --- -## ๐Ÿ†• What's New in v0.0.2 +## ๐Ÿ†• What's New in v0.0.3 + +- ๐ŸŽ›๏ธ **Expanded Model Support** - Now supports 14 inverter profiles (up from 6) +- ๐Ÿ”‹ **Fixed SPH Register Map** - SPH models now include complete PV, AC, and battery sensors +- โšก **New Hybrid Series** - Added TL-XH, TL-XH US profiles for single-phase hybrid inverters +- ๐Ÿญ **More Commercial Models** - Added MAC, MAX 1500V, MAX-X LV, WIT TL3 series +- ๐Ÿ’พ **Legacy Storage** - Added MIX and SPA series profiles +- ๐Ÿ“Š **Profile-Based Sensors** - Optimized sensor creation based on inverter capabilities +- ๐Ÿ› **Bug Fixes** - Resolved config flow loading issues and type hint errors -- ๐ŸŽ›๏ธ **Multi-Model Support** - Added profiles for MIN (3-6k & 7-10k), MID, MAX, SPH, and MOD series +### v0.0.2 Features (Previously Released) - ๐Ÿ”„ **Invert Grid Power Option** - Fix backwards CT clamp installations via UI toggle - ๐Ÿ“Š **Model-Specific Sensors** - Only relevant sensors created based on inverter capabilities - โšก **Three-Phase Support** - Full support for MID, MAX, and MOD models -- ๐Ÿ”‹ **Battery Sensors** - Complete battery monitoring for SPH and MOD hybrid models - ๐ŸŽจ **Enhanced Configuration UI** - Better inverter series selection with descriptions -- ๐Ÿ“ **Improved Options Flow** - Device name, timeout, and grid power inversion settings --- @@ -526,13 +581,12 @@ Contributions welcome! Here's how: ### Help Us Test More Models! ๐Ÿงช -We need community members with different inverter models to validate the untested profiles: +We need community members with different inverter models to validate the untested profiles. Currently only **MIN 7000-10000TL-X** is tested with real hardware! -- MIN 3000-6000TL-X series -- MID 15000-25000TL3-X series -- MAX 50000-125000TL3-X series -- SPH 3000-10000 series -- MOD 6000-15000TL3-XH series +**Profiles needing validation:** +- All single-phase grid-tied (MIN 3-6k) +- All hybrid models (TL-XH, SPH, MIX, SPA) +- All three-phase models (MID, MAC, MAX variants, MOD, WIT) If you successfully test any of these, please report back via GitHub Issues! @@ -548,7 +602,7 @@ MIT License - see [LICENSE](LICENSE) file for details. - Based on [Growatt Modbus RTU Protocol V1.39](https://shop.frankensolar.ca/content/documentation/Growatt/AppNote_Growatt_WIT-Modbus-RTU-Protocol-II-V1.39-English-20240416_%28frankensolar%29.pdf) (2024.04.16) - Built for the Home Assistant community -- Tested by solar enthusiasts worldwide ๐ŸŒ +- Tested by solar enthusiasts worldwide (soon, hopefully) ๐ŸŒ - Special thanks to all hardware testers and contributors - MIN-10000TL-X validation by [@0xAHA](https://github.com/0xAHA) diff --git a/custom_components/growatt_modbus/config_flow.py b/custom_components/growatt_modbus/config_flow.py index df9e3c65..fe5afa80 100644 --- a/custom_components/growatt_modbus/config_flow.py +++ b/custom_components/growatt_modbus/config_flow.py @@ -5,20 +5,17 @@ from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_PORT, CONF_NAME -from homeassistant.core import HomeAssistant, callback +from homeassistant.core import callback from homeassistant.data_entry_flow import FlowResult import homeassistant.helpers.config_validation as cv from .const import ( DOMAIN, CONF_SLAVE_ID, - CONF_REGISTER_MAP, CONF_INVERTER_SERIES, - CONF_INVERT_GRID_POWER, DEFAULT_PORT, DEFAULT_SLAVE_ID, ) -from .coordinator import test_connection from .device_profiles import get_available_profiles, get_profile _LOGGER = logging.getLogger(__name__) @@ -29,104 +26,50 @@ class GrowattModbusConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 - def __init__(self): - """Initialize the config flow.""" - self.config_data = {} - async def async_step_user( self, user_input: dict[str, Any] | None = None ) -> FlowResult: - """Handle the initial step - inverter series selection.""" + """Handle the user step.""" errors = {} if user_input is not None: - # Store the basic configuration - self.config_data.update(user_input) + # Add register map based on series + series = user_input.get(CONF_INVERTER_SERIES, "min_7000_10000_tl_x") + profile = get_profile(series) + user_input["register_map"] = profile["register_map"] - # Proceed to TCP configuration - return await self.async_step_tcp() + # Set unique ID + await self.async_set_unique_id(f"{user_input[CONF_HOST]}_{user_input[CONF_SLAVE_ID]}") + self._abort_if_unique_id_configured() + + return self.async_create_entry( + title=user_input[CONF_NAME], + data=user_input, + ) - user_schema = vol.Schema({ + schema = vol.Schema({ vol.Required(CONF_NAME, default="Growatt"): str, vol.Required(CONF_INVERTER_SERIES, default="min_7000_10000_tl_x"): vol.In(get_available_profiles()), - }) - - return self.async_show_form( - step_id="user", - data_schema=user_schema, - errors=errors, - ) - - async def async_step_tcp( - self, user_input: dict[str, Any] | None = None - ) -> FlowResult: - """Handle TCP connection configuration.""" - errors = {} - - if user_input is not None: - # Get the profile to set the correct register map - series = self.config_data.get(CONF_INVERTER_SERIES, "min_7000_10000_tl_x") - profile = get_profile(series) - - # Add register map from profile - user_input[CONF_REGISTER_MAP] = profile.register_map if profile else "MIN_7000_10000TL_X" - - # Test the connection - self.config_data.update(user_input) - - try: - # Test connection in executor to avoid blocking - result = await self.hass.async_add_executor_job( - test_connection, self.config_data - ) - - if result["success"]: - # Connection successful, create the entry - await self.async_set_unique_id(f"{user_input[CONF_HOST]}_{user_input[CONF_SLAVE_ID]}") - self._abort_if_unique_id_configured() - - return self.async_create_entry( - title=self.config_data[CONF_NAME], - data=self.config_data, - description=f"Connected to {user_input[CONF_HOST]}:{user_input[CONF_PORT]} (Slave {user_input[CONF_SLAVE_ID]})" - ) - else: - errors["base"] = "cannot_connect" - _LOGGER.error("Connection test failed: %s", result.get("error", "Unknown error")) - - except Exception as err: - _LOGGER.exception("Unexpected error during connection test") - errors["base"] = "unknown" - - # Get series info for description - series = self.config_data.get(CONF_INVERTER_SERIES, "min_7000_10000_tl_x") - profile = get_profile(series) - series_info = f"{profile.name} - {profile.description}" if profile else "Unknown series" - - tcp_schema = vol.Schema({ vol.Required(CONF_HOST): str, vol.Required(CONF_PORT, default=DEFAULT_PORT): int, vol.Required(CONF_SLAVE_ID, default=DEFAULT_SLAVE_ID): int, }) return self.async_show_form( - step_id="tcp", - data_schema=tcp_schema, + step_id="user", + data_schema=schema, errors=errors, - description_placeholders={ - "series_info": series_info, - } ) @staticmethod @callback def async_get_options_flow(config_entry): - """Create the options flow.""" + """Get options flow.""" return GrowattModbusOptionsFlow(config_entry) class GrowattModbusOptionsFlow(config_entries.OptionsFlow): - """Handle options flow for Growatt Modbus.""" + """Handle options.""" def __init__(self, config_entry: config_entries.ConfigEntry) -> None: """Initialize options flow.""" @@ -135,20 +78,15 @@ def __init__(self, config_entry: config_entries.ConfigEntry) -> None: async def async_step_init( self, user_input: dict[str, Any] | None = None ) -> FlowResult: - """Manage the options.""" - errors = {} - + """Manage options.""" if user_input is not None: - # Update options new_options = { "scan_interval": user_input.get("scan_interval", 30), "timeout": user_input.get("timeout", 10), "invert_grid_power": user_input.get("invert_grid_power", False), } - # Check if device name changed - this needs to update config data, not options if user_input.get("device_name") != self.config_entry.data.get(CONF_NAME): - # Update the config entry data with new device name new_data = dict(self.config_entry.data) new_data[CONF_NAME] = user_input["device_name"] @@ -159,50 +97,28 @@ async def async_step_init( title=user_input["device_name"], ) else: - # Just update options self.hass.config_entries.async_update_entry( self.config_entry, options=new_options, ) - # Reload the integration to apply changes await self.hass.config_entries.async_reload(self.config_entry.entry_id) - return self.async_create_entry(title="", data=new_options) - # Build the options schema with current values current_name = self.config_entry.data.get(CONF_NAME, "Growatt") current_scan_interval = self.config_entry.options.get("scan_interval", 30) current_timeout = self.config_entry.options.get("timeout", 10) current_invert = self.config_entry.options.get("invert_grid_power", False) - options_schema = vol.Schema({ - vol.Required( - "device_name", - default=current_name - ): cv.string, - vol.Required( - "scan_interval", - default=current_scan_interval - ): vol.All(vol.Coerce(int), vol.Range(min=5, max=300)), - vol.Required( - "timeout", - default=current_timeout - ): vol.All(vol.Coerce(int), vol.Range(min=1, max=60)), - vol.Required( - "invert_grid_power", - default=current_invert - ): bool, + schema = vol.Schema({ + vol.Required("device_name", default=current_name): cv.string, + vol.Required("scan_interval", default=current_scan_interval): vol.All( + vol.Coerce(int), vol.Range(min=5, max=300) + ), + vol.Required("timeout", default=current_timeout): vol.All( + vol.Coerce(int), vol.Range(min=1, max=60) + ), + vol.Required("invert_grid_power", default=current_invert): bool, }) - return self.async_show_form( - step_id="init", - data_schema=options_schema, - errors=errors, - description_placeholders={ - "device_name_description": "Friendly name for the device (appears before all sensor names)", - "scan_interval_description": "How often to poll the inverter (seconds)", - "timeout_description": "Connection timeout (seconds)", - "invert_grid_power_description": "Reverse grid power sign (enable if CT clamp installed backwards - import/export swapped)" - } - ) \ No newline at end of file + return self.async_show_form(step_id="init", data_schema=schema) \ No newline at end of file diff --git a/custom_components/growatt_modbus/const.py b/custom_components/growatt_modbus/const.py index a4cc8449..11dbbec9 100644 --- a/custom_components/growatt_modbus/const.py +++ b/custom_components/growatt_modbus/const.py @@ -371,35 +371,96 @@ def get_sensor_type(sensor_key: str) -> str: 'description': 'Hybrid inverter with battery storage (3-10kW)', 'notes': 'Uses 0-124, 1000-1124 register ranges. Includes battery management.', 'input_registers': { + # ============================================================================ + # BASE RANGE 0-124: PV Input and AC Output (same as MIN series) + # ============================================================================ + # System Status - 1000: {'name': 'system_work_mode', 'scale': 1, 'unit': '', 'desc': 'Work mode'}, + 0: {'name': 'inverter_status', 'scale': 1, 'unit': '', 'desc': '0=Waiting, 1=Normal, 3=Fault'}, - # Battery - 1013: {'name': 'battery_voltage', 'scale': 0.1, 'unit': 'V'}, - 1014: {'name': 'battery_soc', 'scale': 1, 'unit': '%'}, - 1040: {'name': 'battery_temp', 'scale': 0.1, 'unit': 'ยฐC'}, + # PV Total Power (32-bit) + 1: {'name': 'pv_total_power_high', 'scale': 1, 'unit': '', 'desc': 'Total PV power HIGH word', 'pair': 2}, + 2: {'name': 'pv_total_power_low', 'scale': 1, 'unit': '', 'desc': 'Total PV power LOW word', 'pair': 1, 'combined_scale': 0.1, 'combined_unit': 'W'}, + + # PV String 1 + 3: {'name': 'pv1_voltage', 'scale': 0.1, 'unit': 'V', 'desc': 'PV1 DC voltage'}, + 4: {'name': 'pv1_current', 'scale': 0.1, 'unit': 'A', 'desc': 'PV1 DC current'}, + 5: {'name': 'pv1_power_high', 'scale': 1, 'unit': '', 'desc': 'PV1 power HIGH word', 'pair': 6}, + 6: {'name': 'pv1_power_low', 'scale': 1, 'unit': '', 'desc': 'PV1 power LOW word', 'pair': 5, 'combined_scale': 0.1, 'combined_unit': 'W'}, + + # PV String 2 + 7: {'name': 'pv2_voltage', 'scale': 0.1, 'unit': 'V', 'desc': 'PV2 DC voltage'}, + 8: {'name': 'pv2_current', 'scale': 0.1, 'unit': 'A', 'desc': 'PV2 DC current'}, + 9: {'name': 'pv2_power_high', 'scale': 1, 'unit': '', 'desc': 'PV2 power HIGH word', 'pair': 10}, + 10: {'name': 'pv2_power_low', 'scale': 1, 'unit': '', 'desc': 'PV2 power LOW word', 'pair': 9, 'combined_scale': 0.1, 'combined_unit': 'W'}, + + # AC Output + 37: {'name': 'ac_frequency', 'scale': 0.01, 'unit': 'Hz', 'desc': 'AC frequency'}, + 38: {'name': 'ac_voltage', 'scale': 0.1, 'unit': 'V', 'desc': 'AC voltage'}, + 39: {'name': 'ac_current', 'scale': 0.1, 'unit': 'A', 'desc': 'AC current'}, + 40: {'name': 'ac_power_high', 'scale': 1, 'unit': '', 'desc': 'AC power HIGH', 'pair': 41}, + 41: {'name': 'ac_power_low', 'scale': 1, 'unit': '', 'desc': 'AC power LOW', 'pair': 40, 'combined_scale': 0.1, 'combined_unit': 'VA'}, - # Discharge/Charge Power + # Energy + 53: {'name': 'energy_today_high', 'scale': 1, 'unit': '', 'desc': 'Today energy HIGH', 'pair': 54}, + 54: {'name': 'energy_today_low', 'scale': 1, 'unit': '', 'desc': 'Today energy LOW', 'pair': 53, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 55: {'name': 'energy_total_high', 'scale': 1, 'unit': '', 'desc': 'Total energy HIGH', 'pair': 56}, + 56: {'name': 'energy_total_low', 'scale': 1, 'unit': '', 'desc': 'Total energy LOW', 'pair': 55, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + + # Temperatures + 93: {'name': 'inverter_temp', 'scale': 0.1, 'unit': 'ยฐC'}, + + # Status + 105: {'name': 'fault_code', 'scale': 1, 'unit': ''}, + 112: {'name': 'warning_code', 'scale': 1, 'unit': ''}, + + # ============================================================================ + # STORAGE RANGE 1000-1124: Battery and Power Flow + # ============================================================================ + + # System Work Mode + 1000: {'name': 'system_work_mode', 'scale': 1, 'unit': '', 'desc': 'Work mode'}, + + # Battery Discharge/Charge Power 1009: {'name': 'discharge_power_high', 'scale': 1, 'unit': '', 'pair': 1010}, 1010: {'name': 'discharge_power_low', 'scale': 1, 'unit': '', 'pair': 1009, 'combined_scale': 0.1, 'combined_unit': 'W'}, 1011: {'name': 'charge_power_high', 'scale': 1, 'unit': '', 'pair': 1012}, 1012: {'name': 'charge_power_low', 'scale': 1, 'unit': '', 'pair': 1011, 'combined_scale': 0.1, 'combined_unit': 'W'}, + # Battery State + 1013: {'name': 'battery_voltage', 'scale': 0.1, 'unit': 'V'}, + 1014: {'name': 'battery_soc', 'scale': 1, 'unit': '%'}, + 1040: {'name': 'battery_temp', 'scale': 0.1, 'unit': 'ยฐC'}, + # Power Flow 1015: {'name': 'power_to_user_high', 'scale': 1, 'unit': '', 'pair': 1016}, 1016: {'name': 'power_to_user_low', 'scale': 1, 'unit': '', 'pair': 1015, 'combined_scale': 0.1, 'combined_unit': 'W'}, + 1021: {'name': 'power_to_load_high', 'scale': 1, 'unit': '', 'pair': 1022}, + 1022: {'name': 'power_to_load_low', 'scale': 1, 'unit': '', 'pair': 1021, 'combined_scale': 0.1, 'combined_unit': 'W'}, 1029: {'name': 'power_to_grid_high', 'scale': 1, 'unit': '', 'pair': 1030}, 1030: {'name': 'power_to_grid_low', 'scale': 1, 'unit': '', 'pair': 1029, 'combined_scale': 0.1, 'combined_unit': 'W', 'signed': True}, - # Energy + # Energy Breakdown 1044: {'name': 'energy_to_user_today_high', 'scale': 1, 'unit': '', 'pair': 1045}, 1045: {'name': 'energy_to_user_today_low', 'scale': 1, 'unit': '', 'pair': 1044, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1046: {'name': 'energy_to_user_total_high', 'scale': 1, 'unit': '', 'pair': 1047}, + 1047: {'name': 'energy_to_user_total_low', 'scale': 1, 'unit': '', 'pair': 1046, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, 1048: {'name': 'energy_to_grid_today_high', 'scale': 1, 'unit': '', 'pair': 1049}, 1049: {'name': 'energy_to_grid_today_low', 'scale': 1, 'unit': '', 'pair': 1048, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1050: {'name': 'energy_to_grid_total_high', 'scale': 1, 'unit': '', 'pair': 1051}, + 1051: {'name': 'energy_to_grid_total_low', 'scale': 1, 'unit': '', 'pair': 1050, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, 1052: {'name': 'discharge_energy_today_high', 'scale': 1, 'unit': '', 'pair': 1053}, 1053: {'name': 'discharge_energy_today_low', 'scale': 1, 'unit': '', 'pair': 1052, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1054: {'name': 'discharge_energy_total_high', 'scale': 1, 'unit': '', 'pair': 1055}, + 1055: {'name': 'discharge_energy_total_low', 'scale': 1, 'unit': '', 'pair': 1054, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, 1056: {'name': 'charge_energy_today_high', 'scale': 1, 'unit': '', 'pair': 1057}, 1057: {'name': 'charge_energy_today_low', 'scale': 1, 'unit': '', 'pair': 1056, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1058: {'name': 'charge_energy_total_high', 'scale': 1, 'unit': '', 'pair': 1059}, + 1059: {'name': 'charge_energy_total_low', 'scale': 1, 'unit': '', 'pair': 1058, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1060: {'name': 'load_energy_today_high', 'scale': 1, 'unit': '', 'pair': 1061}, + 1061: {'name': 'load_energy_today_low', 'scale': 1, 'unit': '', 'pair': 1060, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1062: {'name': 'load_energy_total_high', 'scale': 1, 'unit': '', 'pair': 1063}, + 1063: {'name': 'load_energy_total_low', 'scale': 1, 'unit': '', 'pair': 1062, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, }, 'holding_registers': { 0: {'name': 'on_off', 'scale': 1, 'unit': '', 'access': 'RW'}, @@ -670,15 +731,190 @@ def get_sensor_type(sensor_key: str) -> str: } } -# Main register map dictionary - COMPLETE +# ============================================================================ +# NEW PROFILES - Added to support all Protocol V1.39 models +# ============================================================================ + +# TL-XH Series (Hybrid MIN with battery) - Uses same base as MIN_7000_10000TL_X +TL_XH_3000_10000 = { + 'name': 'TL-XH-3000-10000', + 'description': 'Hybrid single-phase inverter with battery (3-10kW)', + 'notes': 'Uses 3000-3124 register range. Extends MIN series with battery support.', + 'input_registers': { + **MIN_7000_10000TL_X['input_registers'], # Inherit all MIN registers + # Battery-specific registers (if different from MOD series) + 3165: {'name': 'battery_derating_mode', 'scale': 1, 'unit': ''}, + 3169: {'name': 'battery_voltage', 'scale': 0.01, 'unit': 'V'}, + 3170: {'name': 'battery_current', 'scale': 0.1, 'unit': 'A'}, + 3171: {'name': 'battery_soc', 'scale': 1, 'unit': '%'}, + }, + 'holding_registers': MIN_7000_10000TL_X['holding_registers'], +} + +# TL-XH US Series (US version with extended range) +TL_XH_US_3000_10000 = { + 'name': 'TL-XH-US-3000-10000', + 'description': 'US hybrid single-phase inverter with battery (3-10kW)', + 'notes': 'Uses 3000-3249 register range. US-specific features and battery support.', + 'input_registers': { + **TL_XH_3000_10000['input_registers'], # Inherit TL-XH registers + # US-specific extended registers in 3125-3249 range + 3125: {'name': 'battery_discharge_today_high', 'scale': 1, 'unit': '', 'pair': 3126}, + 3126: {'name': 'battery_discharge_today_low', 'scale': 1, 'unit': '', 'pair': 3125, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 3129: {'name': 'battery_charge_today_high', 'scale': 1, 'unit': '', 'pair': 3130}, + 3130: {'name': 'battery_charge_today_low', 'scale': 1, 'unit': '', 'pair': 3129, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + }, + 'holding_registers': TL_XH_3000_10000['holding_registers'], +} + +# MAC Series (Three-phase compact) - Similar to MID +MAC_20000_40000TL3_X = { + 'name': 'MAC-20000-40000TL3-X', + 'description': 'Compact three-phase commercial inverter (20-40kW)', + 'notes': 'Uses 0-124, 125-249 register range. Similar to MID series.', + 'input_registers': MID_15000_25000TL3_X['input_registers'], # Shares register layout with MID + 'holding_registers': MID_15000_25000TL3_X['holding_registers'], +} + +# MAX 1500V Series (High-voltage commercial) +MAX_1500V_SERIES = { + 'name': 'MAX-1500V', + 'description': 'High-voltage commercial three-phase inverter (up to 150kW)', + 'notes': 'Uses 0-124, 125-249, 875-999 register ranges.', + 'input_registers': { + **MAX_50000_125000TL3_X['input_registers'], # Inherit MAX registers + # Extended PV strings in 875-999 range (PV9-PV16 for large arrays) + 875: {'name': 'pv9_voltage', 'scale': 0.1, 'unit': 'V'}, + 876: {'name': 'pv9_current', 'scale': 0.1, 'unit': 'A'}, + 877: {'name': 'pv9_power_high', 'scale': 1, 'unit': '', 'pair': 878}, + 878: {'name': 'pv9_power_low', 'scale': 1, 'unit': '', 'pair': 877, 'combined_scale': 0.1, 'combined_unit': 'W'}, + }, + 'holding_registers': MAX_50000_125000TL3_X['holding_registers'], +} + +# MAX-X LV Series (Low-voltage commercial) +MAX_X_LV_SERIES = { + 'name': 'MAX-X-LV', + 'description': 'Low-voltage commercial three-phase inverter (up to 125kW)', + 'notes': 'Uses 0-124, 125-249, 875-999 register ranges.', + 'input_registers': MAX_1500V_SERIES['input_registers'], # Same layout as MAX 1500V + 'holding_registers': MAX_1500V_SERIES['holding_registers'], +} + +# MIX Series (Legacy storage) - Similar to SPH +MIX_SERIES = { + 'name': 'MIX Series', + 'description': 'Legacy storage inverter (merged into SPH per protocol v1.35)', + 'notes': 'Uses 0-124, 1000-1124 register range. Battery storage system.', + 'input_registers': SPH_3000_10000['input_registers'], # Shares register layout with SPH + 'holding_registers': SPH_3000_10000['holding_registers'], +} + +# SPA Series (AC-coupled storage) +SPA_SERIES = { + 'name': 'SPA Series', + 'description': 'AC-coupled storage inverter', + 'notes': 'Uses 0-124, 1000-1124 register range. AC-coupled battery system.', + 'input_registers': { + # System Status + 1000: {'name': 'system_work_mode', 'scale': 1, 'unit': '', 'desc': 'Work mode'}, + + # Battery (same as SPH) + 1013: {'name': 'battery_voltage', 'scale': 0.1, 'unit': 'V'}, + 1014: {'name': 'battery_soc', 'scale': 1, 'unit': '%'}, + 1040: {'name': 'battery_temp', 'scale': 0.1, 'unit': 'ยฐC'}, + + # Power Flow + 1015: {'name': 'power_to_user_high', 'scale': 1, 'unit': '', 'pair': 1016}, + 1016: {'name': 'power_to_user_low', 'scale': 1, 'unit': '', 'pair': 1015, 'combined_scale': 0.1, 'combined_unit': 'W'}, + 1029: {'name': 'power_to_grid_high', 'scale': 1, 'unit': '', 'pair': 1030}, + 1030: {'name': 'power_to_grid_low', 'scale': 1, 'unit': '', 'pair': 1029, 'combined_scale': 0.1, 'combined_unit': 'W', 'signed': True}, + + # Energy + 1044: {'name': 'energy_to_user_today_high', 'scale': 1, 'unit': '', 'pair': 1045}, + 1045: {'name': 'energy_to_user_today_low', 'scale': 1, 'unit': '', 'pair': 1044, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + 1048: {'name': 'energy_to_grid_today_high', 'scale': 1, 'unit': '', 'pair': 1049}, + 1049: {'name': 'energy_to_grid_today_low', 'scale': 1, 'unit': '', 'pair': 1048, 'combined_scale': 0.1, 'combined_unit': 'kWh'}, + }, + 'holding_registers': { + 0: {'name': 'on_off', 'scale': 1, 'unit': '', 'access': 'RW'}, + 1044: {'name': 'priority', 'scale': 1, 'unit': '', 'access': 'RW', 'desc': '0=Load, 1=Battery, 2=Grid'}, + } +} + +# WIT TL3 Series (Business storage power) +WIT_TL3_SERIES = { + 'name': 'WIT-TL3', + 'description': 'Business storage power three-phase inverter', + 'notes': 'Uses 0-124, 125-249, 875-999, 8000-8124 register ranges.', + 'input_registers': { + # Inherits three-phase base from MAX series + **MAX_50000_125000TL3_X['input_registers'], + + # Battery from MOD series (3000 range mapped to 8000 range for WIT) + 8034: {'name': 'battery_voltage', 'scale': 0.1, 'unit': 'V'}, + 8035: {'name': 'battery_current', 'scale': 0.1, 'unit': 'A'}, + 8093: {'name': 'battery_soc', 'scale': 1, 'unit': '%'}, + 8094: {'name': 'battery_soh', 'scale': 1, 'unit': '%'}, + + # Extended PV in 875-999 range + 875: {'name': 'pv9_voltage', 'scale': 0.1, 'unit': 'V'}, + 876: {'name': 'pv9_current', 'scale': 0.1, 'unit': 'A'}, + 877: {'name': 'pv9_power_high', 'scale': 1, 'unit': '', 'pair': 878}, + 878: {'name': 'pv9_power_low', 'scale': 1, 'unit': '', 'pair': 877, 'combined_scale': 0.1, 'combined_unit': 'W'}, + 879: {'name': 'pv10_voltage', 'scale': 0.1, 'unit': 'V'}, + 880: {'name': 'pv10_current', 'scale': 0.1, 'unit': 'A'}, + 881: {'name': 'pv10_power_high', 'scale': 1, 'unit': '', 'pair': 882}, + 882: {'name': 'pv10_power_low', 'scale': 1, 'unit': '', 'pair': 881, 'combined_scale': 0.1, 'combined_unit': 'W'}, + }, + 'holding_registers': { + 0: {'name': 'on_off', 'scale': 1, 'unit': '', 'access': 'RW'}, + 3: {'name': 'active_power_rate', 'scale': 1, 'unit': '%', 'access': 'RW'}, + 30: {'name': 'modbus_address', 'scale': 1, 'unit': '', 'access': 'RW'}, + 871: {'name': 'grid_phase_sequence', 'scale': 1, 'unit': '', 'access': 'RW', 'desc': '0=Positive, 1=Reverse'}, + 874: {'name': 'parallel_enable', 'scale': 1, 'unit': '', 'access': 'RW', 'desc': '0=Disable, 1=Enable'}, + } +} + +# ============================================================================ +# Main register map dictionary - ALL 14 PROFILES +# ============================================================================ + REGISTER_MAPS = { + # MIN Series - Single Phase String 'MIN_3000_6000TL_X': MIN_3000_6000TL_X, - 'MIN_7000_10000TL_X': MIN_7000_10000TL_X, # Your working config + 'MIN_7000_10000TL_X': MIN_7000_10000TL_X, + 'MIN_SERIES_BASE_RANGE': MIN_SERIES_BASE_RANGE, # Legacy/alternative addressing + + # TL-XH Series - Single Phase Hybrid + 'TL_XH_3000_10000': TL_XH_3000_10000, + 'TL_XH_US_3000_10000': TL_XH_US_3000_10000, + + # MID Series - Three Phase String 'MID_15000_25000TL3_X': MID_15000_25000TL3_X, + + # MAC Series - Three Phase Compact + 'MAC_20000_40000TL3_X': MAC_20000_40000TL3_X, + + # MAX Series - Commercial Three Phase 'MAX_50000_125000TL3_X': MAX_50000_125000TL3_X, + 'MAX_1500V_SERIES': MAX_1500V_SERIES, + 'MAX_X_LV_SERIES': MAX_X_LV_SERIES, + + # SPH Series - Hybrid Storage Single Phase 'SPH_3000_10000': SPH_3000_10000, + + # MIX Series - Legacy Storage + 'MIX_SERIES': MIX_SERIES, + + # SPA Series - AC Coupled Storage + 'SPA_SERIES': SPA_SERIES, + + # MOD Series - Modular Three Phase Hybrid 'MOD_6000_15000TL3_XH': MOD_6000_15000TL3_XH, - 'MIN_SERIES_BASE_RANGE': MIN_SERIES_BASE_RANGE, # Keep for compatibility + + # WIT Series - Business Storage Power + 'WIT_TL3_SERIES': WIT_TL3_SERIES, } # Status code mappings diff --git a/custom_components/growatt_modbus/device_profiles.py b/custom_components/growatt_modbus/device_profiles.py index 3bf045db..df6507a3 100644 --- a/custom_components/growatt_modbus/device_profiles.py +++ b/custom_components/growatt_modbus/device_profiles.py @@ -1,93 +1,65 @@ -""" -Device profiles for different Growatt inverter series. -Each profile defines which sensors and features are available. -""" +"""Device profiles for Growatt inverters.""" +from typing import Dict, Set -from typing import Dict, List, Set - -# Device profile structure -class InverterProfile: - """Profile for a specific inverter series.""" - - def __init__( - self, - series: str, - name: str, - description: str, - register_map: str, - available_sensors: Set[str], - phases: int = 1, - has_battery: bool = False, - has_pv3: bool = False, - max_power_kw: float = 10.0, - ): - """Initialize inverter profile.""" - self.series = series - self.name = name - self.description = description - self.register_map = register_map - self.available_sensors = available_sensors - self.phases = phases - self.has_battery = has_battery - self.has_pv3 = has_pv3 - self.max_power_kw = max_power_kw +# ============================================================================ +# SENSOR GROUPS +# ============================================================================ -# Common sensor sets for reuse -BASIC_PV_SENSORS = { +BASIC_PV_SENSORS: Set[str] = { "pv1_voltage", "pv1_current", "pv1_power", "pv2_voltage", "pv2_current", "pv2_power", "pv_total_power", } -PV3_SENSORS = { +PV3_SENSORS: Set[str] = { "pv3_voltage", "pv3_current", "pv3_power", } -BASIC_AC_SENSORS = { +BASIC_AC_SENSORS: Set[str] = { "ac_voltage", "ac_current", "ac_power", "ac_frequency", } -GRID_SENSORS = { +GRID_SENSORS: Set[str] = { "grid_power", "grid_export_power", "grid_import_power", } -POWER_FLOW_SENSORS = { +POWER_FLOW_SENSORS: Set[str] = { "power_to_grid", "power_to_load", "power_to_user", } -CONSUMPTION_SENSORS = { +CONSUMPTION_SENSORS: Set[str] = { "self_consumption", "self_consumption_percentage", "house_consumption", } -ENERGY_SENSORS = { +ENERGY_SENSORS: Set[str] = { "energy_today", "energy_total", } -ENERGY_BREAKDOWN_SENSORS = { +ENERGY_BREAKDOWN_SENSORS: Set[str] = { "grid_energy_today", "grid_energy_total", "energy_to_grid_today", "energy_to_grid_total", "grid_import_energy_today", "grid_import_energy_total", "load_energy_today", "load_energy_total", } -TEMPERATURE_SENSORS = { - "inverter_temp", "ipm_temp", "boost_temp", +BATTERY_SENSORS: Set[str] = { + "battery_voltage", "battery_current", "battery_soc", + "battery_temp", "battery_power", + "battery_charge_power", "battery_discharge_power", + "battery_charge_today", "battery_discharge_today", + "battery_charge_total", "battery_discharge_total", } -STATUS_SENSORS = { - "status", "last_update", "derating_mode", "fault_code", "warning_code", +TEMPERATURE_SENSORS: Set[str] = { + "inverter_temp", "ipm_temp", "boost_temp", } -BATTERY_SENSORS = { - "battery_voltage", "battery_current", "battery_power", - "battery_soc", "battery_temp", - "battery_charge_today", "battery_discharge_today", - "battery_charge_total", "battery_discharge_total", - "priority_mode", "battery_derating_mode", +STATUS_SENSORS: Set[str] = { + "status", "last_update", "derating_mode", "fault_code", "warning_code", } -THREE_PHASE_SENSORS = { +THREE_PHASE_SENSORS: Set[str] = { "ac_voltage_r", "ac_voltage_s", "ac_voltage_t", "ac_current_r", "ac_current_s", "ac_current_t", "ac_power_r", "ac_power_s", "ac_power_t", @@ -95,219 +67,364 @@ def __init__( # ============================================================================ -# MIN SERIES - Single Phase String Inverters (3-10kW) -# ============================================================================ - -MIN_3000_6000_TL_X = InverterProfile( - series="min_3000_6000_tl_x", - name="MIN 3000-6000TL-X", - description="MIN series 3kW-6kW single-phase string inverters (2 PV inputs)", - register_map="MIN_3000_6000TL_X", - available_sensors=( - BASIC_PV_SENSORS | - BASIC_AC_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=1, - has_battery=False, - has_pv3=False, - max_power_kw=6.0, -) - -MIN_7000_10000_TL_X = InverterProfile( - series="min_7000_10000_tl_x", - name="MIN 7000-10000TL-X", - description="MIN series 7kW-10kW single-phase string inverters (3 PV inputs)", - register_map="MIN_7000_10000TL_X", - available_sensors=( - BASIC_PV_SENSORS | - PV3_SENSORS | - BASIC_AC_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=1, - has_battery=False, - has_pv3=True, - max_power_kw=10.0, -) - - -# ============================================================================ -# MID SERIES - Three Phase String Inverters (15-25kW) -# ============================================================================ - -MID_15000_25000_TL3_X = InverterProfile( - series="mid_15000_25000_tl3_x", - name="MID 15000-25000TL3-X", - description="MID series 15kW-25kW three-phase string inverters", - register_map="MID_15000_25000TL3_X", - available_sensors=( - BASIC_PV_SENSORS | - PV3_SENSORS | - BASIC_AC_SENSORS | - THREE_PHASE_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=3, - has_battery=False, - has_pv3=True, - max_power_kw=25.0, -) - - -# ============================================================================ -# MAX SERIES - Commercial Three Phase (50-125kW) -# ============================================================================ - -MAX_50000_125000_TL3_X = InverterProfile( - series="max_50000_125000_tl3_x", - name="MAX 50000-125000TL3-X", - description="MAX series 50kW-125kW commercial three-phase inverters", - register_map="MAX_50000_125000TL3_X", - available_sensors=( - BASIC_PV_SENSORS | - PV3_SENSORS | - BASIC_AC_SENSORS | - THREE_PHASE_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=3, - has_battery=False, - has_pv3=True, - max_power_kw=125.0, -) - - -# ============================================================================ -# SPH SERIES - Hybrid Storage Inverters (3-10kW) +# INVERTER PROFILES # ============================================================================ -SPH_3000_10000 = InverterProfile( - series="sph_3000_10000", - name="SPH 3000-10000", - description="SPH series 3kW-10kW single-phase hybrid inverters with battery", - register_map="SPH_3000_10000", - available_sensors=( - BASIC_PV_SENSORS | - PV3_SENSORS | - BASIC_AC_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - BATTERY_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=1, - has_battery=True, - has_pv3=True, - max_power_kw=10.0, -) - - -# ============================================================================ -# MOD SERIES - Modular Three Phase with Battery (6-15kW) -# ============================================================================ - -MOD_6000_15000_TL3_XH = InverterProfile( - series="mod_6000_15000_tl3_xh", - name="MOD 6000-15000TL3-XH", - description="MOD series 6kW-15kW three-phase hybrid inverters with battery", - register_map="MOD_6000_15000TL3_XH", - available_sensors=( - BASIC_PV_SENSORS | - PV3_SENSORS | - BASIC_AC_SENSORS | - THREE_PHASE_SENSORS | - GRID_SENSORS | - POWER_FLOW_SENSORS | - CONSUMPTION_SENSORS | - ENERGY_SENSORS | - ENERGY_BREAKDOWN_SENSORS | - BATTERY_SENSORS | - TEMPERATURE_SENSORS | - STATUS_SENSORS - ), - phases=3, - has_battery=True, - has_pv3=True, - max_power_kw=15.0, -) - - -# ============================================================================ -# PROFILE REGISTRY -# ============================================================================ - -INVERTER_PROFILES: Dict[str, InverterProfile] = { - # MIN Series - "min_3000_6000_tl_x": MIN_3000_6000_TL_X, - "min_7000_10000_tl_x": MIN_7000_10000_TL_X, +INVERTER_PROFILES = { + # ======================================================================== + # MIN SERIES - Single Phase String Inverters + # ======================================================================== + + "min_3000_6000_tl_x": { + "name": "MIN 3000-6000TL-X", + "description": "2 PV string single-phase inverter (3-6kW)", + "register_map": "MIN_3000_6000TL_X", + "phases": 1, + "has_pv3": False, + "has_battery": False, + "max_power_kw": 6.0, + "sensors": ( + BASIC_PV_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + "min_7000_10000_tl_x": { + "name": "MIN 7000-10000TL-X", + "description": "3 PV string single-phase inverter (7-10kW)", + "register_map": "MIN_7000_10000TL_X", + "phases": 1, + "has_pv3": True, + "has_battery": False, + "max_power_kw": 10.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # TL-XH SERIES - Single Phase Hybrid (with battery) + # ======================================================================== + + "tl_xh_3000_10000": { + "name": "TL-XH 3000-10000", + "description": "Hybrid single-phase inverter with battery (3-10kW)", + "register_map": "TL_XH_3000_10000", + "phases": 1, + "has_pv3": True, + "has_battery": True, + "max_power_kw": 10.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + "tl_xh_us_3000_10000": { + "name": "TL-XH US 3000-10000", + "description": "US hybrid single-phase inverter with battery (3-10kW)", + "register_map": "TL_XH_US_3000_10000", + "phases": 1, + "has_pv3": True, + "has_battery": True, + "max_power_kw": 10.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # MID SERIES - Three Phase String Inverters + # ======================================================================== + + "mid_15000_25000tl3_x": { + "name": "MID 15000-25000TL3-X", + "description": "Three-phase commercial inverter (15-25kW)", + "register_map": "MID_15000_25000TL3_X", + "phases": 3, + "has_pv3": False, + "has_battery": False, + "max_power_kw": 25.0, + "sensors": ( + BASIC_PV_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + ENERGY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # MAC SERIES - Three Phase Compact + # ======================================================================== + + "mac_20000_40000tl3_x": { + "name": "MAC 20000-40000TL3-X", + "description": "Compact three-phase commercial inverter (20-40kW)", + "register_map": "MAC_20000_40000TL3_X", + "phases": 3, + "has_pv3": False, + "has_battery": False, + "max_power_kw": 40.0, + "sensors": ( + BASIC_PV_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + ENERGY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # MAX SERIES - Commercial Three Phase + # ======================================================================== - # MID Series - "mid_15000_25000_tl3_x": MID_15000_25000_TL3_X, + "max_50000_125000tl3_x": { + "name": "MAX 50000-125000TL3-X", + "description": "Commercial three-phase inverter (50-125kW)", + "register_map": "MAX_50000_125000TL3_X", + "phases": 3, + "has_pv3": True, + "has_battery": False, + "max_power_kw": 125.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + ENERGY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, - # MAX Series - "max_50000_125000_tl3_x": MAX_50000_125000_TL3_X, + "max_1500v_series": { + "name": "MAX 1500V Series", + "description": "High-voltage commercial three-phase inverter (up to 150kW)", + "register_map": "MAX_1500V_SERIES", + "phases": 3, + "has_pv3": True, + "has_battery": False, + "max_power_kw": 150.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + ENERGY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, - # SPH Series (Hybrid/Storage) - "sph_3000_10000": SPH_3000_10000, + "max_x_lv_series": { + "name": "MAX-X LV Series", + "description": "Low-voltage commercial three-phase inverter (up to 125kW)", + "register_map": "MAX_X_LV_SERIES", + "phases": 3, + "has_pv3": True, + "has_battery": False, + "max_power_kw": 125.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + ENERGY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, - # MOD Series (Modular Hybrid) - "mod_6000_15000_tl3_xh": MOD_6000_15000_TL3_XH, + # ======================================================================== + # SPH SERIES - Hybrid Storage (Single Phase with Battery) + # ======================================================================== + + "sph_3000_10000": { + "name": "SPH 3000-10000", + "description": "Hybrid inverter with battery storage (3-10kW)", + "register_map": "SPH_3000_10000", + "phases": 1, + "has_pv3": False, # SPH typically has 2 PV inputs + "has_battery": True, + "max_power_kw": 10.0, + "sensors": ( + BASIC_PV_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # MIX SERIES - Legacy Storage + # ======================================================================== + + "mix_series": { + "name": "MIX Series", + "description": "Legacy storage inverter (merged into SPH)", + "register_map": "MIX_SERIES", + "phases": 1, + "has_pv3": False, + "has_battery": True, + "max_power_kw": 10.0, + "sensors": ( + BASIC_PV_SENSORS | + BASIC_AC_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # SPA SERIES - AC-Coupled Storage + # ======================================================================== + + "spa_series": { + "name": "SPA Series", + "description": "AC-coupled storage inverter", + "register_map": "SPA_SERIES", + "phases": 1, + "has_pv3": False, + "has_battery": True, + "max_power_kw": 10.0, + "sensors": ( + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # MOD SERIES - Modular Three Phase Hybrid + # ======================================================================== + + "mod_6000_15000tl3_xh": { + "name": "MOD 6000-15000TL3-XH", + "description": "Modular three-phase hybrid inverter with battery (6-15kW)", + "register_map": "MOD_6000_15000TL3_XH", + "phases": 3, + "has_pv3": True, + "has_battery": True, + "max_power_kw": 15.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, + + # ======================================================================== + # WIT SERIES - Business Storage Power + # ======================================================================== + + "wit_tl3_series": { + "name": "WIT TL3 Series", + "description": "Business storage power three-phase inverter", + "register_map": "WIT_TL3_SERIES", + "phases": 3, + "has_pv3": True, + "has_battery": True, + "max_power_kw": 50.0, + "sensors": ( + BASIC_PV_SENSORS | + PV3_SENSORS | + BASIC_AC_SENSORS | + THREE_PHASE_SENSORS | + GRID_SENSORS | + POWER_FLOW_SENSORS | + CONSUMPTION_SENSORS | + ENERGY_SENSORS | + ENERGY_BREAKDOWN_SENSORS | + BATTERY_SENSORS | + TEMPERATURE_SENSORS | + STATUS_SENSORS + ), + }, } -def get_profile(series: str) -> InverterProfile: +# ============================================================================ +# HELPER FUNCTIONS +# ============================================================================ + +def get_profile(series: str): """Get inverter profile by series name.""" - return INVERTER_PROFILES.get(series) + return INVERTER_PROFILES.get(series, INVERTER_PROFILES["min_7000_10000_tl_x"]) def get_available_profiles() -> Dict[str, str]: """Get dict of available profiles for UI selection.""" return { - series: profile.name + series: profile["name"] for series, profile in INVERTER_PROFILES.items() } def get_sensors_for_profile(series: str) -> Set[str]: - """Get available sensors for a specific profile.""" - profile = get_profile(series) - if profile: - return profile.available_sensors - return set() - - -def profile_supports_sensor(series: str, sensor_key: str) -> bool: - """Check if a profile supports a specific sensor.""" + """Get available sensors for a profile.""" profile = get_profile(series) - if profile: - return sensor_key in profile.available_sensors - return False \ No newline at end of file + return profile.get("sensors", set()) \ No newline at end of file diff --git a/custom_components/growatt_modbus/strings.json b/custom_components/growatt_modbus/strings.json index 9c2f0ac4..d2c7851c 100644 --- a/custom_components/growatt_modbus/strings.json +++ b/custom_components/growatt_modbus/strings.json @@ -75,12 +75,20 @@ "selector": { "inverter_series": { "options": { - "min_3000_6000_tl_x": "MIN 3000-6000TL-X (2 PV, 3-6kW)", - "min_7000_10000_tl_x": "MIN 7000-10000TL-X (3 PV, 7-10kW)", + "min_3000_6000_tl_x": "MIN 3000-6000TL-X (Single-phase, 2 PV, 3-6kW)", + "min_7000_10000_tl_x": "MIN 7000-10000TL-X (Single-phase, 3 PV, 7-10kW)", + "tl_xh_3000_10000": "TL-XH 3000-10000 (Hybrid with battery, 3-10kW)", + "tl_xh_us_3000_10000": "TL-XH US 3000-10000 (US Hybrid with battery, 3-10kW)", "mid_15000_25000_tl3_x": "MID 15000-25000TL3-X (3-phase, 15-25kW)", - "max_50000_125000_tl3_x": "MAX 50000-125000TL3-X (3-phase, 50-125kW)", + "mac_20000_40000_tl3_x": "MAC 20000-40000TL3-X (3-phase compact, 20-40kW)", + "max_50000_125000_tl3_x": "MAX 50000-125000TL3-X (3-phase commercial, 50-125kW)", + "max_1500v_series": "MAX 1500V Series (High-voltage commercial, up to 150kW)", + "max_x_lv_series": "MAX-X LV Series (Low-voltage commercial, up to 125kW)", "sph_3000_10000": "SPH 3000-10000 (Hybrid with battery, 3-10kW)", - "mod_6000_15000_tl3_xh": "MOD 6000-15000TL3-XH (3-phase hybrid, 6-15kW)" + "mix_series": "MIX Series (Legacy storage inverter)", + "spa_series": "SPA Series (AC-coupled storage)", + "mod_6000_15000_tl3_xh": "MOD 6000-15000TL3-XH (3-phase hybrid, 6-15kW)", + "wit_tl3_series": "WIT TL3 Series (Business storage power, 3-phase)" } } } diff --git a/custom_components/growatt_modbus/translations/en.json b/custom_components/growatt_modbus/translations/en.json new file mode 100644 index 00000000..d2c7851c --- /dev/null +++ b/custom_components/growatt_modbus/translations/en.json @@ -0,0 +1,95 @@ +{ + "config": { + "step": { + "user": { + "title": "Growatt Modbus Setup", + "description": "Configure your Growatt inverter connection. Choose between TCP (Ethernet/WiFi adapter like EW11) or Serial (USB-to-RS485 adapter).", + "data": { + "name": "Integration Name", + "inverter_series": "Inverter Series", + "connection_type": "Connection Type" + }, + "data_description": { + "name": "Friendly name for this inverter", + "inverter_series": "Select your inverter model/series", + "connection_type": "How to connect to your inverter" + } + }, + "tcp": { + "title": "TCP Connection Settings", + "description": "Configure TCP connection to your RS485-to-Ethernet/WiFi adapter (EW11, USR-W630, etc.)", + "data": { + "host": "IP Address", + "port": "Port", + "slave_id": "Modbus Slave ID" + }, + "data_description": { + "host": "IP address of your RS485-to-TCP converter", + "port": "Modbus TCP port (usually 502)", + "slave_id": "Inverter Modbus address (usually 1)" + } + }, + "serial": { + "title": "Serial Connection Settings", + "description": "Configure serial connection to your USB-to-RS485 adapter", + "data": { + "device_path": "Device Path", + "baudrate": "Baud Rate", + "slave_id": "Modbus Slave ID" + }, + "data_description": { + "device_path": "Serial device path (e.g., /dev/ttyUSB0 or COM3)", + "baudrate": "Serial communication speed (usually 9600)", + "slave_id": "Inverter Modbus address (usually 1)" + } + } + }, + "error": { + "cannot_connect": "Failed to connect to inverter. Check your connection settings and wiring.", + "unknown": "Unexpected error occurred during setup." + }, + "abort": { + "already_configured": "This inverter is already configured." + } + }, + "options": { + "step": { + "init": { + "title": "Growatt Modbus Options", + "description": "Configure device name, polling settings, and grid power options", + "data": { + "device_name": "Device Name", + "scan_interval": "Scan Interval", + "timeout": "Connection Timeout", + "invert_grid_power": "Invert Grid Power" + }, + "data_description": { + "device_name": "Friendly name for the device (appears before all sensor names)", + "scan_interval": "How often to poll the inverter for new data (5-300 seconds)", + "timeout": "How long to wait for responses from the inverter (1-60 seconds)", + "invert_grid_power": "Enable if CT clamp installed backwards (import/export swapped)" + } + } + } + }, + "selector": { + "inverter_series": { + "options": { + "min_3000_6000_tl_x": "MIN 3000-6000TL-X (Single-phase, 2 PV, 3-6kW)", + "min_7000_10000_tl_x": "MIN 7000-10000TL-X (Single-phase, 3 PV, 7-10kW)", + "tl_xh_3000_10000": "TL-XH 3000-10000 (Hybrid with battery, 3-10kW)", + "tl_xh_us_3000_10000": "TL-XH US 3000-10000 (US Hybrid with battery, 3-10kW)", + "mid_15000_25000_tl3_x": "MID 15000-25000TL3-X (3-phase, 15-25kW)", + "mac_20000_40000_tl3_x": "MAC 20000-40000TL3-X (3-phase compact, 20-40kW)", + "max_50000_125000_tl3_x": "MAX 50000-125000TL3-X (3-phase commercial, 50-125kW)", + "max_1500v_series": "MAX 1500V Series (High-voltage commercial, up to 150kW)", + "max_x_lv_series": "MAX-X LV Series (Low-voltage commercial, up to 125kW)", + "sph_3000_10000": "SPH 3000-10000 (Hybrid with battery, 3-10kW)", + "mix_series": "MIX Series (Legacy storage inverter)", + "spa_series": "SPA Series (AC-coupled storage)", + "mod_6000_15000_tl3_xh": "MOD 6000-15000TL3-XH (3-phase hybrid, 6-15kW)", + "wit_tl3_series": "WIT TL3 Series (Business storage power, 3-phase)" + } + } + } +} \ No newline at end of file