Integration Solar inverter huawei 2000L

Really good job Frans. work like a charm.

how did you create the first column results?

It’s picture-elements card.

elements:
  - entity: sensor.power_meter_active_power
    style:
      left: 27%
      top: 7%
    type: state-label
  - entity: sensor.active_grid_a_power
    style:
      left: 52%
      top: 16%
    type: state-label
  - entity: sensor.active_grid_b_power
    style:
      left: 52%
      top: 19%
    type: state-label
  - entity: sensor.active_grid_c_power
    style:
      left: 52%
      top: 22%
    type: state-label
  - entity: sensor.m_grid_a_voltage
    style:
      left: 38%
      top: 16%
    type: state-label
  - entity: sensor.m_grid_b_voltage
    style:
      left: 38%
      top: 19%
    type: state-label
  - entity: sensor.m_grid_c_voltage
    style:
      left: 38%
      top: 22%
    type: state-label
  - entity: sensor.m_grid_exporterd_energy
    style:
      left: 68%
      top: 7%
    suffix: ' >>> '
    type: state-label
  - entity: sensor.m_grid_accumulated_energy
    prefix: ' <<< '
    style:
      left: 68%
      top: 13%
    type: state-label
  - entity: sensor.energy_used
    style:
      left: 68%
      top: 31%
    suffix: ' >>> '
    type: state-label
  - entity: sensor.daily_yield
    prefix: 'Dzisiaj '
    style:
      left: 40%
      top: 37%
    type: state-label
  - entity: sensor.total_yield
    prefix: 'Total '
    style:
      left: 68%
      top: 37%
    type: state-label
  - entity: sensor.sun2000_8ktl_m0
    style:
      left: 20%
      top: 37%
    type: state-label
  - entity: sensor.phase_a_current
    style:
      left: 40%
      top: 46%
    type: state-label
  - entity: sensor.phase_a_voltage
    style:
      left: 26%
      top: 46%
    type: state-label
  - entity: sensor.phase_b_current
    style:
      left: 40%
      top: 49%
    type: state-label
  - entity: sensor.phase_b_voltage
    style:
      left: 26%
      top: 49%
    type: state-label
  - entity: sensor.phase_c_current
    style:
      left: 40%
      top: 52%
    type: state-label
  - entity: sensor.phase_c_voltage
    style:
      left: 26%
      top: 52%
    type: state-label
  - attribute: device_status
    entity: sensor.sun2000_8ktl_m0
    style:
      left: 60%
      top: 62%
    type: state-label
  - entity: sensor.pv_input_power
    style:
      left: 20%
      top: 62%
    type: state-label
  - entity: sensor.pv_01_voltage
    style:
      left: 40%
      top: 70%
    type: state-label
  - entity: sensor.pv_01_current
    style:
      left: 60%
      top: 70%
    type: state-label
  - entity: sensor.pv_02_voltage
    style:
      left: 40%
      top: 88%
    type: state-label
  - entity: sensor.pv_02_current
    style:
      left: 60%
      top: 88%
    type: state-label
image: /local/sun2000e.png
title: Sun2000-8KTL-M0
type: picture-elements
- 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') }}"

    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 Like

nice one !

how can i make some commande which tell HA to autorun every morning about 8 am to run this command in terminal

nmcli device wifi rescan
nmcli device wifi connect “YOUR_SSID” password “YOUR_WIFI_PASSWORD”

and then restart. HA

it is miki maus every morning type manually. that is because inverter auto turn of at night and turn on in morning.

Hmmm, I saw someone else have that issue but they said it just went away. Is it still not working? Have you restarted HA?

That should possible using the commandline switch and some automations, but I don’t think this should be needed. Does the wifi really turn off when the inverter goes off? Mine doesn’t and I thought others said the same.

Thanks .i change setup in connection file and now is connected 24h with inverter.

I can’t get this to work using a rp3, don’t think it’s fit for purpose. You are connected using this raspberry pi to the inverter wifi and also your local ethernet router using cable. Isn’t the idea to be able to access the inverter’s ip on your ethernet network? This method makes the rpi run it’s own dhcp server for ethernet devics

Not sure actually, I realised that for this creation of yours Emilv2, that we needed to access the inverter’s wifi. I run Homeassistant on a windows computer and don’t have wifi. I tried few things by using a raspberry pi to bridge the wifi connection from the inverter with my ethernet so it can be accessed, but without luck.

You should set the Pi up to act as a WiFi bridge between the the solar network (192.168.8.1) and your home network.
In my case, I have set up wlan0 to static IP (192.168.8.100) and eth0 static (192.168.0.70) on one of the vlans on my home network.
All traffic from the inverter is routed from wlan0 to eth0 and the other way around. Follow the guide that I linked to and you should be ok.
I´m using a Pi zero W and came to the conclusion that the wlan interface hangs from time to time. After setting up a script that checks the interface every 5 min and restarts wlan0 everything works fine.
PM me if you want that script.

1 Like

Try adding a USB Wlan card and set that up to connect to your inverters WiFi. The add the network of the Wlan adapter to your HA config. Provided you have sufficient WiFi signal from the inverter to your HA server.

Good evening, guys.
I am using this integration on my HA and it works perfectly!
I have a raspberry pi 3 connected over Wi-Fi to the inverter, and cabled to my network.
I’m thinking of moving HA to a virtual machine. Can I use the same configuration and the same connections?
If I install the mini PC in a location where I cannot connect via Wi-Fi to the inverter, can I use raspberry pi just to access the inverter data and send the data to the HA? Any ideas?
Thank you.

It depends per device. Some (older? newer?) models will only accept a modbus connection if you are connected to the inverters wifi (it has both a wifi client and ap), while other models do accept incoming connections from the client side so you can simply access it through your router without any extra hardware.

It might be good to make a list of which devices can only connect through the AP and which don’t, and add this to the readme file

You can use the raspeberry pi as a bridge between the inverter and HA. If you have a router with OpenWrt or DD-WRT you also can use that to make a client connection to your inverter.

CanI use this guide?
https://www.raspberrypi.org/documentation/configuration/wireless/access-point-bridged.md

No, you want the raspberry pi to be a client, not an AP. What you want is something like more like this: https://raspberrypi.stackexchange.com/questions/88954/workaround-for-a-wifi-bridge-on-a-raspberry-pi-with-proxy-arp/88955#88955 where INTERNET is the inverter. But also not exactly the same since you will have another router between the raspberry pi and your computer.

Ok, Thank you. I will read and test.

How do you create all those entiys ??

Hi, Could you share your code? please