-
-
Notifications
You must be signed in to change notification settings - Fork 16
Battery System Setup
PowerSync supports two methods for accessing your Tesla Powerwall. Choose one — you don't need both.
The easiest setup option. Teslemetry is a third-party proxy service for Tesla API.
| Pros | |
|---|---|
| Simple API key authentication | No OAuth complexity |
| Works with localhost | No public domain needed |
| 2-minute setup | Just copy/paste API key |
| Reliable service | Well-maintained proxy |
Setup:
- Sign up at https://teslemetry.com
- Connect your Tesla account
- Copy your API key
- Paste into PowerSync settings
Direct OAuth access to Tesla's Fleet API. Completely free but requires more setup.
Setup:
- Install the official Tesla Fleet integration in Home Assistant
- Settings > Devices & Services > Add Integration > "Tesla Fleet"
- Follow the OAuth login flow
- PowerSync automatically detects your Tesla Fleet credentials
- Leave the Teslemetry field empty during PowerSync setup
This feature is specifically for a Powerwall 2 and Powerwall 3 coexisting as separate systems on the same circuit. It is NOT for multiple Powerwall 3 units in a leader/follower configuration — Tesla manages those natively as a single system and no additional setup is needed.
If you have a Powerwall 2 alongside a Powerwall 3 on the same electrical circuit, PowerSync can manage both as a single combined system. This prevents inter-battery charging, where one battery's discharge is absorbed by the other, wasting energy.
Why this matters: Tesla doesn't support mixing PW2 and PW3 on the same system. Without coordinated control, when one discharges, the other may absorb that power — effectively charging one battery from the other.
How it works:
- A single PowerSync config entry manages both Powerwall gateways
- Both gateways are polled independently and their data is aggregated into a single view
- Solar, battery, grid, and load power are summed across both systems
- Battery SOC is capacity-weighted across both Powerwalls (configurable per-system capacity)
- All commands (force charge, force discharge, TOU sync, mode changes, backup reserve) are sent to both gateways simultaneously
- Both batteries always receive the same action — no asymmetric states means no inter-battery power flow
How inter-battery charging is prevented:
| Optimizer Action | Both Powerwalls | Inter-battery flow? |
|---|---|---|
| CHARGE | backup_reserve=100%, charge tariff | No — both importing from grid |
| DISCHARGE | backup_reserve=0%, discharge tariff | No — both exporting to grid |
| IDLE | self_consumption, reserve=min(soc,80%) | No — neither imports nor exports |
| SELF_CONSUMPTION | self_consumption, normal reserve | No — both serve home load |
Battery capacity weights:
If your two Powerwalls have different capacities, configure each so that SOC averaging is accurate:
| Setting | Value |
|---|---|
| Primary Battery Capacity | 13.5 |
| Secondary Battery Capacity | 13.5 |
With these settings:
- SOC averaging is capacity-weighted. If the PW2 (13.5 kWh) is at 80% and the PW3 (13.5 kWh) is at 30%, the combined SOC is 55% — not the naive average
- The LP optimizer sees the combined capacity and makes decisions for the whole system
The default capacity is 13.5 kWh for both systems.
Setup (new installation):
- During initial setup, select your primary Powerwall site
- If you have multiple Tesla energy sites, you'll be prompted to optionally select a secondary site
- Set battery capacity for each system
- If the secondary Powerwall is on a different Tesla account, enter the secondary API token
Setup (existing installation):
- Go to Settings > Devices & Services > PowerSync > Configure
- In the settings page, enter the secondary Powerwall's Energy Site ID
- Set battery capacities for primary and secondary
- If needed, enter the secondary API token (only for different Tesla accounts)
- Save and reload the integration
Finding your Energy Site ID: You can find this in your Tesla app under System Settings, or in the Teslemetry dashboard. It's a numeric ID like
1234567890.
Same vs. different Tesla accounts:
- Same account (most common): Both Powerwalls are on the same Tesla account. Leave the secondary API token blank — PowerSync shares the primary token.
- Different accounts: If the Powerwalls are registered to different Tesla accounts (e.g., one under your name, another under a partner's), enter the secondary account's Teslemetry API token.
Safety features:
- If the secondary gateway fails to connect on startup, PowerSync falls back to single-gateway mode automatically
- Per-gateway SOC is logged when SOC divergence exceeds 10%
- Each sub-coordinator polls independently — a temporary API failure on one gateway doesn't block the other
- Removing the secondary site ID in the options flow cleanly removes all secondary config
- A 1-second delay between API calls to each gateway prevents rate limiting
Supports H1, H3, H3-Pro, H3 Smart, and KH model families via Modbus TCP or RS485 serial. No cloud API required for battery control — all control is done locally via Modbus.
OEM rebrands using identical hardware are also supported — the model family is auto-detected via register probing during setup.
| Model Family | Type | Register Space | OEM Rebrands |
|---|---|---|---|
| H1 | Single Phase | 31xxx/41xxx | AIO-H1, a-TroniX AX |
| H3 | Three Phase | 31xxx/41xxx | AIO-H3, Kuara H3, Sonnenkraft SK-HWR, 1KOMMA5 |
| H3-Pro | Three Phase (Higher Power) | 37xxx/46xxx/49xxx | — |
| H3 Smart | Three Phase (Native WiFi) | 37xxx/46xxx/49xxx | — |
| KH | Single Phase Hybrid | 31xxx/41xxx | — |
Rebrands: If your inverter is an OEM rebrand (e.g., Kuara, Sonnenkraft, 1KOMMA5), just connect it like any other FoxESS unit. PowerSync identifies the model family automatically from Modbus registers — no special configuration needed.
Modbus TCP (Recommended for H3 Smart)
- Port: 502 (default)
- Slave ID: 247 (default)
- For H3 Smart: Connect directly to the inverter's IP address — no external adapter needed
RS485 Serial
- Baud rate: 9600 (default)
- Slave ID: 247 (default)
- Requires an RS485 adapter (USB or network gateway like Elfin EW11)
The H3 Smart has a built-in WiFi Modbus TCP server. No external RS485 adapter is needed.
- Find the inverter's IP address — it appears as "espressif" on your network (it uses an ESP WiFi module)
- Ensure firmware is up to date — the Modbus TCP server requires current firmware
- Use default settings — Port 502, Slave ID 247
- PowerSync will auto-detect the model as H3 Smart during setup
Troubleshooting: If the connection test fails:
- Check your router for a device named "espressif" to find the correct IP
- Update inverter firmware to the latest version
- Verify port 502 is not blocked by your network
A FoxESS Cloud API key allows PowerSync to sync Amber/Octopus prices as time-based schedules on your inverter (up to 8 periods per day). This is not required for battery control — all control is done locally via Modbus.
Getting your API key:
- Log in to foxesscloud.com
- Go to User Profile > API Management
- Generate a new API key
- Enter the API key and your device serial number during PowerSync setup
Note: When Smart Optimization (LP) is enabled, cloud schedule sync is automatically skipped — the LP optimizer controls the inverter directly via Modbus, and uploading schedules to the cloud would conflict.
| Mode | Value | Description |
|---|---|---|
| Self Use | 0 | Default operation |
| Feed-in First | 1 | Export priority |
| Backup | 2 | Backup mode |
| Force Charge | 3 | Force charge from grid |
| Force Discharge | 4 | Force discharge/export |
Full support for Sigenergy hybrid inverters with integrated battery storage.
- Tariff Sync via Cloud API — Uploads pricing to Sigenergy Cloud using 30-minute TOU format
- Real-Time Energy Data via Modbus — Reads solar, battery, grid power and SOC from your inverter
- DC Solar Curtailment — Controls DC solar via Modbus TCP during negative prices (load-following mode)
| Connection | Purpose | Required |
|---|---|---|
| Cloud API | Tariff sync to Sigenergy | Yes |
| Modbus TCP | Real-time energy data + DC curtailment | Yes |
Important: Modbus TCP Server must be enabled on your Sigenergy inverter before PowerSync can connect. This setting is typically configured by your installer via the SigenStor app or installer portal.
Device ID Note: If you have an AC Charger installed, it uses Device ID 1 by default. The inverter must be set to a higher ID (e.g., 2).
What You Need:
| Credential | Description | Where to Find |
|---|---|---|
| Your Sigenergy account email | Your login email | |
| Password | Your Sigenergy account password | Your normal password |
| Device ID | Optional — usually not needed | Leave blank (see note below) |
| Station ID | Your Sigenergy station identifier | SigenAI or browser dev tools |
Device ID (optional):
Sigenergy no longer requires a Device ID for authentication. Leave this field blank. If authentication fails without it, you can find it by:
- Go to https://web-aus.sigencloud.com/ in your browser (don't log in yet)
- Open Developer Tools (F12) > Network tab > filter by Fetch/XHR > check "Preserve log"
- Log in normally
- Find the
tokenPOST request > Payload tab > look for userDeviceId (13 digits)
Getting Station ID:
- Ask SigenAI in the app: "Tell me my StationID"
- Or find it in dev tools network requests
- Select Sigenergy as your battery system
- Enter Cloud credentials (email, password)
- Select your station from the list
- Enter your inverter's Modbus IP address
- Optionally enable DC solar curtailment
Full support for GoodWe hybrid inverters via the goodwe Python library. Local connection only — no cloud API required.
- Auto-Detection — Model family is automatically identified during setup
- Force Charge/Discharge — Via ECO_CHARGE and ECO_DISCHARGE operation modes
- Backup Reserve — Set minimum SOC via depth-of-discharge control
- Grid Export Limit — Configurable export power limit
- Battery Health — SOH read from inverter
| Series | Type | Battery Control |
|---|---|---|
| ET | Three Phase Hybrid | Full support |
| EH | Three Phase Hybrid | Full support |
| BT | Three Phase Hybrid | Full support |
| BH | Three Phase Hybrid | Full support |
| ES | Single Phase Hybrid | Full support |
| EM | Single Phase Hybrid | Full support |
| BP | Single Phase Hybrid | Full support |
| DT/MS/XS | Grid-only (no battery) | Not supported |
UDP via WiFi Dongle (Default)
- Port: 8899
- Works with most GoodWe inverters out of the box
- Uses the inverter's WiFi dongle for communication
TCP via LAN Dongle
- Port: 502
- Requires a GoodWe LAN dongle (WLA0000-01-00P V2.0)
- More reliable for installations with poor WiFi
- Find the inverter's IP address — check your router's device list for the WiFi or LAN dongle
- Select GoodWe as your battery system during PowerSync setup
- Enter the inverter's IP address
- Select the protocol (UDP or TCP) matching your dongle type
- The port defaults automatically (8899 for UDP, 502 for TCP)
- PowerSync tests the connection and auto-detects your inverter model
Note: If setup reports "no battery support", your inverter is a grid-only model (DT/MS/XS series) which does not have battery control capabilities.
| Mode | Description |
|---|---|
| General | Normal self-consumption operation |
| ECO Charge | Force charge from grid (used by force_charge) |
| ECO Discharge | Force discharge to grid (used by force_discharge) |
GoodWe uses Depth of Discharge (DOD) internally. PowerSync converts automatically:
- Setting backup reserve to 20% → DOD = 80%
- Setting backup reserve to 100% → DOD = 0% (full backup)
- Maximum DOD is capped at 89% (minimum 11% reserve)
Full support for Sungrow SH-series hybrid inverters via direct Modbus TCP. No cloud API required.
- Direct Modbus Control — All control via local Modbus TCP
- Force Charge/Discharge — Manual or automatic battery control
- Rate Limiting — Set maximum charge and discharge rates (kW)
- Export Limit Control — Limit grid export power
- Backup Reserve — Configure minimum SOC for backup power
- Battery Health Monitoring — Read SOH directly from BMS
- AEMO Spike Auto-Discharge — Automatic VPP participation for Globird users
| Series | Type | Battery Control |
|---|---|---|
| SH-series | Hybrid Inverter | Full support |
| SG-series | String Inverter | AC curtailment only (no battery) |
| Setting | Default |
|---|---|
| Port | 502 |
| Slave ID | 1 |
| Register | Function |
|---|---|
| 13021 | Battery SOC (0.1%) |
| 13022 | Battery SOH (0.1%) |
| 13050 | EMS Mode (0=Self-consumption, 2=Forced) |
| 13051 | Charge Command (0xAA=Charge, 0xBB=Discharge, 0xCC=Stop) |
| 13059 | Minimum SOC / Backup Reserve (0.1%) |
| 13066 | Max Discharge Current (0.001A) |
| 13067 | Max Charge Current (0.001A) |
| 13074 | Export Power Limit (W) |
If you have two Sungrow SH inverters — for example, a grid-facing primary and a secondary on the primary's backup port — PowerSync can manage both as a single combined system.
How it works:
- During initial setup, after configuring the primary inverter you'll be prompted to optionally add a second inverter's IP address
- Both inverters are polled independently and their data is aggregated into a single view
- Solar, battery power, and load are summed across both inverters
- Grid power uses the primary inverter only (it's the grid-facing unit)
- Battery SOC is capacity-weighted across both inverters (configurable per-inverter capacity)
- Commands (force charge, force discharge, restore) are sent to both inverters simultaneously
- Charge/discharge power is split proportionally based on SOC and battery capacity — the emptier battery gets more charging power, the fuller battery gets more discharging power, and larger batteries get a proportionally larger share
- Export limits are set on the primary only (the grid-facing inverter)
Battery capacity weights:
If your two inverters have different-sized battery stacks, configure the capacity of each so that SOC averaging and power splitting are accurate. For example, if your primary has 2× SBR256 (51.2 kWh) and your secondary has 4× SBR256 (102.4 kWh):
| Setting | Value |
|---|---|
| Primary Battery Capacity | 51.2 |
| Secondary Battery Capacity | 102.4 |
With these settings:
- SOC averaging is capacity-weighted. If the 51.2 kWh stack is at 80% and the 102.4 kWh stack is at 40%, the combined SOC is 53.3% — not the naive 60% average
- Power splitting accounts for both SOC and capacity. The larger stack receives a proportionally larger share of charge/discharge commands
The default capacity is 25.6 kWh (one SBR256 unit) for both inverters. If your battery stacks are identical, you can leave the defaults — the ratio is what matters, not the absolute values.
Setup:
- Configure your primary (grid-facing) Sungrow inverter as normal
- On the "Secondary Sungrow Inverter" step, enter the IP of your second inverter
- PowerSync tests the connection and stores both configurations
- To add/remove a secondary later, go to Settings > Devices & Services > PowerSync > Configure
Grid-forming inverter SOC cap:
In an off-grid scenario the grid-forming (primary) inverter needs headroom in its battery to absorb any excess output from the secondary inverter. The Primary Inverter Max SOC (%) setting caps the primary inverter's maximum charge level — for example, setting it to 90% reserves 10% buffer capacity. This is enforced automatically every poll cycle via Modbus. Set to 100% (default) to disable.
Safety features:
- If the secondary inverter fails to connect on startup, PowerSync falls back to single-inverter mode automatically
- Per-inverter SOC is logged when SOC divergence exceeds 5%
- Each sub-coordinator polls independently — a temporary Modbus failure on one inverter doesn't block the other
- Removing the secondary IP in the options flow cleanly removes all secondary config
Globird's VPP program pays premium rates during AEMO price spikes ($3000/MWh or above). PowerSync can automatically participate:
- Enable AEMO Spike Auto-Discharge in the mobile app Controls screen
- Select your NEM region (NSW1, VIC1, QLD1, SA1, TAS1)
- When AEMO prices hit $3000/MWh, PowerSync automatically forces battery discharge
- When the spike ends, battery returns to normal operation
- Push notifications are sent for both spike start and end
Tip: If you also have a separate AC-coupled solar inverter, configure it in the AC Inverter Curtailment section. PowerSync will validate that your Sungrow battery and AC inverter don't use the same Modbus slave ID.