Integration Solar inverter huawei 2000L

Ciao Carlo

I ask you for a kindness …

You could post your .Yaml code in full (obviously only for the sensors part) and related card code …

  • The data you use are those of EmilV2
  • your card uses lovelace.

I’m trying to make it work but I’m sure the conversion of the data is wrong given the absurd values it proposes to me …

A thousand thanks.

1 Like

As @dd77 mentioned here is his code to be pasted in configuration.yaml

template:
  - sensors:
      template_grid_feed_in:
      friendly_name: "Solar 2 Grid"
      unit_of_measurement: 'W'
      device_class: power
      value_template: >
        {% if states('sensor.grid_active_power') | int > 0 %}
          {{ states('sensor.grid_active_power') }}
        {% else -%}
          0
        {% endif %}
    
      # sensor used to show power flow from Panels to Grid and doesn't allow it to show a negative number only positive numbers
      template_grid_consumption:
      friendly_name: "Grid 2 House"
      unit_of_measurement: 'W'
      device_class: power
      value_template: >
        {% if states('sensor.grid_active_power') | int > 0 %}
          0
        {% else -%}
          {{ (states('sensor.grid_active_power') | int) | abs }} 
        {% endif %} 
      
      # shows the solar power being fed to the house and doesn't allow it to show a negative number only positive numbers    
      template_curent_solar_consumption:
      friendly_name: 'Solar 2 House'
      unit_of_measurement: 'W'        
      device_class: power
      value_template: >-
        {% if states('sensor.template_grid_consumption') | float > 0 %}
          {{ states('sensor.active_power') }}
        {% else -%}
          {{ (states('sensor.active_power')| float - states('sensor.template_grid_feed_in')| float) }}
        {% endif %}


utility_meter:
  grid_import_solar_daily_energy:
    source: sensor.grid_consumption
    cycle: daily
  grid_export_solar_daily_energy:
    source: sensor.grid_exported
    cycle: daily

and for lovelace card

type: custom:tesla-style-solar-power-card
name: 'Power Flow '
threshold_in_k: 4
hide_inactive_lines: 0
show_gap: true
change_house_bubble_color_with_flow: 1
grid_to_house_entity: sensor.template_grid_consumption
generation_to_grid_entity: sensor.template_grid_feed_in
generation_to_house_entity: sensor.template_curent_solar_consumption
house_entity: sensor.house_consumption_daily
generation_entity: sensor.daily_yield
grid_entity: sensor.grid_import_solar_daily_energy
house_extra_entity: sensor.grid_import_solar_daily_energy
generation_extra_entity: sensor.daily_yield
grid_extra_entity: sensor.grid_export_solar_daily_energy

it will produce this graph
image

Thank you so much yousaf465

now I try it, I wanted to ask you missing the part for the battery ? I don’t seem to see it in the script

Many thanks again …

Hi!
Fyi.
The latest home assistant update finally includes a simple tool to adjust or correct data stored under “Statistic”. In our case for example it helps and make easier to adjust this exporadic issue related to spurius error measured data by grid sensor when a home grid outage/shutdown has taken place.

## Adjusting long-term statistics

3 Likes

Have the same error. What did you do to get rid of this error?

duplicated mapping key at line 34, column 7:
friendly_name: “Grid 2 House”

Which code you copied?
Copy the last code in this post Integration Solar inverter huawei 2000L - #1620 by yousaf465

That’s indeed the one i’ve copied. So what’s wrong with it?

This is my configuration file and the error i get


This is most likely an indentation error.
I am no expert in yaml, but I would advise using VS-code to edit the configuration.yaml file. https://code.visualstudio.com/.

it will detect many errors and avoid this mess.

here is my configration.yaml code



Like you can see , configuration file is now ok.
But i can’t make the card work. Who can help me out?

access HA from SSH, check configuration using the following command. it seems sensors haven’t been created yet.

ha core check

Hello yousaf465

It also gives me some problems with the sensors …, could you kindly still enter your code ayyually in use “.Yaml” there are inconsistencies with the names of the sensors

It’s not my code, it is @dd77’s code as mentioned in the above post. Integration Solar inverter huawei 2000L - #1608 by dd77

Friends help …

I tried it, but I just can’t get this card to work properly …
The values are not correct, the energy flows are not correct … I struggle to understand

I renew the question, there is someone who is kindly willing to post their own code (card + configuration.yaml) at least to have a starting point with the correct sensors (those used are from EmilV2), I have always been trying for 2 days with negative results and surely the English language does not help me …

sensor:
  - platform: template
    sensors:
      template_grid_feed_in:
        friendly_name: "Solar 2 Grid"
        unit_of_measurement: "W"
        device_class: power
        value_template: >
          {% if states('sensor.grid_active_power') | int > 0 %}
            {{ states('sensor.grid_active_power') }}
          {% else -%}
            0
          {% endif %}

      # sensor used to show power flow from Panels to Grid and doesn't allow it to show a negative number only positive numbers
      template_grid_consumption:
        friendly_name: "Grid 2 House"
        unit_of_measurement: "W"
        device_class: power
        value_template: >
          {% if states('sensor.grid_active_power') | int > 0 %}
            0
          {% else -%}
            {{ (states('sensor.grid_active_power') | int) | abs }} 
          {% endif %}

      # shows the solar power being fed to the house and doesn't allow it to show a negative number only positive numbers
      template_curent_solar_consumption:
        friendly_name: "Solar 2 House"
        unit_of_measurement: "W"
        device_class: power
        value_template: >-
          {% if states('sensor.template_grid_consumption') | float > 0 %}
            {{ states('sensor.active_power') }}
          {% else -%}
            {{ (states('sensor.active_power')| float - states('sensor.template_grid_feed_in')| float) }}
          {% endif %}

this is the correct indentation, you will need to check in the dev. tools that you actually have the correct values in those sensors after restarting.

I also had similar problem with Emilv2 integration but in my situation I lose connection after upgrade my inverter to 141 firmware. When i downgrade to ver. 136 integration start to work although home assistant is 2022.4.5

Hello,

It seems they have released a new firmware version for SUN2000L inverters, V200R001C00SPC119.
The one I’m using now is V200R001C00SPC117 and it’s working nicely with the internal Wifi and a WiFi Bridge, and I was wondering if anybody has tried with version 119.

I’m not too confident to update as I’m concerned that they will definitely close TCP modbus over internal WiFi at some point. I’ve seen a moderator write this in a Huawei forum post:

The SUN2000L1 supports data read and write only when the FusionSolar app is directly connected to the inverter at the local end. Modbus TCP connections to devices except FusionSolar will not be supported in the future.
Also, if a customer needs to use a third-party device, use Modbus TCP to connect to the device. Currently, only Dongle supports this function and must comply with the Modbus TCP protocol provided by Dongle.

1 Like

I did the upgrade to the new 119 firmware and can attest that the integration still works as good as spc117.

The integration communicates in exactly the same way as the “device commissioning” part of the FusionSolar app. I even reverse-engineered the login and subsequent heartbeat methods. I think it would be very impractical for Huawei to change this interface in such a way that the integration would completely break.

2 Likes

Using Hass in a docker (Synonlogy) connected via eth0. How can I connect the inverter local AP over wlan. My NAS is to far away from the Inverter AP for direct bridge. The inverter got Wlan/lan access but not direct NAS<->Inverter AP.

Can i adjust the sizes off the bubbles? Because now it’s all overlapping and not ok. Thanks