GoumJer / Huawei_Sun2000

Shell script to read data from Huawei website en send to Domoticz/Influx
2 stars 1 forks source link

Colleting the data from your Huawei SUN2000 inverter to Domoticz (and Influx.)

Requirements

1. Raspberry Pi or other hardware

These scripts have been developed and testen on Raspberry Pi. It can of course be installed on almost any linux system without issues, but you're on your own :-). This Raspberry must have internet access.

At least it is required to install jq, a small utility used to process json output. On Raspberry:

sudo apt update

sudo apt install -y jq

2. Try to get yourself a developers account for the data which is collecting. This request MUST be submitted by the company who installed your converter.

Send an email to "eu_inverter_support at huawei.com" with the following:

I hereby request an openAPI user account to access the data from my inverter through the new FusionSolar API:
System name: XXXXXXXXXXXXXXXXXX (serial no, found on the label on your converter)
Username: [your.email@somewhere.else]()
Plant Name: City and adress
SN Inverter: XXXXXXXXXXXXXXXXXXXX (serial no, found on the label on your converter)

You will receive an excel form to be filled and submitted by your installer (if not from them, it will be refused).

3. When the account is created you can use these (bash) scripts to retrieve the "real-time", hourly, daily and yearly data from their website which is updated every 5 minutes.

Real-time is updated every 5 minutes, so it's more "almost real time". I collect this data every 5 minutes and write it to Domoticz (real time data) en and to influx (hour, day and year) to produce nice graphs.

To get this working take the following steps:

When all this is done, you’re ready to go, run the script with the RealTime parameter and review the output. If any error occurs, you can add the "Y" (without quotes) as second parameter to enable debug information.

Normal execution gives the following output, indicating that both devices (today and this month) have been updated:

pi@raspberry-4:~/huawei-solar $ ./HuaweiSolar_API.sh RealTime

{

"status" : "OK",

"title" : "Update Device"

}

{

"status" : "OK",

"title" : "Update Device"

}

pi@raspberry-4:~/huawei-solar $

If testing gives no errors, you can use the entries in the file crontab as inspiration to automate regular updates to Domoticz.

Note: If you do not want or need to send (hour/day/year) data directly to influx just only run the script every 5 minutes with the RealTime parameter which will send data to Domoticz only