Integration Solar inverter huawei 2000L

Laurenthu, what if they make it intentionally to save some server requests ? Then the “fix” will never come.

Maybe there is a way to parse the output

Hello @robert.access and @Laurenthu

i put some time into it but we are almost there

curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURKIOSKTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);print(obj["data"]);'

do this help to make the script working?

1 Like

Thank you, I was able to get them from Huawei as well. Initially I was using uint to display them and it was showing them all wrong. I am using int now and the values are fine. Finally I have all the info I need from the inverter and meter, I just need to get a more reliable router to link the networks.

Out of curiosity, I didn’t get a chance to test : the dongle has also a wired network. Does it belong to the inverter internal network or it’s used to connect it to the home network ?

The wired network is used to connect to home network. I have a new firmware in dongle and with this new firmware I should be able to connect to inverter by ethernet but I hadn’t time to test it. Page 2 of modbus serial connection not stable while smart donge is connected - Huawei Enterprise Support Community.

Hmm, so basically we wouldn’t need that extra router then and use only the wired network. That would be nice. How did you check the firmware of the dongle ? I can only see the inverter’s firmware in the FusionHome app with the installer login. A few days ago I was able to see the Inverter info there and a section “MBUS Upgrade” . Now, I have only the inverter upgrade .

OK, so I have TL-WN422G.
But as I can see, it can be difficult to run it on hassio (5.4.83-v8 aarch).

my dmesg:

As I can see, it can be problematic to run ath9k_htc(example for TL-WN772N model) :
https://bbs.archlinux.org/viewtopic.php?pid=1912134#p1912134

Did you, or anyone solve that kind of issue with missing drivers? Or that wifi dongle is not good choice for hassio?

You can check it in https://eu5.fusionsolar.huawei.com or after inserting smart dongle to inverter, for 3 minutes is created new AP and you can connect directly to smart dongle to update it manually and you can also check version.

It seems I have a lower firmware, V100R001C00SPC117 . I’ll try requesting a new firmware from Huawei, otherwise I will ask my installer to upgrade it. What application do you use to upgrade the firmware ? FusionHome or something else ?

I’m using fusionsolar. If you disable mobile data and you don’t have internet on phone, then you have option to connect to inverter like in fusionhome. With firmware I received also instruction how to upgrade dongle.

Thank you Frans, but I cannot get it to work, yet…
Working on it.

1 Like

@robert.access @Frans1 this script does work for me and produces a clean JSON, I am just not sure how to integrate this properly into HA in order to replace the previous “pv_production_realtime” and the templates…

I checked connection with ethernet cable and I see 502 port opened but I can’t get any data. I see also in FusionHome my dongle in device tab, while I’m connected to home network but after writing login and pass to installer account also I can’t connect.

guys it’s impossible to stay behind! you are too far ahead !!! congratulations!!! I miss I can integrate the 2000l with HA and you make impossible graphics !!!

Hi Guys,

I’m able to see the huawei inverter in my network including the open port 502. But when I try to connect to it, I get the following error:
huawei_solar.huawei_solar.ConnectionException: Modbus Error: [Connection] ModbusTcpClient(192.168.0.97:502): Connection unexpectedly closed 0.169493 seconds into read of 8 bytes without response from unit before it closed connection

Edit: I’m using the IP of the wifi connection created by the dongle not the inverter’s ‘own’ wifi network

Any ideas on how to proceed?

Hi, I managed to connect to the Inverter using the built in wifi in my RPi 4 and if I add modbus: to HA config I get the integration to work.
I’m having some issues with the network interface on my RPi, if I restart the host sometimes it won’t be visible on my network, it’s connected by wire. Could it be the inverter that assigns my Pi with an IP-address (192.168.8.2?) that causes confusion?
I have been getting an error in the log:

GDBus.Error:org.freedesktop.DBus.Error.LimitsExceeded: The maximum number of active connections for UID 0 has been reached

Anyone with similar issues?

I’ve tested also with using a wifi-extender in media-bridge mode but this only made my network crash due to the inverter sending out DHCP to my routers network.
How can I solve this? Turn off DHCP in the inverter?

It’s strange, that’s why I recommended this dongle because it works without any problems. I haven’t written what distribution I use before, and this is the only correct Debian;)

forgive me but I can not follow you, I would like to connect via wifi two single-phase 2000l via wifi, you can kindly tell me which post to leave. I do not understand anything anymore

FYI Huawei seems to have changed again the Kiosk integration, I had to re-create mine to access it this morning. The “bug” seems still to be there with the &quot in the JSON file. And I still don’t know how to elegantly integrate this in HA… :frowning:
Looking at the JSON file a bit closer they seem to have integrated different types of info this time, at we get a power production chart on top of what was there before.

You can use it like that:

  - platform: command_line  
    command: curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);data_obj=json.loads(obj["data"]);print(data_obj["realKpi"]["realTimePower"]);'
    name: solar_real_time
    unit_of_measurement: 'KW'
    scan_interval: 60
    command_timeout: 30
  - platform: command_line  
    command: curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);data_obj=json.loads(obj["data"]);print(data_obj["realKpi"]["cumulativeEnergy"]);'
    name: solar_cumulative
    unit_of_measurement: 'KW'
    scan_interval: 60
    command_timeout: 30
  - platform: command_line  
    command: curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);data_obj=json.loads(obj["data"]);print(data_obj["realKpi"]["monthEnergy"]);'
    name: solar_month
    unit_of_measurement: 'KW'
    scan_interval: 60
    command_timeout: 30
  - platform: command_line  
    command: curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);data_obj=json.loads(obj["data"]);print(data_obj["realKpi"]["dailyEnergy"]);'
    name: solar_daily
    unit_of_measurement: 'KW'
    scan_interval: 60
    command_timeout: 30
  - platform: command_line  
    command: curl -s https://eu5.fusionsolar.huawei.com/rest/pvms/web/kiosk/v1/station-kiosk-file?kk=YOURTOKEN | python3 -c 'import json,sys;raw=sys.stdin.read();clean=raw.replace(""",r"\"");obj=json.loads(clean);data_obj=json.loads(obj["data"]);print(data_obj["realKpi"]["yearEnergy"]);'
    name: solar_year
    unit_of_measurement: 'KW'
    scan_interval: 60
    command_timeout: 30

Huawei have changed the token too often… this is bad.

1 Like