Provides a Python API to access Huawei FusionSolar web service to download SmartPVMS data. To login you need account on Huawei FusionSolar https://eu5.fusionsolar.huawei.com. Queried data are return as-is. Please refer to Huawei SmartPVMS Northbound Interface Reference V6 documentation for more details about data format.
The package is distributed with pip, and can be installed with the command line:
python3 -m pip install pyhfs
import pyhfs
try:
with pyhfs.ClientSession(user='user', password='password') as client:
plants = client.get_plant_list()
print(plants)
except pyhfs.LoginFailed:
print('Login failed. Verify user and password of Northbound API account.')
For more details about how to use the API, please check how_to.py.
Testing requires a valid Northbound API account, which can be created from Fusion Solar system/company management interface. Tests will look for two environment variables to get user account (FUSIONSOLAR_USER) and password (FUSIONSOLAR_PASSWORD).
Use the following command from directory root to run the tests:
python3 -m unittest discover
In case of a fork, these same variables (FUSIONSOLAR_USER and FUSIONSOLAR_PASSWORD) shall be added to github secrets in order for the CI to work.