Integration Solar inverter huawei 2000L

So, seems like my odyssey is still far away to be solved. Today I found my Dongle updated to version 124 and this blocked communication with HA integration. I checked port 502 and it appears closed and I don’t have any option in FusionSolar to open it.

Good afternoon

I am configuring my Huawei SUN2000-5KTL-L1 inverter with the Modbus module integrated in Home Assisant. So far so good, although I am putting more records from the datasheet.

I have a question about the registration with address 32066 with title Power grid voltage / Line voltage between phases A and B. It tells me that "When the output mode is L / N, L1 / L2 / N, or L1 / L2, Power grid voltage is used ". The question is, that in my case, would the first option be (Power grid voltage) instead of the second (Line voltage between phases A and B) since I BELIEVE my inverter is single phase so my mode is L / N?

Also, would the Line voltage between phases B and C and Line voltage between phases C and B registers not be valid?

In the same way, since my measurement equipment is single phase (single phase ddsu666-h). Therefore, the signals A, B, C phase voltage and A, B, C phase current and A-B line voltage, B-C line
voltage, AC line voltage and A, B, C phase active power, won’t they serve me either?

Thank you

I have found using the developer tools for template that state_attr(‘sensor.SUN2000-5KTL-L1_HV2150011134’, ‘power_meter_active_power’)|float = 0

which it should be -1400w. So I think thats why its breaking, not sure why it isnt working because it does on the dashboards…

Perfect, thanks!

Hi guys,
Today I upgraded my FE-Dongle from V100R001C00SPC122 to new firmware V100R001C00SPC124.
After the upgrade the TCP ModBus port (502) was CLOSED.

PORT    STATE  SERVICE
502/tcp closed mbap

It was not working at all - disabled, connection refused !!!
Note: I am using LAN cable (not wifi)

I had to downgrade to V100R001C00SPC123 and now it is working back again!
So - be careful with this.
Why huawei had disabled this feature ?!

Is was already written about it in this topic. It is only disabled connection in spc124. You can enable it in setting if you also have newest firmware in inverter.

Rafał @ligeza,
Big thanks for this (I was searching this thread for the whole version string and now i know why I did not find it :wink: )
Can I ask you what version you have in you inverter and dongle? Did you enabled this exactly as mentioned in the post you referenced?

I am asking because according to the huawei’s note:

Firmware2: SUN2000MA V100R001C00SPC139 is released for the SUN2000M1/M2 series inverters.

The V100R001C00SPC139 is for SUN2000MA but I have SUN2000-6KTL-M0 - so it is M0, not M1/M2 series…
I have a plenty of firmware versions available from fusionsolar (not only compatible/available for my inverter) which is very misleading…

I have spc136 in inverter and spc123 in dongle. I don’t upgrade because I don’t need to (everything is working perfectly for me).
I checked release notes and I see SUN2000-6KTL-M0 in the list.

When I try to check it myself it always end up with a login page saying “Sign In with Uniportal ID” :frowning:
You have an account there?

Yes, you can add your device (by serial number) to you account and you will have access to some files. But the firmware files are old on their website.

Thanks heaps, the power consumption is working now.

But where do I put the fields device_class: energy
state_class: total_increasing
??

Do I put it in configuration.yaml? Under “- template:” or “-platform” … not sure whre to put that code block starting with ‘name’?

From HA template example:

template:
  - sensor:
      - name: "Transmission Down Speed"
        unit_of_measurement: "kB/s"
        state: "{{ states('sensor.transmission_down_speed')|float * 1024 }}"

      - name: "Transmission Up Speed"
        unit_of_measurement: "kB/s"
        state: "{{ states('sensor.transmission_up_speed')|float * 1024 }}"

When I add “state_class: total_increasing” to those sensors templates it breaks it…

Are you using newest HA? Are the templates in new format:

template:
  - sensor:

No it’s the

Template:
Sensors:
Power_exported:
Value_template: {{ states(‘sun’) }}

But if I add-

Device_class: energy
State_class: total_increasing

It doesn’t work :confused:

could you post your config (part with this template sensors, maybe there is some text formatting problem) in preformated text

#Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

#Text to speech
tts:

  • platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

#Solar
sensor:

  • platform: huawei_solar
    host: ‘192.168.200.1’
    optimizers: false
    battery: false
    slave: 0

name: “test_gridxchange”
unique_id: m_grid_exporterd_energy
unit_of_measurement: ‘kWh’
icon: mdi:transmission-tower
state: >
{% if state_attr(‘sensor.sun2000_5ktl_l1_hv2150011134’,‘grid_exported_energy’) | float(0) > 0 %}
{{ state_attr(‘sensor.sun2000_5ktl_l1_hv2150011134’,‘grid_exported_energy’) | float(0) }}
{% endif %}
device_class: energy
state_class: total_increasing

template:

- platform: template

sensors:
pv_01_voltage:
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:
  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_string_02_voltage') }}"

pv_01_current:
  friendly_name: "pv_string_01_current"
  unit_of_measurement: 'A'
  icon_template: mdi:current-dc
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_01_current') }}"

pv_02_current:
  friendly_name: "pv_string_02_current"
  unit_of_measurement: 'A'
  icon_template: mdi:current-dc
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'pv_string_02_current') }}"

phase_a_voltage:
  friendly_name: "phase_A_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_A_voltage') }}"

phase_b_voltage:
  friendly_name: "phase_B_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_B_voltage') }}"

phase_c_voltage:
  friendly_name: "phase_C_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_C_voltage') }}"

m_grid_a_voltage:
  friendly_name: "grid_A_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_A_voltage') }}"

m_grid_b_voltage:
  friendly_name: "grid_B_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_B_voltage') }}"

m_grid_c_voltage:
  friendly_name: "grid_C_voltage"
  unit_of_measurement: 'V'
  icon_template: mdi:flash-alert-outline
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_C_voltage') }}" 

phase_a_current:
  friendly_name: "phase_A_current"
  unit_of_measurement: 'A'
  icon_template: mdi:current-ac
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_A_current') }}"

phase_b_current:
  friendly_name: "phase_B_current"
  unit_of_measurement: 'A'
  icon_template: mdi:current-ac
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_B_current') }}"

phase_c_current:
  friendly_name: "phase_C_current"
  unit_of_measurement: 'A'
  icon_template: mdi:current-ac
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'phase_C_current') }}"

pv_input_power:
  friendly_name: "input_power"
  unit_of_measurement: 'W'
  icon_template: mdi:solar-power
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'input_power') }}"

power_meter_active_power:
  friendly_name: "power_meter_active_power"
  unit_of_measurement: 'W'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') }}"



power_meter_load:
  friendly_name: "consumption"
  unit_of_measurement: 'W'
  icon_template: mdi:flash-alert-outline
  value_template: "{{  states('sensor.sun2000_5ktl_l1_hv2150011134') |float(0) - state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') |float(0) }}"
  device_class: energy
  state_class: total_increasing

power_generated:
  friendly_name: "generation"
  unit_of_measurement: 'W'
  icon_template: mdi:solar-power
  value_template: "{{ states('sensor.sun2000_5ktl_l1_hv2150011134') }}"
  device_class: energy
  state_class: total_increasing


power_shipped:
  friendly_name: "shipped"
  unit_of_measurement: 'W'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'power_meter_active_power') }}"
  device_class: energy
  state_class: total_increasing



active_grid_a_power:
  friendly_name: "active_grid_A_power"
  unit_of_measurement: 'W'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_A_power') }}"

active_grid_b_power:
  friendly_name: "active_grid_B_power"
  unit_of_measurement: 'W'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_B_power') }}"

active_grid_c_power:
  friendly_name: "active_grid_C_power"
  unit_of_measurement: 'W'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'active_grid_C_power') }}"

m_grid_exported_energy:
  friendly_name: "grid_exported_energy"
  unit_of_measurement: 'kWh'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_exported_energy') }}"

m_grid_accumulated_energy:
  friendly_name: "grid_accumulated_energy"
  unit_of_measurement: 'kWh'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'grid_accumulated_energy') }}"

daily_yield:
  friendly_name: "daily_yield"
  unit_of_measurement: 'kWh'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'daily_yield') }}"

total_yield:
  friendly_name: "total_yield"
  unit_of_measurement: 'kWh'
  icon_template: mdi:transmission-tower
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'total_yield') }}"

pv_temperatura:
  friendly_name: "internal_temperature"
  unit_of_measurement: '°C'
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'internal_temperature') }}"   

inverter_device_status:
  friendly_name: "inverter_device_status"
  #unit_of_measurement: '°C'
  value_template: "{{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'device_status') }}"   

pv_efficiency:
  friendly_name: "pv efficiency"
  unit_of_measurement: '%'
  value_template: >
    {% if state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'efficiency')|float < 100 %}
      {{ state_attr('sensor.sun2000_5ktl_l1_hv2150011134', 'efficiency') }}
    {% else %}
      0
    {% endif %}

energy_used:
  friendly_name: "energy_used"
  unit_of_measurement: 'kWh'
  value_template: >
    {{ '%0.2f' | format(states('sensor.total_yield') | float - 
                        states('sensor.m_grid_exporterd_energy') | float + 
                        states('sensor.m_grid_accumulated_energy') | float) }}

You are using " Legacy sensor configuration format" so it will not work. In this configuration you can add this in customization entity menu or

sensor.sun2000_5ktl_l1_hv2150011134:
device_class: energy
state_class: measurement

sensor.power_meter_load:
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing

sensor.power_generated:
state_class: measurement
device_class: power

sensor.power_shipped:
state_class: measurement
device_class: power

this doesnt get it to show up in configuration>energy