Integration Solar inverter huawei 2000L

found the error for daily yield. Fixed.
I had fixed the value of daily yield in sensor customization at 15.6KWh. Now it is free floating. :man_facepalming:

Hello…
I have direct Modbus connection with land cable
The connection seems to be very stable.
And I gave full functionality with sensors… And energy too (no battery)

But… Sometimes… Without any regularity…
It shows unavailable…
And I can’t understand why…

My HA log has this error…
Can anyone understand it?
And help me to solve it?
Regards…

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:250
Integration: Modbus (documentation, issues)
First occurred: 23 de setembro de 2021 23:57:54 (15 occurrences)
Last logged: 21:20:03

Pymodbus: Solar: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)
Pymodbus: Solar: Exception Response(131, 3, SlaveFailure)

my modbus code

modbus:
  - name: Solar
    type: tcp
    close_comm_on_error: false
    host: 192.168.1.76
    port: 502
    delay: 2
    timeout: 15
    sensors:
      - name: Solar SunPower
        slave: 1
        address: 32080
        unit_of_measurement: W
        data_type: int32
        count: 2
        scale: 1
        precision: 0
        scan_interval: 1
      - name: Solar GridPower
        slave: 1
        address: 37113
        unit_of_measurement: W
        data_type: int32
        count: 2
        scale: 1
        precision: 0
        scan_interval: 1
      - name: Solar Inversor Temperatura
        slave: 1
        address: 32087
        unit_of_measurement: ºC
        data_type: int
        count: 1
        scale: 0.1
        precision: 0
        scan_interval: 60
      - name: Solar Produção do Dia
        slave: 1
        address: 32114
        unit_of_measurement: kWh
        data_type: uint32
        count: 2
        scale: 0.01
        precision: 2
        scan_interval: 60
      - name: Solar Produção Total
        slave: 1
        address: 32106
        unit_of_measurement: kWh
        data_type: uint32
        count: 2
        scale: 0.01
        precision: 2
        scan_interval: 120
      - name: Solar Grid_OUT Total
        slave: 1
        address: 37119
        unit_of_measurement: kWh
        data_type: int32
        count: 2
        scale: 0.01
        precision: 2
        scan_interval: 120
      - name: Solar Grid_IN Total
        slave: 1
        address: 37121
        unit_of_measurement: kWh
        data_type: uint32
        count: 2
        scale: 0.01
        precision: 2
        scan_interval: 120

Hi guys,
I am new here, Have been playing around with this super awesome integration for a couple day.
May i ask how can i create a sensor for inverter startup and shutdown time with the full format like
Inverter startup time: “2021-09-26T23:16:02+00:00” and add +7hour due to GMT+7 time to
“2021-09-27T06:16:02+00:00” and sorry for my bad English.
P.S. Thanks a lot for you guys hard work! It’s pretty amazing what has been done so far!

if you change state class to

state_class: total_increasing
in /config/customize.yaml file it will be fixed. this is for 2021.9.x and above.

here is my customize.yaml file

sensor.sun2000_10ktl_m1:
  device_class: energy
  state_class: measurement
sensor.pv_daily_yield:
  unit_of_measurement: kWh
  device_class: energy
  state_class: total_increasing
sensor.pv_active_power:
  state_class: measurement
  device_class: power
  last_reset: '1970-01-01T00:00:00+00:00'
sensor.grid_exported_energy:
  device_class: energy
  state_class: total_increasing
sensor.pv_total_yield:
  device_class: energy
  state_class: total_increasing
sensor.energy_used_by_house:
  device_class: energy
  state_class: total_increasing

Does anyone have a similar reading case, it disrupts my monthly and annual readings, but not the total. It turns out that the error comes from pv_string_01_voltage

obraz

obraz

obraz

  - platform: template
    sensors:
      pv_string_01_power:
        friendly_name: "Huawei PV String 01 Power"
        unit_of_measurement: "W"
        device_class: energy
        icon_template: mdi:solar-power
        value_template: '{{ (states("sensor.pv_string_01_voltage")|float * states("sensor.pv_string_01_current")|float * 1) | round(0) }}'

Can such readings be avoided? What could it be from?
Calibration of the utility meter helps, but until the next wrong reading

I’m also getting wrong readings, that’s why I stopped using smart dongle and I’m connecting again to internal wifi AP. With internal AP I had never got any wrong readings.

1 Like

It turns out, however, that it remains to return to the topic of the router as a gateway via wifi or use the kiosk option

You can also modify template to accept only values between some range:

    pv_strin1_voltage:
      friendly_name: "Napiecie string 1"
      unit_of_measurement: 'V'
      value_template: >
        {% if state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_voltage') | float > 0 and state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_voltage')|float < 500 %}
          {{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_voltage') }}
        {% else %}
          0
        {% endif %}

Piszę z głowy więc nie jestem pewien czy składnia poprawnie.

In a my old configuration I had similar issue on an utility meter sensor based to template. This happened at HA restart.
I am not an expert but maybe it could be caused to the temporary unavailablity values of some sensor included into the template.

@ligeza which values you use in energy dashboard? Energy Management in Home Assistant - #929 by yousaf465
I have highlighted the same issue here.

I currently don’t use energy dashboard. I tested it but it is not useful for me.

https://github.com/home-assistant/core/pull/56564 this might fix spike reading issue in 2021.10.x
and this too https://github.com/home-assistant/core/pull/56609

I don’t know why, but for a few days I can’t connect to the dongle anymore.
I do a “ncmli device wifi” and it shows me SUN2000-HV20C0028779 for some time. Then it wifi AP disappears, and maybe reappear.
When I try to connect “nmcli d wifi connect SUN2000-HV20C0028779 password xxx” it gives me “Error: Connection activation failed: (53) The Wi-Fi network could not be found.” or after 1 minute or so “Error: Connection activation failed: (7) Secrets were required, but not provided.”

Any idea what’s going wrong here? It was working fine for the last 2 month since I got it. Dongle fw version seems to have auto-updated to v123

Hello, someone know how reduce the data collecting time ? Now with 30 secs I have problmens

hi from yesterday have a 2 strings of panels .in data I receive for any string power in A and Voltage for string .how is easiest way to calculculate sensor which show kwh or wh for string in that moment .like to see in real time separate for every string

Thanks

Hello

  1. /config/configuration.yaml

sensor: !include sensor.yaml

  1. /config/sensor.yaml

     - platform: template
         sensors:
           pv_01_power:
             friendly_name: "PV 01 Power"
             unit_of_measurement: 'W'
             value_template: >
               {{ '%0.2f' | format (states('sensor.pv_01_voltage') | float *  
                                            states('sensor.pv_01_current') | float ) }}
    
           pv_02_power:
             friendly_name: "PV 02 Power"
             unit_of_measurement: 'W'
             value_template: >
               {{ '%0.2f' | format (states('sensor.pv_02_voltage') | float *  
                                            states('sensor.pv_02_current') | float ) }}

save and restart HA :wink:

many thanks , pleas help me wit this line which going in configuration.yamal

can save them , all time is error message for this line

part in sensor.yaml is ok but for now no any numbers until I fix this part in configuration.yaml I think.

thanks on help

It is because you probably are using other sensors in configuration.yaml and sensor: include means that all you sensors will be in sensor.yaml file. If your sensors are in configuration files you can add it to sesnsor section:

sensors:
  - platform: template
      sensors:
        pv_01_power:
          friendly_name: "PV 01 Power"
          unit_of_measurement: 'W'
          value_template: >
            {{ '%0.2f' | format (states('sensor.pv_01_voltage') | float *  
                                         states('sensor.pv_01_current') | float ) }}
 
        pv_02_power:
          friendly_name: "PV 02 Power"
          unit_of_measurement: 'W'
          value_template: >
            {{ '%0.2f' | format (states('sensor.pv_02_voltage') | float *  
                                         states('sensor.pv_02_current') | float ) }}

Thanks lewusek0 and Rafal

Works like charm.