Skip to content

Connecting to daisy chained inverters

Roving Ronin edited this page Feb 16, 2024 · 17 revisions

If you have more than 1 SUN2000 inverter in your installation, these will normally be daisy-chained together via the RS485A1 and RS485B1 pins of the COM-port of each slave inverter to the RS485A2 and RS485B2 pins of the master inverter.

You can query the Modbus registers of each slave inverter through a connection to the master inverter via either:

  • the Modbus TCP connection provided by the SDongleA attached to your master inverter (if any)
  • the Modbus RTU connection provided by your master inverter via its RS485A1 and RS485B1 pins on the COM-port (not verified in practice)

Other options (like the Modbus TCP connection available when connecting to the SUN2000-xxxxxxxxx AP of the master inverter) do not allow to query slave inverters.

Manual Excerpt multiple inverters

Note that the operation of the slave inverters does not influence the values being output by the master inverter. You need to add each inverter in the integration to get a complete overview of your installation.

Finding the correct Slave-ID's to use

The slave ID's must be provided as a comma separated list. Always start with the slave-id of the master inverter. For instance: if you have 3 inverters with slave-id's 1, 2 and 6 - the latter being the slave-id of the master inverter - then the correct value to enter is 6,1,2.

Ask your installer which slave-id's he configured for each of the inverters, and enter them as a comma-separated list in the Slave IDs field when installing the integration.

You can also retrieve the slave-id of each device as follows:

  • Connect to the WiFi-network (SUN2000-xxxxxxxx) of each inverter.
  • Use the "Device Commissioning" part of the FusionSolar App to login directly on the inverter
  • Navigate to the RS485_1 page to find the slave id as the 'COM Address':

Screenshot_20220329-222702_SUN2000

Combining multiple inverter values

Once you have the installation setup you might want to get combined values for all of the inverters creation / consumption. An example to support 3 inverters and batteries below is by adding the below to configuration.yaml ensuring sensor is not duplicated.

template:

#############################
#   
#   WLCRS - Huawei Solar Integrattion - Combine multiple inverter values
#   See: https://github.com/wlcrs/huawei_solar/wiki/Connecting-to-daisy-chained-inverters
#
#   If your HA instance has a /config/packages directory configured, this may be deployed by saving this text into a file
#   in that location. i.e.   /config/packages/huawei_derived_sensors.yaml
#

  - sensor:
    - name: "Inverters Input Power"
      unique_id: inverter_input_power_combined
      unit_of_measurement: "W"
      device_class: "power"
      state_class: measurement
      state: "{{ (states('sensor.inverter_input_power') | float) + (states('sensor.inverter_input_power_2') | float) + (states('sensor.inverter_input_power_3') | float)}}"
      availability: >-
        {{ (states('sensor.inverter_input_power')|is_number)
            and (states('sensor.inverter_input_power_2')|is_number)
              and (states('sensor.inverter_input_power_3')|is_number) }}


  - sensor:
    - name: "Batteries State of Capacity"
      unique_id: batteries_state_of_capacity
      unit_of_measurement: "%"
      device_class: "battery"
      state_class: measurement
      state: "{{ (((states('sensor.battery_state_of_capacity') | float) + (states('sensor.battery_state_of_capacity_2') | float) + (states('sensor.battery_state_of_capacity_3') | float))/3) | round(2)}}"
      availability: >-
        {{ (states('sensor.battery_state_of_capacity')|is_number)
            and (states('sensor.battery_state_of_capacity_2')|is_number) 
              and (states('sensor.battery_state_of_capacity_3')|is_number) }}


  - sensor:
    - name: "Batteries Charge Discharge Power"
      unique_id: batteries_charge_discharge_power
      unit_of_measurement: "W"
      device_class: "power"
      state_class: measurement
      state: "{{ (states('sensor.battery_charge_discharge_power') | float) + (states('sensor.battery_charge_discharge_power_2') | float) + (states('sensor.battery_charge_discharge_power_3') | float)}}"
       availability: >-
         {{ (states('sensor.battery_charge_discharge_power')|is_number)
             and (states('sensor.battery_charge_discharge_power_2')|is_number) 
               and (states('sensor.battery_charge_discharge_power_3')|is_number) }}


  - sensor:
    - name: "Inverters Total Daily Yield"
      unique_id: inverters_total_daily_yield
      unit_of_measurement: "kWh"
      device_class: "energy"
      state_class: total_increasing
      state: "{{ (states('sensor.inverter_daily_yield') | float) + (states('sensor.inverter_daily_yield_2') | float) + (states('sensor.inverter_daily_yield_3') | float)}}"
      availability: >-
        {{ (states('sensor.inverter_daily_yield')|is_number)
            and (states('sensor.inverter_daily_yield_2')|is_number) 
              and (states('sensor.inverter_daily_yield_3')|is_number) }}


  # Shows the combined current Active Power of all inverters, in Watts
  - sensor:
    - name: "Inverters Active Power"
      unique_id: inverters_active_power
      unit_of_measurement: "W"
      device_class: "power"
      state_class: measurement
      state: "{{ (states('sensor.inverter_active_power') | float) + (states('sensor.inverter_active_power_2') | float) + (states('sensor.inverter_active_power_3') | float)}}"
      availability: >-
        {{ (states('sensor.inverter_active_power')|is_number)
            and (states('sensor.inverter_active_power_2')|is_number) 
              and (states('sensor.inverter_active_power_3')|is_number) }}

  # Shows the calculated current load, in Watts
  - sensor:
    - name: "House Consumption Power"
      unique_id: house_consumption_power
      unit_of_measurement: "W"
      icon: mdi:solar-power
      device_class: "power"
      state_class: measurement
      state: >-
        {% set inv_active_power = states('sensor.inverters_active_power')|float(0) %}
        {% set pm_active_power = states('sensor.power_meter_active_power')|float(0) %}
        {{ (inv_active_power - pm_active_power)|float(0)|round(0) }}
      availability: >-
        {{ (states('sensor.inverters_active_power')|is_number)
            and (states('sensor.power_meter_active_power')|is_number) }}