huawei_solar: putting a SUN2000 inverter on Modbus and into Home Assistant
Home Assistant integration for Huawei Solar inverters via Modbus
At a glance
- What is it?
- huawei_solar is a Home Assistant custom integration that talks to Huawei Solar installations over Modbus, either through a USB to RS485 serial adapter on the SUN2000 COM port or over the network, and it can do more than read sensors: and, in its escalated mode, it can cap grid export and force the battery to charge or discharge. It only supports firmware from 2023 onward, and Modbus allows one connection at a time.
- Who is it for?
- huawei_solar suits a Home Assistant user with a Huawei Solar installation who wants inverter, battery, power meter and optimizer data on the dashboard and, if their inverter firmware is from 2023 or later, wants to control grid export and battery behaviour from automations.
- Can I use it commercially?
- Yes, with strict conditions. AGPL-3.0 is a network copyleft licence: if people use a modified version over a network, for example as a hosted service, you must offer them its source code under the same licence.
- Is it still maintained?
- Yes. The repository last received commits 13 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
One Modbus link to the inverter, the battery and the optimizers
The integration exposes the information and functions a Huawei Solar installation makes available over Modbus to Home Assistant. What arrives in Home Assistant is a set of entities covering four device groups, and the README shows screenshots for each: the inverter, the battery, the power meter and the optimizer.
The entity set is broader than a single production figure. The inverter and battery each get a sensor panel and a configuration panel, the inverter additionally has a diagnostics panel, and the power meter and optimizer have their own sensor panels. The README also shows a configuration screen for the HA Energy Dashboard, which tells you the integration is built to feed Home Assistant's energy views rather than only to publish raw numbers into a log.
On top of the read-only sensors, the integration exposes services. The README links two of them to wiki pages: one for actively controlling the amount of electricity exported to the grid, and one for forcibly charging or discharging the battery. Both are behind a permission gate. To enable the advanced features you select the privilege checkbox in the setup flow, and the README spells out exactly what that grants, namely access to optimizer data and the ability to dynamically change inverter and battery settings.
That distinction is the design point of the whole project. Read-only telemetry is cheap to expose. Changing how much your installation exports to the grid, or forcing the battery off its normal charge curve, is a write operation against vendor registers, and the integration makes you opt into it explicitly.
The repository layout confirms the shape of a Home Assistant custom integration: `config_flow.py` for the setup wizard, `sensor.py`, `number.py`, `select.py`, `switch.py` and `button.py` for the different entity platforms, `services.py` with a `services.yaml` for the callable actions, `update_coordinator.py` for polling, `diagnostics.py` for support dumps, plus `manifest.json`, `hacs.json`, `icons.json`, `strings.json` and a `translations/` directory with a `crowdin.yml` for crowd-sourced translation.
Two connection modes, and the one connection rule that causes most problems
The integration supports two ways to reach the inverter.
The first is a direct serial connection to the RS485A1 and RS485B1 pins of the COM port of SUN2000 inverters, using a USB to RS485 converter. The second is a network connection over Modbus TCP. During the configuration flow you choose which one, and the details differ.
For serial, you select the USB to RS485 converter you attached to those two pins, and the slave ID must match the com address set in the RS485_1 settings on the inverter itself. That is a manual cross-check between two places, and it is the most common source of a silent failure.
For network, you enter the IP address and the port on which the Modbus TCP interface is available. The README gives specific pointers. The port is either 502 or 6607. When connecting to the inverter access point the host IP is typically 192.168.200.1 and the slave id is typically 0. When connecting to an SDongle the slave id is typically 1, and the SDongle should be given a fixed IP address.
Then there is the rule that the README puts in a note box of its own: Modbus devices only support one connection at a time, so nothing else may be trying to connect to the installation. If something else does, the connection from the integration is constantly interrupted. In a typical home setup the things that compete for that link are vendor monitoring software, another inverter management tool, or a second Home Assistant instance. Since the failure mode is a repeatedly dropped connection rather than a clear error, this is worth checking before you start debugging anything else.
The wiki page on connecting to the inverter holds the detailed wiring and network guidance the README defers to.
Installer credentials unlock the escalated mode, and that has consequences
Checking 'Advanced: the permissions escalation' during setup gives you access to optimizer data and the ability to change inverter and battery settings dynamically.
There is a step that follows, and it is the part to think carefully about. The README says that when the permissions escalation is combined with certain connection methods, most TCP connections but not serial connections, you will be asked for the credentials of the installer account in the next step. Those are the credentials used to connect to the inverter in the Device Commissioning section of the FusionSolar app. The default password is listed as either 00000a or 0000000a, and the README links to a password reset procedure at Huawei support if needed.
Two things follow from that. The first is that the integration is authenticating to the vendor system with the same account an installer uses, so the account's privileges are the privileges the integration gets. The second is that the reset note is reassuring in one specific way: resetting that password does not touch other parameters, such as the FusionSolar cloud connection or other changes made by the firm that installed the system.
Whether you want that is a decision about your installation rather than about the software. A read-only setup, with the optimizer data left out and no settings changes, needs no installer credentials and works over serial without them. A setup that caps export or forces battery charging needs write access, and write access on this hardware means the vendor's own maintenance account is exposed to Home Assistant. If your Home Assistant instance is reachable from outside your home network, that is a meaningful exposure and a reason to keep the integration on a local-only path.
The README also notes that some inverter firmware versions do not support all registers, which is the second reason the installer account may be needed: reading a value that the firmware does not expose can require the privileged path.
Firmware from 2023 is the real requirement, not the inverter model
The firmware requirement is stated under its own heading in the README, and it is short: the integration supports inverters running firmware versions released in 2023 and later. Older firmware versions do not have support for all registers, which can result in the integration failing to work properly.
That is the most important compatibility fact in the project, and it is a strange one to run into because it is about the age of the firmware rather than the age of the hardware. An older inverter that shipped with firmware from 2022 may be physically identical to one from 2024 and still be unsupported, because the register set changed.
The practical consequence is that you need to know the firmware version before you install, and that knowing it may involve updating the inverter first. If you skip that check, the failure is partial: some entities populate, others stay unavailable, and the symptom looks like a configuration problem rather than a firmware problem.
Everything else in the requirements list is about the transport. Modbus RTU over a serial adapter, or Modbus TCP over the network. The topics listed on the repository name both protocols explicitly, along with home-assistant, huawei, huawei-solar and solar-energy.
The project also supports inverters that have never been connected to the FusionSolar cloud, as long as they meet the firmware condition. That is the situation for most self-installed systems, and it means the integration is a local Modbus path rather than a cloud API wrapper. The README's mention of the FusionSolar app concerns only the installer account credentials used for the escalated mode.
Thirty second polling by default, and a YAML alternative for finer control
The integration polls the inverter for new values every 30 seconds. If you want fresh data more or less often, the README gives a specific path: disable the automatic refresh in the integration's system options, under 'Enable polling for updates', and build your own automations at the frequency you want.
The catch is stated immediately after. If your installation contains a power meter or a battery, you need a separate data polling automation for those devices. The reason is that the built-in coordinator polls everything together, so switching off automatic polling stops the battery and meter updates as well, and you have to re-create them by hand.
That is a bit of friction, and the example automations in the README show the shape. Each one is a time pattern trigger that calls `homeassistant.update_entity` against a specific entity:
- alias: "Huawei Solar inverter data polling"
trigger:
- platform: time_pattern
hours: "*"
minutes: "*"
seconds: "/20"
action:
- service: homeassistant.update_entity
target:
entity_id: sensor.inverter_daily_yieldThis is standard Home Assistant automation configuration, so the pattern generalises. One automation per device group, each with its own interval, targeting the specific entities in that group. The trade-off is real, though. Every manual automation becomes a place where an interval can be set too low, and a Modbus link polled every five seconds competes with everything else on the bus, which loops back to the single connection rule.
For most installations the default 30 second polling is the sensible choice and the automation route only makes sense when a specific entity needs to be fresher, such as production readings feeding a dashboard that people watch.
Installation through HACS, and where the setup flow asks for what
Installation has two paths, and the README gives both. Install the integration with HACS, the Home Assistant Community Store, or copy the contents of the repository into the `custom_components/huawei_solar` directory. The repository carries a `hacs.json` and is listed as a default HACS integration.
After that you restart Home Assistant and start the configuration flow, either from the provided badge link or by going to Configuration, then Integrations, clicking the `+ Add Integration` button and selecting `Huawei Solar` from the list.
The flow then asks you to choose the connection type, serial or network, and the rest depends on that choice. Serial asks you to pick the USB to RS485 converter device and to enter a slave ID that matches the com address in the inverter's RS485_1 settings. Network asks for the IP address, the port, and the slave id, with the port being either 502 or 6607.
The 'Advanced: the permissions escalation' checkbox sits on the network configuration screen, along with the note about which privileges it grants. As described earlier, choosing it may prompt for the installer account credentials on the following step for most TCP connections.
The wiki holds the longer documentation, and the README points to specific pages there: connecting to the inverter, changing active power control, force charge discharge battery, using DNS challenge aliases is not relevant here, but the first three are. The diagnostics support in the integration, with its `diagnostics.py` module, is what you would attach to a bug report when something does not come up.
AGPL terms, active releases, and what the licence means for your config
The licence is AGPL-3.0. That choice has a practical consequence for a Home Assistant integration that people commonly fork: the AGPL requires that modified versions offered over a network are made available under the same terms. For a custom integration, the more visible effect is on the translation and configuration files people copy between installations. Anyone who copies substantial parts of this code into their own integration and then serves it, or distributes it, is in AGPL territory rather than permissive territory, which is a different conversation from the MIT or Apache licences common in the Home Assistant ecosystem.
That is worth checking against your own obligations before you fork it, and the LICENSE file in the repository is the text that governs.
Maintenance is active. The last push was on 2026-10-10, and the release history shows 2.1.5 on 2026-09-09, 2.1.4 on 2026-09-05 and 2.1.3 on 2026-08-28. Patch releases a few days apart suggest a project responding to reported issues on a given inverter model or firmware combination, so upgrade notes in the release list are worth reading rather than skipping.
The repository also carries an AI_POLICY.md, which tells you the maintainer has a stated position on generated code contributions, and a `crowdin.yml` alongside the `translations/` directory, so the interface strings are translated through Crowdin and your locale may be covered by community translation rather than by the maintainer.
Editorial conclusion
huawei_solar suits a Home Assistant user with a Huawei Solar installation who wants inverter, battery, power meter and optimizer data on the dashboard and, if their inverter firmware is from 2023 or later, wants to control grid export and battery behaviour from automations. It is the wrong choice for an older inverter, since the README says pre-2023 firmware lacks support for all registers, and it is the wrong choice if anything else on your network polls the inverter, because Modbus devices allow only one connection at a time. Verify three things before you configure it: that your firmware version falls in the supported range, that your slave ID matches the com address set in the RS485_1 settings for a serial connection, and that the Modbus TCP port you enter is either 502 or 6607, with the slave id typically 0 for the inverter access point and 1 for an SDongle.
Frequently asked questions
How do I install the huawei_solar integration in Home Assistant?
Install it with HACS, the Home Assistant Community Store, or copy the repository contents into the `custom_components/huawei_solar` directory. Then restart Home Assistant and start the configuration flow from Configuration, Integrations, `+ Add Integration`, and select `Huawei Solar`.
Which Huawei Solar inverter firmware versions are supported?
The README states the integration supports inverters running firmware versions released in 2023 and later. Older firmware versions do not have support for all registers, which can result in the integration failing to work properly.
What port and slave ID do I use for a network connection to a Huawei inverter?
The Modbus TCP port is either 502 or 6607. Connecting to the inverter access point, the host IP is typically 192.168.200.1 and the slave id typically 0; connecting to an SDongle, the slave id is typically 1 and the device should be given a fixed IP.
Why does my huawei_solar connection keep dropping?
Modbus devices support only one connection at a time, so anything else polling the installation will constantly interrupt the integration. The README advises making sure nothing else is trying to connect to the Huawei solar installation.
What does the permission escalation option give me in the huawei_solar setup?
It gives you access to optimizer data and the ability to dynamically change inverter and battery settings. With most TCP connection methods it also prompts for the installer account credentials used in the Device Commissioning section of the FusionSolar app.
Can I control grid export and battery charging from Home Assistant?
Yes, once the escalated mode are enabled during setup. The integration exposes services for actively controlling the amount of electricity exported to the grid and for forcibly charging or discharging the battery.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/wlcrs-huawei-solar)Was this useful?