Skip to content

BlazejosP/huawei-sun2000-API-CLI

Repository files navigation

Huawei sun2000 API CLI

GitHub license GitHub issues Language GitHub repo size GitHub forks GitHub Repo stars

If you found this software usefully and do like to say thank you!

Nothing actually

Linux Command line tool for acess Huawei FusionSolarApp API

Huawei sun2000 series (here list of the devices https://solar.huawei.com/eu) should work with all devices which are working in their cloud service. This is command line bash API for view/download data from their FusionSolarApp web service without use of their webpage. To use this tool you may need kioskmode link as a minimum. But to fully use this tool you need an acount in their service and then request developer account. That all means that you need Huawei sun2000 https://solar.huawei.com/eu/products series PV inverter configured already with their cloud service or someone who give you acess to cloud service related with his Huawei device.

To use this script you must have as a minimum kioskmode link given to you by someone else who has Huawei account. But to fully use this software you need account on Huawei FusionSolar https://eu5.fusionsolar.huawei.com and developer privilege.

Contact service team at eu_inverter_support@huawei.com to create an openAPI account for your plant. Inside email like this:

Email Template

Hi, I hereby request an openAPI user account to access the data from my inverter(s) through the new #FusionSolar API:

System name: <--here data--> 

Username: <--here data--> 

Plant Name: <--here data--> 

SN Inverter: <--here data-->

Device Sun2000-(from 3KTL to 100KTL meaby also others)-M0/M1

Confirmed by user of this software devices which are working for certain (devices not marked should work because are implemented but we haven't any confirmation to be certain)

  • String inverter
    • SUN2000-5KTL-M0
    • SUN2000-30KTL-M3
  • Dongle
    • SDongleA-05
  • Residential inverter
    • SUN2000-4.6KTL-L1
  • Smart Logger
  • EMI
  • Meter (Grid meter)
  • Power Sensor
  • Battery (LG batteries)
  • Battery (Huawei Luna2000)

Device itself must be equipped with Smart Dongle existing two types:

Smart Dongle-4G (sends data through cellular network -> to internet -> and then stright to cloud service)

SmartDongle-WLAN-FE (sends data with use of user lan or wlan -> through user getway -> internet -> to cloud service)

Whatever dongle is in use there must be an connection to internet if not cloud service simple don't recieve new data.

Huawei-sun2000

Installation

This is tool for login and get data from Huawei FusionSolar https://eu5.fusionsolar.huawei.com This tool use official FusionSolar API described here https://forum.huawei.com/enterprise/en/communicate-with-fusionsolar-through-an-openapi-account/thread/591478-100027 by manufacturer. Data from official API are instantous or every 5 mintes, hour, day, monthly, yearly.

You must have installed on your linux tools like curl, jq, httpie, grep, mosquitto_pub on debian and similar systems. They are necessary for working of this bash scripts. On Debian like system you can download them with:

sudo apt-get install curl

sudo apt-get install jq

sudo apt-get install grep

sudo apt-get install httpie

sudo apt-get install mosquitto-clients (if MQTT sending option will be used)

sudo apt-get install dialog (if TUI will be used)

or at once all with

sudo apt-get install curl jq grep httpie dialog mosquitto-clients

On other linux distributions check used package system but that are standard linux command line tools so should be avaiable without problems if are not installed already.

Configuration&Usage

config.conf - this file is needed by both fusionsolarapp.sh & fusionsolarapp_interface.sh and have inside stored your Usernames & Passwords and also links to kioskmodes which you have or have acess to them. You must edit this file first to made this software working. Now you can use this software even without huawei account if you can paste kioskmode given to you by someone else.

fusionsolarapp.sh - which is using official Huawei API called OpenAPI by Huawei. Now this script can pull and show on the screen data Real-time(actually), every 5min , daily, monthly, yearly for Plants (which may include many inverters+any other devices data together) and Individual Devices (like every one inverter, battery etc.) This script is now under development and for now can only grab all the data from your devices and show them on screen & if you choose option save to file. In not so long time will be able also send this data to InfluxDB(grafana), Domoticz, MQTT. This script need individual configuration inside if you need data tailored to your needs. How do this is described here #12

Then inside you can extract this data:

  • Plant data
    • realtime plant performace
    • actually and historical plant performace resolution every 5 minutes inside day
    • actually and historical plant performace resolution 30 days
    • actually and historical plant performace resolution 12 month
    • actually and historical plant performace resolution all years
  • individual device data
    • realtime device performace
    • actually and historical data device performance resolution every 5 minutes inside day
    • actually and historical data device performace resolution 30 days
    • actually and historical data device performace resolution 12 month
    • actually and historical data device performace resolution all years

FusionSolarApp

fusionsolarapp_interface.sh - this is the same program but with TUI graphical interface you must install additionally dialog. As for now you can login inside software will ask you about Login and Password if this data are not provided by config.conf. And check this properties inside checked below.

Then inside you can check:

  • Plant data
    • realtime plant performace
    • actually and historical plant performace resolution every 5 minutes inside day
    • actually and historical plant performace resolution 30 days
    • actually and historical plant performace resolution 12 month
    • actually and historical plant performace resolution all years
  • individual device data
    • realtime device performace
    • actually and historical data device performance resolution every 5 minutes inside day
    • actually and historical data device performace resolution 30 days
    • actually and historical data device performace resolution 12 month
    • actually and historical data device performace resolution all years

Also list of devices which are inside plant together with their performance. Also is possible save data's to a file TXT CSV XML JOSN are suported. This program is now partialy working so not every functionality is already implemented as you can see above. You will be advised if you chose not working yet part. When will be finished will have the same usability as text version.

TUI1