Integration Solar inverter huawei 2000L

So I went through something similar earlier this week, and this sounds like what I saw. Where the port would respond but no data.

You’ll want to have both the Inverter and the Dongle on the latest firmware, officially they want you on these versions.
image

Once you have those, you can then use the FusionSolar app to connect to the inverter’s installer Wifi (go into commissioning mode in the app and then scan the QR code on the side of the inverter). Then you can follow these images below to change the modbus settings to unrestricted.

image
2021-11-15 15_56_50-SDongleA-05 MODBUS TCP Guide.pdf - 2 -
2021-11-15 15_56_50-SDongleA-05 MODBUS TCP Guide.pdf - 3 -

Then after that you should get data again. I was on SPC22 an it was all working fine, but after moving to SPC123 on the dongle (and then 124) is when they seemed to have introduced this restricted setting and it defaults to being locked down again.

In my case…
Dongle at 124
Inverter at 139

I enabled the Modbus TCP like claymen said.
But the configuration is on Dongle parameter settings…

NOT IN THE MARKED ENTRY "Parallel system… "

(Claymen already change to the correct one. Thanks)

It starts ok… And HA Modbus configuration fine

BUT
sometimes I have wrong values… And lose the communication…

Ahh I knew I forgot to update something, was using the images from earlier in the thread as I’m not at home to check the inverter on my phone directly. I’ve updated the images now.

1 Like

Thanks for the tips, however, it seems like something is wrong. I was able to connect to both inverters but, firmware wise, I get as latest version my current one, V100R001C00SPC135. I don’t know if the system gets notifications when something new comes up or it has to be done manually.
About Modbus I went to the indicated path but I don’t have the Modbus-TCP option.


I also tried to connect to the Dongle (psw: Changeme) and it seems fine, however when I try to go inside it I get a notification “The device has been connected. Try again later” and I can’t proceed further…

A little update. The good news: I’ve got it working!

So, apparently the SlaveID of my HomeAssistant config was set to 2 instead of 1. After changing that, I got results in Home Assistant.

Second, I noticed that after some time I got readings from the qModBus application. But after restarting HomeAssistant, the qModBus application didn’t return data. In the log file, I got: ‘Slave threw exception → Bad file descriptor’.
This is also the case when the Slave ID is set correctly.

To summarize:

  • Be able to ping → if not, check connection
  • Be able to telnet to port 502 → if not, upgrade firmware of SmartDongle (check firmware versions on the SolarFusion website, because the app doesn’t support the Dongle)
  • Be able to get readings via ModBus TCP (or HomeAssistant) → if not, upgrade firmware of inverter
  • Get readings in HomeAssistant (or error ‘model_id’: asyncio timeout)-> if not, check SlaveID in your configuration. For me it was 1, but I read if you have more inverters it could be higher.

In all these cases it was not necessary for me to connect to the Dongle or Inverter directly.
Example qModBus settings (I use the Windows app):
TCP Port: 502
Modbus mode: TCP, Start Address: 30070, Slave ID: 1, Number of Coils: 1, Function code: 0x03, Format: Decimal. This should give a number

Good luck!

@Emilv2
I’m getting warning in new HA beta:

Dec 03 21:50:40 HA hass[9506]: 2021-12-03 21:50:40 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.daily_yield (<class 'custom_components.huawei_solar.sensor.HuaweiSolarDailyYieldSensor'>) implements device_state_attributes. Please report it to the custom component author.
Dec 03 21:50:40 HA hass[9506]: 2021-12-03 21:50:40 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.total_yield (<class 'custom_components.huawei_solar.sensor.HuaweiSolarTotalYieldSensor'>) implements device_state_attributes. Please report it to the custom component author.
Dec 03 21:50:47 HA hass[9506]: 2021-12-03 21:50:47 WARNING (MainThread) [homeassistant.helpers.entity] Entity sensor.sun2000_8ktl_m0 (<class 'custom_components.huawei_solar.sensor.HuaweiSolarSensor'>) implements device_state_attributes. Please report it to the custom component author.

but i think everything is working correctly.

Do you have access to the installer account on the cloud service? If I use the app on my phone, I don’t get offered the latest version. From memory it showed only 133 or 135. But if I use the installer side on Fusion Solar cloud, I can select from a range of versions.

Nope, any clue about how to do that?

I have trouble again to get my inverter into Home assistant …after upgrade
cant find where to fix the error below

 Logger: homeassistant.helpers.template
Source: helpers/template.py:1254
First occurred: 3:01:42 PM (8 occurrences)
Last logged: 3:01:42 PM

    Template warning: 'float' got invalid input 'None' when rendering template '{% if state_attr('sensor.sun2000_15ktl_m0', 'efficiency')|float < 100 %} {{ state_attr('sensor.sun2000_15ktl_m0', 'efficiency') }} {% else %} 0 {% endif %}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1
    Template warning: 'float' got invalid input 'unknown' when rendering template '{{ '%0.2f' | format(states('sensor.total_yield') | float - states('sensor.m_grid_exporterd_energy') | float + states('sensor.m_grid_accumulated_energy') | float) }}' but no default was specified. Currently 'float' will return '0', however this template will fail to render in Home Assistant core 2022.1

try change float to float(0)

okey will try that …

would be nice if all the entities would get into home assistant automaticly so when something changed you dont need to start all over again.

and they where seperate entities

Ok so now I have it working, I changed slave to ‘0’

But I only have three entities- total_yield, daily_yield and generation in watts, which I’m most interested in as it’s real time.

I would also like - current grid usage, current grid export, daily and totals of that too … is this possible? (I have the smart meter and can see all this on the app, but there is a delay and would like to see the live numbers immediately at a glance for generation, power consumption, power exported).

This data is in attribute of entity with generation value.

How come it’s not showing up when I try to make a card for the dashboard? Or when I go to select an entity value for the ‘energy’ configuration for ‘consumption’ and ‘return to the grid’ - there’s nothing there!!

I tried adding this block of code after the normal ‘sensor: -platform:huawei_solar host:192.168.200.1’ in configuration.yaml but got “expected , but found ‘’” for the code starting with ‘-platform: template’

help! this looks perfect because I have a smart meter and want to read the energy consumption etc as well as the generation, and also put it in the energy for HA

Read some of my posts further up, you need to create template sensors from the attributes of the main entity

ok I got all that working, wahoo!

last thing I want is the actual power im using which isnt an attribute by default for some reason? can anyone tell me whats wrong with this syntax:

value_template: "{{ state_attr('sensor.sun2000', 'power_meter_active_power') | float) - ( states('sensor.sun2000') | float) }}"
{{ state_attr('sensor.sun2000', 'power_meter_active_power') | float(0) - states('sensor.sun2000') | float(0) }}

for some reason this broke everything :confused:
allowd me to restart as valid config but broke all the attribute values…

Invalid config for [template]: invalid slug power_meter_Load (try power_meter_load) for dictionary value @ data['sensors']. Got OrderedDict([('pv_01_voltage', OrderedDict([('friendly_name', 'pv_string_01_voltage'), ('unit_of_measurement', 'V'), ('icon_template', 'mdi:flash-alert-outline'), ('value_template', "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_01_voltage') }}")])), ('pv_02_voltage', OrderedDict([('friendly_name', 'pv_string_02_voltage'), ('unit_of_measurement', 'V'), ('icon_template', 'mdi:flash-alert-outline'), ('value_template', "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_s.... (See /config/configuration.yaml, line 23).

As I don’t see you config I can’t help you, but earlier you used

states('sensor.sun2000')

Now in your template I see

state_attr('sensor.sun2000_5ktl_l1_hv2150011134'

I can share my current template config, maybe it will help somebody.
In configuration.yaml I have:

template: !include template.yaml

In template.yaml

  sensor:
    - name: "String 1 napięcie"
      unique_id: pv_01_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_voltage') | float(0) }}"

    - name: "String 2 napięcie"
      unique_id: pv_02_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_02_voltage') | float(0) }}"

    - name: "String 1 natężenie"
      unique_id: pv_01_current
      unit_of_measurement: 'A'
      icon: mdi:current-dc
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_current') | float(0) }}"

    - name: "String 2 natężenie"
      unique_id: pv_02_current
      unit_of_measurement: 'A'
      icon: mdi:current-dc
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_02_current') | float(0) }}"

    - name: "Faza 1 V (f)"
      unique_id: phase_a_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0', 'phase_A_voltage') | float(0) > 180 and state_attr('sensor.sun2000_8ktl_m0', 'phase_A_voltage')|float(0) < 264 %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'phase_A_voltage') }}
        {% else %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'grid_A_voltage') }}
        {% endif %}

    - name: "Faza 2 V (f)"
      unique_id: phase_b_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0', 'phase_B_voltage') | float(0) > 180 and state_attr('sensor.sun2000_8ktl_m0', 'phase_B_voltage')|float(0) < 264 %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'phase_B_voltage') }}
        {% else %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'grid_B_voltage') }}
        {% endif %}

    - name: "Faza 3 V (f)"
      unique_id: phase_c_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0', 'phase_C_voltage') | float(0) > 180 and state_attr('sensor.sun2000_8ktl_m0', 'phase_C_voltage')|float(0) < 264 %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'phase_C_voltage') }}
        {% else %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'grid_C_voltage') }}
        {% endif %}

    - name: "Faza 1 V (m)"
      unique_id: m_grid_a_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'grid_A_voltage') | float(0) }}"

    - name: "Faza 2 V (m)"
      unique_id: m_grid_b_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'grid_B_voltage') | float(0) }}"

    - name: "Faza 3 V (m)"
      unique_id: m_grid_c_voltage
      unit_of_measurement: 'V'
      icon: mdi:flash-alert-outline
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'grid_C_voltage') | float(0) }}" 

    - name: "Faza 1 A (f)"
      unique_id: phase_a_current
      unit_of_measurement: 'A'
      icon: mdi:current-ac
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'phase_A_current') | float(0) }}"

    - name: "Faza 2 A (f)"
      unique_id: phase_b_current
      unit_of_measurement: 'A'
      icon: mdi:current-ac
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'phase_B_current') | float(0) }}"

    - name: "Faza 3 A (f)"
      unique_id: phase_c_current
      unit_of_measurement: 'A'
      icon: mdi:current-ac
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'phase_C_current') | float(0) }}"

    - name: "Produkcja DC"
      unique_id: pv_input_power
      unit_of_measurement: 'W'
      icon: mdi:solar-power
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'input_power') | float(0) }}"

    - name: "Zużycie prądu"
      unique_id: power_meter_active_power
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'power_meter_active_power') | float(0) }}"
 
    - name: "Zużycie A"
      unique_id: active_grid_a_power
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'active_grid_A_power') | float(0) }}"
 
    - name: "Zużycie B"
      unique_id: active_grid_b_power
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'active_grid_B_power') | float(0) }}"
 
    - name: "Zużycie C"
      unique_id: active_grid_c_power
      unit_of_measurement: 'W'
      icon: mdi:transmission-tower
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'active_grid_C_power') | float(0) }}"
 
    - name: "Prąd oddany do sieci"
      unique_id: m_grid_exporterd_energy
      unit_of_measurement: 'kWh'
      icon: mdi:transmission-tower
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) > 0  %}
        {{ state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) }}
        {% endif %}                    
      device_class: energy
      state_class: total_increasing
      
    - name: "Prąd pobrany z sieci"
      unique_id: m_grid_accumulated_energy
      unit_of_measurement: 'kWh'
      icon: mdi:transmission-tower
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0','grid_accumulated_energy') | float(0) > 0  %}
        {{ state_attr('sensor.sun2000_8ktl_m0', 'grid_accumulated_energy') | float(0) }}
        {% endif %}                    
      device_class: energy
      state_class: total_increasing

    - name: "Temperatura falownika"
      unique_id: pv_temperatura
      unit_of_measurement: '°C'
      state: "{{ state_attr('sensor.sun2000_8ktl_m0', 'internal_temperature') | float(0) }}"   

    - name: "Efetywność Falownika"
      unique_id: pv_efficiency
      unit_of_measurement: '%'
      state: >
        {% if state_attr('sensor.sun2000_8ktl_m0', 'efficiency') | float(0) < 100 %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'efficiency') }}
        {% else %}
          0
        {% endif %}

    - name: "Zużycie prądu dom"
      unique_id: energy_used
      unit_of_measurement: 'kWh'
      state: >
        {% if states('sensor.total_yield') | float(0) > 0 and state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) > 0 and state_attr('sensor.sun2000_8ktl_m0','grid_accumulated_energy') | float(0) > 0 %}
        {{ '%0.2f' | format(states('sensor.total_yield') | float(0) - 
                            state_attr('sensor.sun2000_8ktl_m0','grid_exported_energy') | float(0) + 
                            state_attr('sensor.sun2000_8ktl_m0','grid_accumulated_energy') | float(0)) }}
        {% endif %}                    
      device_class: energy
      state_class: total_increasing