Integration Solar inverter huawei 2000L

How did you connect to the port 502

my network is 172.16.0.60 (using usb dongle) and the inverter internal ip is 192.168.8.1.
When i connect to the 172.16.0.60 i can’t get huawei_solar work.

if i need to use 192.168.8.1, then i need to brigde a network with a router (wifi to wifi?)

You need to connect to 192.168.8.1
If you are using raspberry for HA then you can connect wifi to the inverter and lan to home network.

You can also use a router with AP client to bridge to home network. I’m using old tp-link router (dd-wrt firmware) with blocked DHCP traffic Integration Solar inverter huawei 2000L

It should also work with a router using static routing.

1 Like

I used a raspberry pi Zero W as a bridge between the inverter and my LAN.
There are numerous guides that you can follow, example: https://www.raspberrypi.org/forums/viewtopic.php?t=132674

*Connect the pi to the inverter WiFi network
*Connect the Pi LAN interface to your regular LAN (same network as your HA server) and give the Pi a static IP.
*Follow the guide above to set up your Pi as a bridge.
*Enter a static route in your home router that routes all traffic to the Inverter to the LAN IP of your Pi.

It seems like the issue with async is found and being worked on: https://github.com/riptideio/pymodbus/pull/558

Once this lands in a release version of pymodbus (and it fixes the issue in HA) I’ll update the sensor to use async and try to get in officially in HA.

5 Likes

Hello everyone.

I thank you for this tutorial. I followed it, and now I can access all the information on my inverter.

However, I am trying to create more sensors, but you are giving me this error. I don’t have much knowledge of homeassistant. Can someone help me to solve the problem?

entity_id: was removed from template. I think the problem is also text formatting.
My working config:

sensor:
  - platform: huawei_solar   
    host: 192.168.8.1
  
  - platform: template
    sensors:
      pv_01_voltage:
        friendly_name: "String 1 napięcie"
        unit_of_measurement: 'V'
        icon_template: mdi:flash-alert-outline
        value_template: "{{ state_attr('sensor.sun2000_8ktl_m0', 'pv_string_01_voltage') }}"

Thank you very much! Now its working!

Hello
first thank you very much for the contribution, it is fantastic.

I need to know if this information can be extracted (in the image numbers 1, 2, 3). If possible, how should I do it or what are the parameters that I have to read

Thanks a lot

Hello

This is how my panel is right now with the data that I have taken, it is very simple since I am starting the total configuration of my HA. little by little I will improve it I have incorporated more information

You can’t read it. You can use:
https://www.home-assistant.io/integrations/utility_meter/ to have daily data.

  1. grid exported energy
  2. energy used by house:
- platform: template
  sensors:
    m_grid_exporterd_energy:
      friendly_name: "Prąd oddany do sieci"
      unit_of_measurement: 'kWh'
      icon_template: mdi:transmission-tower
      value_template: "{{ state_attr('sensor.sun2000_8ktl_m0', 'grid_exporterd_energy') }}"
 
    m_grid_accumulated_energy:
      friendly_name: "Prąd pobrany z sieci"
      unit_of_measurement: 'kWh'
      icon_template: mdi:transmission-tower
      value_template: "{{ state_attr('sensor.sun2000_8ktl_m0', 'grid_accumulated_energy') }}"

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

   energy_used:
      friendly_name: "Zużycie prądu dom"
      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) }}
  1. grid accumulated energy
1 Like

I’ve just started using Hass.io 5.10 and I find this error:

2021-01-18 05:36:02 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for huawei solar which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

2021-01-18 05:36:02 ERROR (MainThread) [homeassistant.components.hassio] Platform error sensor.huawei solar - No module named ‘huawei_solar’

Any help would be apreciated!!

Iñaki

Did you copy this files?

Copy these files to custom_components/huawei_solar/

Yes, I did.

I’ve downloaded all the files in a zip file, extracted in a folder named huawei_solar_master and renamed it to huawei_solar.

I’ve created a folder (in windows with the samba add-on) called custom_components in the config folder and finally pasted the huawei_solar folder…

Thank you

Suddenly it started to work.

Good job @ligeza!

1 Like

Hi Emilv,
first of all, thank you very much for this integration. I was slowly going crazy with the limitations of the Huawei app, and after discovering home assistant two months ago was overjoyed to find there is a solution to read the inverter data!

I was curious though how people coped with the inverter shutdown. At least my installation (Sun2000-15KTL) shuts completely down when there is no power from the solar panels, including the wifi. In the morning home assistant does not seem to recover the connection without a restart(I am running a supervised docker installation on an Intel NUC). I guess I could use an automation to restart 10 minutes after sunrise or so, but I was wondering if there is a more elegant solution.

Cheers, and thanks again for all the good work!

Glad that you like it!

I have a SUN2000L-3KTL and it doesn’t shutdown when there is no solar power, maybe that’s a difference between the 2000 and 2000L versions.

Could you show me what you see in the logs when it doesn’t reconnect after the power is back on?

1 Like

Hmm seems I was to hasty. For future reference, the 2000 series seems to enter a state when illumination is detected where the dongle starts to connect to the huawei servers, but the internal wifi either does not accept connections yet or will not report proper values. As illumination rises the inverter enters the state ‘grid-connected’, where it will report properly, and everything works from there. It’s only we have some snow right now, so it took a while for the panels to start producing :slightly_smiling_face:

Say, you don’t have a ‘buy me a beer’-button somewhere? I wouldn’t mind showing my appreciation for your work!
Cheers,
Boris

I have sun2000-8ktl, There is no problem with WiFi dongle or internal WiFi when no illumination. For me it’s always on and connected to huawei server and HA even at night. Maybe there is some setting in HomeFusion App to change behavior of the inverter.

Hi, I am very grateful for your work with the integration.

I have access to a SUN2000-5KTL-L1 (actually grid power limited) and a SUN2000L-5KTL (on-grid) and the behaviour is the same. For the moment, I can’t notice any difference.

Both inverters are directly connected to the carrier wifi router directly.

Hello Emilv2, how’s the progress with async?