Skip to content

Latest commit

 

History

History
121 lines (79 loc) · 7.18 KB

README.md

File metadata and controls

121 lines (79 loc) · 7.18 KB

Huawei Solar Integration

hacs_badge GitHub release

This integration splits out the various values that are fetched from your Huawei Solar inverter into separate HomeAssistant sensors. These are properly configured to allow immediate integration into the HA Energy view.

sensors energy-config

Installation

  1. Install this integration with HACS, or copy the contents of this repository into the custom_components/huawei_solar directory

  2. Restart HA

  3. Start the configuration flow:

    • Start Config Flow
    • Or: Go to Configuration -> Integrations and click the + Add Integration. Select Huawei Solar from the list
  4. Enter the IP address of your inverter (192.168.200.1 if you are connected to its WiFi AP). The slave id is typically 0. You should only check the Advanced: enable parameter configuration checkbox if you intend to dynamically change your battery settings.

  1. When using the parameter configuration feature, you might be asked to enter the credentials to the installer account in a next step. These are the credentials used to connect to the inverter in the "Device Commissioning" section of the FusionSolar App.

What IP-address and port should I enter?

Starting from firmware updates released in December 2021, Huawei has closed the Modbus-TCP interface on the network to which the inverter connects. ie. If the inverter is connected to your home network on 192.168.1.11, it will no longer be possible to connect on that IP.

In this case, you must connect your Home Assistant device SUN2000-<inverter serial number> WiFi network, and use the Modbus-TCP interface available on 192.168.200.1. In most cases, the port has been moved to 6607 instead of 502.

How do I connect to the inverter WiFi

There are multiple possible approaches for this. We list the most simple ones here:

Using a WiFi USB Stick (or built-in WiFi)

The most straightforward approach is to use an USB WiFi stick, or use the built-in WiFi or your Home Assistant server (for instance: the WiFi functionality of your Raspberry Pi 4). This must be a dedicated WiFi device: it is not possible to connect the same WiFi interface to both your home network and the invertwer WiFi at the same time (*).

You can configure this device in Hass.io via Configuration -> Add-ons, Backups & Supervisor -> System -> Change (next to IP address) -> WLAN<x>.

(*) Some WiFi dongles might support multiple connections by separating it into multiple VLAN's. This is considered an advanced use-case, and is not covered in this README.

Use a dedicated WLAN Bridge

This approach is recommended when your Home Assistant server is positioned too far from the inverter to connect to it's WiFi. It requires a good understanding of IP routing and suitable hardware.

Some devices marketed as WLAN Repeaters can also be configured in 'client mode', which creates a bridge between your home netwerk and inverter WiFi.

For example: TP-link TL-WR802N: Configure the Router in Client Mode

After setting up your WLAN device in 'client mode', you need to add a static route on your home network router to 192.168.200.0/24 via that WLAN bridge. Otherwise the devices in your network won't know how to reach the inverter subnet.

Note: Not every home router allows you to add static routes. For example: the router provided by your ISP might not expose this advanced feature. You'll need to re-evalute your network setup in that case.

SDongle Configuration

If your inverter has an SDongle, you need to make sure that it is properly configured to access it via your home network. Use the 'Device Commissioning' function of the FusionSolar app to login on your inverter (default password for the 'installer' account is '00000a'). In Settings > Communication Configuration:

  • Set "Dongle Parameter Settings" → "Modbus TCP" → "Connection" to "Enabled (Unrestricted)"
  • Set "Parallel system communication parameter setting" → "Parallel communication mode" to "RS485"

Inverter polling frequency

The integration will poll the inverter for new values every 30 seconds. If you wish to receive fresh inverter data less (or more) frequently, you can disable the automatic refresh in the integration's system options (Enable polling for updates) and create your own automation with your desired polling frequency.

- alias: "Huawei Solar inverter data polling"
  trigger:
    - platform: time_pattern
      hours: "*"
      minutes: "*"
      seconds: "/10"
  action:
    - service: homeassistant.update_entity
      target:
        entity_id: sensor.daily_yield

FAQ - Troubleshooting

Q: Why do I get the error "Connection succeeded, but failed to read from inverter." while setting up this integration?

A: While the integration was able to setup the initial connection to the Huawei Inverter, it did not respond to any queries in time. This is either caused by using an invalid slave ID (typically 0 or 1, try both or ask your installer if unsure), or because an other device established a connection with the inverter, causing the integration to lose it's connection


Q: Will the FusionSolar App still work when using this integration?

A: The inverter will still send it's data to the Huawei cloud, and you will still be able to see live statistics from your installation in the FusionSolar App. However, if you (or your installer) need to use the 'Device commissioning' feature of the app, you will need to disable this integration. Only one of them can be connected to the inverter at any one time.


Q: I can't get this integration to work. What am I doing wrong?

A: First make sure that 'Modbus TCP' access is enabled in the settings of your inverter. Next, check if the port is correct. Some inverters use port 6607 instead of 502 (this can change for you after a firmware update!). If that doesn't work for you, and you intend to write an issue, make sure you have the relevant logs included. For this integration, you can enable all relevant logs by including the following lines in your configuration.yaml:

logger:
  logs:
    pymodbus: debug # only include this if you're having connectivity issues
    huawei_solar: debug
    homeassistant.components.huawei_solar: debug

By providing logs directly when creating the issue, you will likely get help much faster.