Huawei Smart PVMS: Difference between revisions

From HaFrWiki42
Jump to navigation Jump to search
Line 44: Line 44:
== See also ==
== See also ==
<span class="editsection">[[#content|top]]</span>
<span class="editsection">[[#content|top]]</span>
* [https://github.com/tijsverkoyen/HomeAssistant-FusionSolar GitHub Tijs Verkoyen], HomeAssistant FusionSolar Integration. Contains useful remarks on Northbound API login.
* [https://github.com/wlcrs/huawei-solar-lib/tree/develop/examples GitHub wlcrs], Huawei Solar Lib in python (ModBus).


== Reference ==
== Reference ==

Revision as of 14:06, 27 December 2025

Introduction

The Huawei Fusion Solar System is a closed system software system for managing Solar Plants, only accessible for Installer Access Rights.
For third party partners (Octopus, Tibber) Huawei has made a Northbound Southbound Interface (SNMP: Simple Network Management Protocol).
To make simple adjustments to the system without changing the local system software system this API is ideal to make changes.

Huawei SMTP SmartPVMS

Webservice Northbound Interface Architecture

Northbound open APIs are open interfaces based on the Representational State Transfer (REST) standard and can facilitate integration of third-party systems.
Third-party systems can use RESTful NBIs to access the resources authorized by the SmartPVMS, such as access authentication, configuration, alarm, and performance data.
APIs can be used only after authorization and the access is secure.
Only HTTPS access is supported.

The SmartPVMS provides a set of WebService APIs for third-party systems and third-party developers, who can construct HTTPS requests to call APIs and obtain SmartPVMS resources and data.

Huawei's documentation Northbound Open APIs:

OAuth Connect

In OAuth Connect mode, third-party apps need to adapt to the OAuth 2.0 protocol to access northbound open APIs.

Example Authentication

An (existing user) account is used to call the login API to obtain an Cross-Site Request Forgery (XSRF) token for identity authentication when accessing other data query APIs and control APIs.

$ch = curl_init("https://eu5.fusionsolar.huawei.com/thirdData/login");
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        "userName"         => "email",
        "password"         => "password"
    ])
]);

$response = json_decode(curl_exec($ch), true);
$token = $response['data']['token'];

See also

top

  • GitHub Tijs Verkoyen, HomeAssistant FusionSolar Integration. Contains useful remarks on Northbound API login.
  • GitHub wlcrs, Huawei Solar Lib in python (ModBus).

Reference

top