A modern Home Assistant custom integration for Fox ESS Cloud solar inverters. Monitor your solar installation and control battery settings directly from Home Assistant — fully UI-configured, no YAML editing required.
- UI Config Flow — Enter your API key, select your inverter from a dropdown. Done.
- 40+ Sensors — Real-time power, PV strings 1–4, grid, load, battery, phase R/S/T, temperatures, generation totals.
- Battery Controls — Adjust Min SoC and Min SoC on Grid via sliders.
- Work Mode Select — Switch between SelfUse, Backup, Feedin, and PeakShaving.
- Mode Scheduler services — Read and write the inverter's time-of-day schedule (Self-use, Force Discharge, Force Charge…) from automations.
- Refresh Button — Force an immediate full data refresh.
- Options Flow — Change the polling interval without reconfiguring.
- HA Device Registry — All entities grouped under a single device with model and firmware info.
- Energy Dashboard Ready — Daily energy sensors with correct device classes for the HA Energy Dashboard.
- Diagnostics — Built-in diagnostics with automatic redaction of sensitive data.
- Rate-Limit Aware — Staggered polling stays well within the 1440 calls/day API limit.
Before installing, you need a Fox ESS Cloud API key:
- Log in to foxesscloud.com
- Click the profile icon (top-right corner) → User Profile
- Select API Management from the left menu
- Click Generate API Key
- Copy and save the key — you'll need it during setup
Important: Generating a new key invalidates the old one. If you're already using an API key with another integration (e.g., foxess-ha), do not generate a new one — use the same key.
- Open HACS in Home Assistant
- Go to Integrations
- Click the ⋮ menu (top-right) → Custom repositories
- Enter the repository URL and select category Integration:
https://github.com/techazm/foxess-cloud-ha - Click Add
- Search for Fox ESS Cloud and click Download
- Restart Home Assistant
- Download the latest release or clone this repository
- Copy the entire
custom_components/foxess_cloudfolder into your Home Assistantconfig/custom_components/directory:config/ └── custom_components/ └── foxess_cloud/ ├── __init__.py ├── api.py ├── brand/ │ ├── icon.png │ ├── icon@2x.png │ └── logo.png ├── button.py ├── config_flow.py ├── const.py ├── coordinator.py ├── diagnostics.py ├── entity.py ├── manifest.json ├── number.py ├── select.py ├── sensor.py ├── services.py ├── services.yaml ├── strings.json └── translations/ └── en.json - Restart Home Assistant
- Go to Settings → Devices & Services
- Click + Add Integration (bottom-right)
- Search for Fox ESS Cloud
- Step 1 — API Key: Paste your Fox ESS Cloud API key
- Step 2 — Select Device: Choose your inverter from the dropdown (the integration auto-discovers all inverters linked to your account)
- Click Submit — all entities are created automatically
After setup, click Configure on the integration card to adjust:
- Update interval — How often to poll the API (default: 5 minutes, range: 3–60 minutes)
If you have more than one inverter, simply add the integration again. Each inverter gets its own device and set of entities.
All entities are grouped under a single device in the HA device registry (e.g., "Fox ESS ") with manufacturer, model, and firmware information.
| Entity | Type | Description |
|---|---|---|
| Min SoC | Number (slider) | Battery minimum State of Charge (10–100%) |
| Min SoC on Grid | Number (slider) | Battery minimum SoC when grid is available (10–100%) |
| Work Mode | Select | SelfUse / Backup / Feedin / PeakShaving |
| Refresh All Data | Button | Force immediate refresh of all data from Fox ESS Cloud |
Work Mode vs Mode Scheduler: while the Mode Scheduler is enabled it overrides the Work Mode select. Use the services below to change scheduled behaviour.
| Entity | Description |
|---|---|
| Mode Scheduler (sensor) | enabled / disabled; attribute groups lists the current time groups. Refreshed hourly and after every write. |
These update every polling cycle (default 5 minutes):
| Entity | Unit | Description |
|---|---|---|
| PV Power | kW | Total solar power from all strings |
| PV1–4 Power | kW | Per-string solar power |
| PV1–4 Voltage | V | Per-string voltage |
| PV1–4 Current | A | Per-string current |
| Generation Power | kW | Total power generation |
| Grid Consumption Power | kW | Power drawn from grid |
| Feed-in Power | kW | Power exported to grid |
| Load Power | kW | Home consumption |
| Battery Charge Power | kW | Power going into the battery |
| Battery Discharge Power | kW | Power coming from the battery |
| Inverter Battery Power | kW | Net battery power (negative=charging) |
| Meter 2 Power | kW | Secondary meter power |
| Entity | Unit | Description |
|---|---|---|
| Battery SoC | % | Current State of Charge |
| Battery SoH | % | State of Health |
| Battery Temperature | °C | Battery temperature |
| Residual Energy | kWh | Remaining battery energy |
| Entity | Unit | Description |
|---|---|---|
| R/S/T Voltage | V | Per-phase voltage |
| R/S/T Current | A | Per-phase current |
| R/S/T Power | kW | Per-phase power |
| R/S/T Frequency | Hz | Per-phase grid frequency |
| Entity | Unit | Description |
|---|---|---|
| Ambient Temperature | °C | Ambient temperature near inverter |
| Boost Temperature | °C | Boost circuit temperature |
| Inverter Temperature | °C | Inverter internal temperature |
| Entity | Description |
|---|---|
| Running State | On Grid, Off Grid, Standby, Fault, etc. |
| Power Factor | Power factor percentage |
| Reactive Power | Reactive power in kVar |
These update every 3rd polling cycle (~15 minutes):
| Entity | Unit | Description |
|---|---|---|
| Daily PV Production | kWh | Solar panel output today: feed-in + load + battery charge − battery discharge − grid import. Use this for the Energy dashboard. Excludes inverter losses, so it reads a few % below the FoxESS app's solar figure |
| Daily Generation | kWh | Inverter AC output today (FoxESS generation). On a hybrid this excludes PV that charged the battery directly, so it is not total solar production |
| Daily Feed-in | kWh | Total exported to grid today |
| Daily Grid Consumption | kWh | Total imported from grid today |
| Daily Load | kWh | Total home consumption today |
| Daily Battery Charge | kWh | Total energy into battery today |
| Daily Battery Discharge | kWh | Total energy from battery today |
These update every 12th polling cycle (~60 minutes):
| Entity | Unit | Description |
|---|---|---|
| Today Generation | kWh | Same-day generation total |
| Month Generation | kWh | Current month total |
| Total Generation | kWh | Lifetime cumulative generation |
Go to Settings → Dashboards → Energy and configure:
- Solar production: select your
Daily PV Productionsensor (notDaily Generation, which misses PV that went straight into the battery)
- Grid consumption (energy FROM grid): select your
Daily Grid Consumptionsensor - Return to grid (energy TO grid): select your
Daily Feed-insensor
- Energy going IN to the battery: select your
Daily Battery Chargesensor - Energy coming OUT of the battery: select your
Daily Battery Dischargesensor
Note: After first setup, the energy dashboard may show partial data for the current day. Full accurate tracking starts from the next day when the daily counters reset at midnight.
Replaces all Mode Scheduler groups (Open API v3), then turns the scheduler on (or off with enable: false). Times are local HH:MM; end is inclusive, as shown in the Fox app (e.g. 17:30–21:29). Groups can't cross midnight or overlap. Time not covered by a group falls back to the inverter's Remaining Time Mode.
action: foxess_cloud.set_schedule
data:
groups:
- { start: "00:00", end: "17:29", work_mode: SelfUse, min_soc_on_grid: 10 }
- { start: "17:30", end: "21:29", work_mode: ForceDischarge,
min_soc_on_grid: 10, fd_soc: 40, fd_pwr: 5500, second_work_mode: SelfUse }
- { start: "21:30", end: "23:59", work_mode: SelfUse, min_soc_on_grid: 10 }| Field | Notes |
|---|---|
work_mode |
SelfUse, Feedin, Backup, ForceCharge, ForceDischarge, ForceCharge(BAT), ForceDischarge(BAT) (checked against the inverter's list) |
min_soc_on_grid |
Always sent |
fd_soc, fd_pwr |
Force modes only: discharge cut-off SoC (%) and power (W) |
second_work_mode |
Force modes only: what runs after the cut-off is reached (SelfUse, Feedin, Backup, Standby). Defaults to SelfUse for ForceDischarge so the house keeps running from the battery |
max_soc, import_limit, export_limit, pv_limit |
Sent only if your inverter advertises them |
device_sn |
Needed only with more than one inverter |
Unsupported fields are dropped with a log warning rather than sent (the v3 API rejects them). Values outside the ranges the inverter advertises (e.g. KH10: fd_pwr 0–10500 W, SoC fields 10–100%) are rejected before anything is written. Each call uses 2 API calls to write plus 2 to re-read.
Returns the live schedule (enabled, groups, max_groups, properties). The inverter also reports its Remaining Time Mode as a 00:00–23:59 group; it's flagged remaining_time_mode: true here and on the Mode Scheduler sensor. Call it from Developer Tools → Actions with Return response.
Fox ESS allows 1440 API calls per day per inverter. This integration uses staggered polling to stay well within that limit:
| Data | Poll Frequency | Calls/Day (5 min interval) |
|---|---|---|
| Real-time data | Every cycle | ~288 |
| Device detail + Reports | Every 3rd cycle (~15 min) | ~192 |
| Battery SOC + Generation + Work Mode + Scheduler | Every 12th cycle (~60 min) | ~120 |
| Total | ~600 |
Schedule writes add 4 calls each.
This leaves plenty of headroom. If you increase the polling interval (e.g., to 10 minutes), the daily call count drops proportionally.
Add this to your configuration.yaml and restart:
logger:
default: warning
logs:
custom_components.foxess_cloud: debugGo to Settings → Devices & Services → Fox ESS Cloud → ⋮ → Download diagnostics. Sensitive data (API key, serial number, plant name) is automatically redacted — safe to share publicly.
| Problem | Solution |
|---|---|
| All sensors show "Unavailable" | Check your API key is valid. Go to foxesscloud.com → API Management to verify. |
| All sensors show "Unknown" | The API call may be failing. Enable debug logging and check for error messages. |
| Rate limit error (40400) | Reduce the polling interval in the integration options, or wait until the daily limit resets at midnight. |
| "Device does not exist" (41930) | The inverter serial number doesn't match your account. Remove and re-add the integration. |
| Energy dashboard shows wrong values on first day | This is normal. Accurate tracking starts from the next full day. |
| Entities go Unavailable briefly | The real-time poll failed (cloud outage or rate limit). Entities recover on the next successful poll; stale values are no longer shown as live. |
set_schedule fails with 40257 |
A parameter isn't accepted for that work mode. Run get_schedule and check properties. |
| Code | Meaning |
|---|---|
| 40256 | Missing request headers — possible signature issue |
| 40257 | Invalid request body parameters |
| 40400 / 40402 | API rate limit exceeded |
| 41809 | Invalid or expired API token |
| 41930 | Device does not exist or belongs to another account |
- New: Daily PV Production sensor - panel output calculated from the daily report (feed-in + load + battery charge − battery discharge − grid import). Daily Generation is the inverter's AC output and undercounts solar on hybrids (e.g. 25 kWh vs ~56 kWh on a day that charged the battery 28 kWh). Switch the Energy dashboard's solar source to the new sensor.
- README: clarified what Daily Generation measures.
- Fix: Force Discharge groups now send
secondWorkMode(defaultSelfUse). Without it the after-cut-off behaviour was left to the inverter's default. - New:
second_work_modefield;ForceCharge(BAT)/ForceDischarge(BAT)work modes. - New: values and work modes are validated against the inverter's advertised
propertiesbefore writing. - The Remaining Time Mode group is flagged
remaining_time_modeinget_scheduleand the Mode Scheduler sensor.
- New:
foxess_cloud.set_schedule/foxess_cloud.get_scheduleservices (Mode Scheduler, Open API v3) and a Mode Scheduler sensor. - Fix: daily report totals used the container clock (
datetime.now()), which is UTC in most Docker installs — after local midnight they showed yesterday's totals until UTC rolled over. Now uses HA's configured timezone. - Fix: daily energy sensors'
last_resetnow follows the date of the cached report, so the Energy dashboard can't count yesterday's total again just after midnight. - Fix: a failed real-time poll now marks entities unavailable (and
onlinefalse) instead of serving stale values as current. - Fix: options flow no longer assigns
config_entryexplicitly (breaks on HA 2025.12+); usesConfigFlowResult. - Fix: API calls are serialised with a lock so polls and writes can't break the 1 s spacing.
- Initial release.
Inspired by macxq/foxess-ha and SoftXperience/home-assistant-foxess-api. Fox ESS brand images from the HA brands repository.
Changes land on main through pull requests with green checks (CI, secret scan,
Conventional Commit title). See CONTRIBUTING.md for branching,
commit style and local checks, and SECURITY.md to report a vulnerability.
