SmartPVMS 24.5.0 Northbound API Reference
SmartPVMS 24.5.0 Northbound API Reference
SmartPVMS 24.5.0 Northbound API Reference
24.5.0
NBI Reference
Issue 01
Date 2024-07-01
and other Huawei trademarks are the property of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei
Digital Power Technologies Co., Ltd. and the customer. All or part of the products, services and features
described in this document may not be within the purchase scope or the usage scope. Unless otherwise
specified in the contract, all statements, information, and recommendations in this document are
provided "AS IS" without warranties, guarantees or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
Website: https://digitalpower.huawei.com
Contents
1 Change History.........................................................................................................................1
2 Overview....................................................................................................................................6
2.1 Introduction to Northbound Open APIs.......................................................................................................................... 6
2.2 API Architecture....................................................................................................................................................................... 7
2.3 API Overview.............................................................................................................................................................................8
3 API Access................................................................................................................................12
3.1 OAuth Connect...................................................................................................................................................................... 12
3.1.1 Creating an OAuth 2.0 Client for a Third-Party App............................................................................................. 12
3.1.2 Integrating OAuth 2.0 to Third-Party Apps.............................................................................................................. 14
3.1.2.1 Adaptation Process Overview.................................................................................................................................... 15
3.1.2.2 Initiating Authorization to a Third-party App by an Owner........................................................................... 16
3.1.2.3 Obtaining the Access Token of the Open API by a Third-Party App............................................................21
3.1.3 Calling Open APIs by Third-Party Apps..................................................................................................................... 25
3.1.4 Incremental Authorization or Authorization Revocation.....................................................................................28
3.2 API Account Access...............................................................................................................................................................29
3.2.1 Obtaining an Account...................................................................................................................................................... 30
3.2.2 Authentication API............................................................................................................................................................ 31
3.2.2.1 Login API........................................................................................................................................................................... 31
3.2.2.2 Logout API........................................................................................................................................................................ 35
3.2.3 Calling an API..................................................................................................................................................................... 37
5 API Reference......................................................................................................................... 51
5.1 Basic APIs................................................................................................................................................................................. 51
5.1.1 Basic....................................................................................................................................................................................... 51
5.1.1.1 Plant List API....................................................................................................................................................................51
5.1.1.2 Device List API................................................................................................................................................................. 54
5.1.2 Monitoring........................................................................................................................................................................... 58
5.1.2.1 Real-Time Plant Data API........................................................................................................................................... 58
5.1.2.2 Real-Time Device Data API.........................................................................................................................................62
5.1.2.3 Historical Device Data API.......................................................................................................................................... 95
6 References............................................................................................................................. 209
6.1 Error Code List..................................................................................................................................................................... 209
6.2 Old Policy for API Flow Control..................................................................................................................................... 216
6.3 Time Zone Code List.......................................................................................................................................................... 217
6.4 Exception Code List............................................................................................................................................................ 224
8 FAQs....................................................................................................................................... 231
8.1 FAQs About the OAuth Connect Mode.......................................................................................................................231
8.1.1 Handling the Exception Returned by Calling the Authorization Request API........................................... 231
8.1.2 Handling the Exception Returned by Calling the Token Obtaining API.......................................................232
8.1.3 Why Does the Northbound API Return Error Code 305?.................................................................................. 232
8.1.4 Why Does the Northbound API Return Error Code 401?.................................................................................. 233
8.1.5 Why Does the Northbound API Return Error Code 407 or 429?.................................................................... 233
8.1.6 How Do I Obtain O&M Support When Open APIs Are Accessed in OAuth Connect Mode?............... 234
8.2 FAQs About the API Account Mode............................................................................................................................. 235
8.2.1 Why Do I Fail to Create an API Account?............................................................................................................... 235
8.2.2 What Is the New or Old Flow Control Policy for Northbound APIs?............................................................ 235
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. iii
SmartPVMS
NBI Reference Contents
8.2.3 Why Does the Login Fail After I Enter the Correct Username and Password?..........................................236
8.2.4 Why Do I Need to Log In Again When I Use the Token to Call an API?..................................................... 236
8.2.5 Why Does the Northbound API Return Error Code 401?.................................................................................. 236
8.2.6 Why Does the Northbound API Return Error Code 407 or 429?.................................................................... 237
8.3 Why Is No Data or Only Part of Data Found When I Call a Northbound API for Data Query?.............237
8.4 How Long Is the Data Collection Time of the API for Real-Time Plant Data?............................................. 241
8.5 Why Do the Hourly/Daily/Monthly/Yearly Data APIs of the Plant or the Daily/Monthly/Yearly Data
APIs of the Device Sometimes Return Small Data Value?.......................................................................................... 241
8.6 Why Do I Fail to Query Historical Alarms by Calling the Alarm Query API?................................................ 241
8.7 Why Does the /thirdData/getStationList API Return Error Code 401 or 402?.............................................. 241
8.8 Why Is the Plant ID Returned by the Plant List Inconsistent with That Displayed on the SmartPVMS?
......................................................................................................................................................................................................... 241
8.9 Why Do the Plant IDs Returned for the Same Plant Vary Depending on Open API Users?.................... 241
8.10 How Do I Compare and Obtain Plants That Are Not Returned by the Plant List API?........................... 242
1 Change History
03
Optimized 3.1.1 Creating an OAuth 2.0 Client for a Third-Party App.
02
Added 7.5 Scenario-based Practices of Battery Scheduling.
Optimized 4.2 Flow Control Using the API Account and 5.2.1 API for Delivering
Battery Charge and Discharge Tasks.
01
API Name Method and Path Description Re
mar
ks
01
None
03
Optimized 3.1.2.2 Initiating Authorization to a Third-party App by an Owner,
6.4 Exception Code List, 8.1.1 Handling the Exception Returned by Calling the
Authorization Request API, 8.2.1 Why Do I Fail to Create an API Account?, and
8.3 Why Is No Data or Only Part of Data Found When I Call a Northbound API
for Data Query?
02
Optimized 3.1 OAuth Connect and 4.1 Flow Control Policy in OAuth Connect
Mode.
Added 8.1.6 How Do I Obtain O&M Support When Open APIs Are Accessed in
OAuth Connect Mode?
01
CAUTION
During the evolution of open APIs, the original V6 APIs are incorporated into the
basic APIs. For details, see 5.1 Basic APIs. This change does not affect the normal
use of the original APIs.
Some APIs are iterated, as listed in the following table. You are advised to use new
high-performance APIs instead.
2 Overview
NOTICE
Please use the latest northbound API reference document by choosing Company
Management > Northbound Management > Developer Guide.
The JavaScript Object Notation (JSON) data format is used for data interaction.
The data format is simple, easy to read and write, and occupies less network
traffic than XML.
What Is REST?
REST, short for Representational State Transfer, is a design and development mode
for network applications. It simplifies development and improves system
scalability.
REST uses resources as its core, and resources are uniquely identified by a uniform
resource identifier (URI), for example, /rest/openapi/pvms/v1/plants.
REST uses four types of standard operations to access resources: POST, GET, PUT,
and DELETE.
● POST: creates resources.
● GET: queries resources.
● PUT: updates resources.
● DELETE: deletes resources.
The SmartPVMS provides external services using URIs. Users obtain SmartPVMS
resources through URIs and obtain services.
Basic Basic Plant List Returns the static information about the plants
APIs data on which the current account has permission by
page. Some information, such as the plant ID, is
the prerequisite for querying other API data. The
static information changes only when the plants
change. The third-party system must save the
information.
Repo Hourly plant Queries the hourly data of a plant in a day. The
rt data data items include inverter energy yield and feed-
data in energy. The data update is delayed. Generally,
only the current-day data is updated. The calling
party must save the data.
Yearly plant Queries the yearly data of a plant in its life cycle.
data The data items include inverter energy yield,
feed-in energy, and energy consumption. The
data update is delayed. Generally, only the
current-year data is updated. The calling party
must save the data.
Daily device Queries the daily data of a device. The data items
data vary depending on the device. The data update is
delayed. Generally, only the current-day data is
updated. The calling party must save the data.
Setti API for This API is used to deliver the task of setting the
ng Delivering a battery working mode based on the plant DN.
the Task for For the same PV plant, do not call this API
batte Setting the repeatedly before a task is complete. The battery
ry Battery working mode can be set to Maximum Self-
worki Working Consumption or TOU.
ng Mode
mode
API for This API is used to query the execution status of
Querying a the task for setting the battery working mode. Do
Task for not call this API repeatedly before a task is
Setting the complete.
Battery
Working
Mode
Batte API for This API is used to deliver the task of setting the
ry Delivering a battery parameters based on the plant DN. For
para Task for the same PV plant, do not call this API repeatedly
mete Setting before a task is complete. Users can set plant-
r Battery level battery parameters (end-of-charge SOC,
settin Parameters end-of-discharge SOC, maximum charge power,
g and maximum discharge power).
3 API Access
The SmartPVMS northbound open APIs provide two access modes for third-party
systems and third-party developers.
The platforms developed by installers can access the open APIs using API
accounts. Basic APIs can be used in the API account access scenario.
NOTICE
The access to open APIs in OAuth Connect mode is for trial use only in Europe.
The policy may change in the future.
OAuth 2.0 is an open authorization protocol that allows third-party apps to access
resources authorized by owners without obtaining their usernames and passwords.
A third-party app can apply for creating an OAuth 2.0 client on the FusionSolar.
After the FusionSolar owner authorizes the application, the FusionSolar owner
account is bound to the client. The third-party app then can access the
northbound open APIs to access the resources authorized by the owner.
The following sections describe the process of accessing northbound open APIs in
OAuth Connect mode.
After receiving client_id and client_secret, the third-party app must keep them
secure.
----End
1-2: An owner accesses the FusionSolar through the authorization request link
integrated to a third-party app client and initiates the authorization code
request process.
3: The OAuth service responds to the request (HTTP status code: 302) and returns
the authorization page to the third-party app client. If the owner has not logged
in to FusionSolar, the OAuth service returns to the FusionSolar login page. After
the owner logs in, the authorization page is displayed.
4-5: After the owner confirms the authorization, the third-party app client
accesses the OAuth service to initiate an authorization request to the third-party
app client (OAuth 2.0 client).
6: The OAuth service responds to the request (HTTP status code: 302) and returns
the redirect URL and authorization code to the third-party app client.
7: The third-party app client sends a request carrying the authorization code to
request the redirect URL.
8-9: After obtaining the authorization code, the third-party app server uses the
authorization code to send a request to the OAuth API for obtaining tokens to
obtain the access token and refresh token.
10: The third-party app server uses the access token to access the northbound
open APIs for subsequent service processing.
NOTICE
response_t Yes Strin Response type. The value is fixed at code for the
ype g OAuth 2.0 authentication mode.
redirect_uri Yes Strin RedirectUrl provided by the third-party app for the
g FusionSolar when the app applies for an OAuth 2.0
client.
Note that if RedirectUrl contains characters such as & and is directly used to
combine the URL of the authorization request API, a parameter exception page
may be returned. As a result, RedirectUrl is unavailable. Therefore, URL encoding
is required for RedirectUrl. For example, when RedirectUrl of the third-party app
is https://www.example1.com/cn/?example2=example3&example4=example5
and the URL code is https%3A%2F%2Fwww.example1.com%2Fcn%2F
%3Fexample2%3Dexample3%26example4%3Dexample5, the URL of the
authorization request API combined by the third-party app is as follows:
https://oauth2.fusionsolar.huawei.com/rest/dp/uidm/oauth2/v1/authorize?
response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example1.com%2Fcn%2F
%3Fexample2%3Dexample3%26example4%3Dexample5
On this page, the owner can select a permission set to authorize the OAuth 2.0
client of the third-party app. After the owner completes the authorization, an
authorization code is generated. The third-party app can obtain the authorization
code based on the RedirectUrl provided for the FusionSolar when applying for an
OAuth 2.0 client. For example, if the authorization code is B******B, the response
example is as follows:
https://www.example.com/cn/?code=B******B
If the owner rejects the authorization, the third-party app can obtain the following
information through RedirectUrl:
https://www.example.com/cn/?error=10002&error_description=access_is_denied
https://www.example.com/cn/?error=invalid_scope&error_description=OAuth
%202.0%20Parameter:%20scope
For more exception examples and troubleshooting methods, see 8.1.1 Handling
the Exception Returned by Calling the Authorization Request API.
3.1.2.3 Obtaining the Access Token of the Open API by a Third-Party App
After obtaining the authorization code from the RedirectUrl, the third-party app
needs to access the OAuth service again, request the token obtaining API provided
by the OAuth service to obtain the access token and refresh token based on the
authorization code, and select the permission set to be authorized by the owner to
the third-party app.
The following table describes the request parameters for obtaining the access
token using the refresh token.
token_type String Type of the returned access token. The value is fixed
at Bearer.
The following table describes the parameters in the response packet for obtaining
the access token using the refresh token.
token_type String Type of the returned access token. The value is fixed
at Bearer.
Example Request and Response for Obtaining the Access Token and Refresh
Token Using the Authorization Code
Example Request
Assume that the parameters of the OAuth 2.0 client created by a third-party app
on the FusionSolar are as follows: RedirectUrl = https://www.example.com/cn/,
grant_type=authorization_code&
code=B******B&
client_id=123456789&
client_secret=A******A&
redirect_uri=https://www.example.com/cn/
Response Example
After the owner authorizes a third-party app, assume that the parameters
obtained by the third-party app using the authorization code are as follows: AT =
a******t, RT = r******t, scope = pvms.openapi.basic and pvms.openapi.control.
The response example for obtaining the access token and refresh token using the
authorization code is as follows:
HTTP/1.1 200 OK
{
"access_token": "a******t",
"refresh_token":"r******t",
"expires_in": 3600,
"scope": "pvms.openapi.basic pvms.openapi.control",
"token_type": "Bearer"
}
grant_type=refresh_token&
refresh_token=r******t&
client_id=123456789&
client_secret=A******A
Response Example
If the third-party app uses the refresh token r******t to obtain a new access token
and the obtained new access token is b******b, an example response for obtaining
the access token using the refresh token is as follows:
HTTP/1.1 200 OK
{
"access_token": "b******b",
"refresh_token":"r******t",
"expires_in": 3600,
"scope": "pvms.openapi.basic pvms.openapi.control",
"token_type": "Bearer"
}
For more exception examples and troubleshooting methods, see 8.1.2 Handling
the Exception Returned by Calling the Token Obtaining API.
CAUTION
After the owner initiates authorization on the third-party app client, the third-
party app obtains the authorization tokens (access token and refresh token)
through the OAuth 2.0 authorization process. When an owner initiates
incremental authorization through a third-party app client, the old authorization
tokens automatically become invalid after the third-party app successfully obtains
new authorization tokens. It is recommended that an owner performs
incremental authorization on third-party apps through the FusionSolar app.
Access Process
After adapting to the OAuth Connect mode, the third-party app obtains the
owner's authorization and the access token. The access token must be carried
when the app accesses specific data. The third-party app calls APIs to access the
specific data as required in the following process.
Access Example
The following uses the Plant List API as an example to describe how to access
FusionSolar open APIs in OAuth Connect mode. After obtaining the access token,
the third-party app carries it to access the plant list API.
Request example:
POST https://Domain name of the management system/thirdData/stations
Authorization: access token obtained by the bearer
Content-Type: application/json
Body:
{
"pageNo": 1,
"gridConnectedStartTime":1664718569000,
"gridConnectedEndTime":1667396969000
}
Response examples:
Example 1: An error code is returned.
{
"success": false,
"data": null,
"failCode": 20605,
"message": "The time cannot be a negative number."
}
Example 3: The access token is invalid and cannot be used to parse the
authorization information. The following error information is displayed.
{
"success": false,
"failCode": 305,
"message": "INVALID_CREDENTIAL"
}
Examples 1 and 2 show access to the Plant List API in OAuth Connect mode. The
returned information varies according to the API internal services. Examples 3 and
4 indicate that the access token is invalid and the access token permission is
insufficient, respectively. For details about how to handle these exceptions, see
8.1.3 Why Does the Northbound API Return Error Code 305? and 8.1.4 Why
Does the Northbound API Return Error Code 401?
NOTICE
The following figure shows an example of the access token carried in the request
header of a northbound open API. (The value of the Authorization field consists
of Bearer and Access Token. The Plant List API is used as an example.)
NOTE
1. After the third-party system information is configured on the management system, use
the API account name and password to log in to the management system from the
third-party system.
2. After successful login, send requests to obtain data.
3. XSRF-TOKEN is a cross-site request token. After a user logs in to the system using the
API account name and password, the system returns this token to the user. If the user
adds the token to a subsequent request, the request is initiated by a logged-in API
account.
Step 1 Choose System > Company Management > Northbound Management from the
main menu.
Step 2 Click Add. In the dialog box that is displayed, set basic information, such as
Associated account, Username, and Password.
Step 3 If you enable Basic APIs in the APIs area, the API account has the permission to
access basic API data of northbound open APIs.
NOTE
Step 4 Optional: Select the company or plant for which you want to grant permission.
After the binding, the API account has permissions of the selected company or
plant.
----End
API Description
● Before obtaining data, the login API must be called to obtain the XSRF-
TOKEN. The validity period of XSRF-TOKEN is 30 minutes.
● If the XSRF-TOKEN does not expire, it can be reused. If the XSRF-TOKEN has
expired, the login API needs to be called again to obtain a new XSRF-TOKEN.
● After this API is called to log in to the system, XSRF-TOKEN is returned in the
response header.
● A new token is generated each time this API is called, and the previously
obtained token becomes invalid.
Request URL
https://Domain name of the management system/thirdData/login
Request Mode
HTTP method: POST
Access Restrictions
If an API account enters incorrect passwords for five consecutive times within 10
minutes, the API account will be locked out for 30 minutes.
Maximum number of API calls for each API account: five times every 10 minutes.
If the access frequency exceeds the limit, the API returns error code 407.
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
currentTime Current system time, in Long -
milliseconds
Example
Request example:
{
"userName":"*******",
"systemCode":"*******"
}
Response example:
Example 1: successful login
{
"success":true,
"data":null,
"failCode":0,
"params":null,
"message":null
}
NOTICE
The header of the login success response contains the XSRF-TOKEN that must be
retained. In subsequent data API requests, this parameter and its value must be
added to the request header and sent to the management system.
Login example:
The following are examples of the XSRF-TOKEN returned after a successful login.
You can obtain the XSRF-TOKEN using either of the following methods. The first
one is recommended.
The following figure shows an example of the XSRF-TOKEN carried in the request
header of the data API.
API Description
If you want the XSRF-TOKEN to expire immediately, you can call this API.
Request URL
https://Domain name of the management system/thirdData/logout
Request Mode
HTTP method: POST
Access Restrictions
Maximum number of API calls for each API account: five times every 10 minutes.
You are advised to call this API only when necessary.
If the access frequency exceeds the limit, the API returns error code 407.
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
currentTime Current system time, in Long -
milliseconds
Example
Request example:
{
"xsrfToken":"x-
apepjy1fpd2ptete1f7zuqimep7wuqen9hkb3xaourelbyrx9jio7s09hgk6ca2mdlksjdglasdhjaklsdfhhdsahwedyuio
qwehjkd"
}
Response example:
Example 1: successful logout
{
"success":true,
"data":null,
"failCode":0,
"params":{
"currentTime":1503046597854
},
"message":null
}
NOTE
Logout example:
Access Process
Log in to the API on the third-party system and obtain the xsrf-token used for
identity authentication. The xsrf-token must be carried when specific data is
accessed. The third-party app calls APIs to access the specific data as required in
the following process.
Access Example
Step 1 Create an API account on the management system and bind the account to a PV
plant. For details, see 3.2.1 Obtaining an Account.
Step 2 Obtain the login credential xsrf-token by referring to 3.2.2.1 Login API. The xsrf-
token can be reused if it is valid. For details about the validity period of the xsrf-
token, see API Description.
Step 3 Content-Type: application/json
Enter the login credential xsrf-token in the request header to access the
corresponding API to obtain data.
----End
The system provides the API flow control mechanism to prevent system
performance deterioration caused by improper API invoking. If the maximum flow
volume is exceeded, this API cannot be called and the error code 407 is returned.
NOTICE
The flow control mechanism may be modified with the system evolution in the
future without notice. Obtain the latest API document to view the API flow control
mechanism.
When the API flow is limited, the system displays the reason for the flow control
through the error code (failCode). Wait until the API returns a normal response
and call the API again.
● Error code 407: The number of API calls of a single user exceeds the upper
limit. For details about the limits on API calls, see "Access Restrictions" in the
corresponding API description. When this error code is returned by an API,
lower your frequency of calls to this API until the frequency drops to the
allowed range.
● Error code 403/429: When a large number of users initiate calls to the same
API, the total number of calls to the API exceeds the upper limit at the system
level. If this error message is received, wait for 1 minute and try again. If the
error persists, wait for a longer time and try again. You can also minimize the
number of calls.
Northbound open APIs support the following access modes. For details about flow
control in OAuth Connect mode, see 4.1 Flow Control Policy in OAuth Connect
Mode. For details about flow control using an API account, see 4.2 Flow Control
Using the API Account.
Bas Basic Plant list Maximum number of API calls for each API
ic data account per day = Roundup (Number of plants/
API 100) x 10 + 24
s Example:
● If an API account manages 20 plants, the
maximum number of API calls per day =
Roundup (20/100) x 10 + 24 = 1 x 10 + 24 = 34.
● If an API account manages 120 plants, the
maximum number of API calls per day =
Roundup (120/100) x 10 + 24 = 2 x 10 + 24 =
44.
Con Batte Delivering Call the API only when necessary to reduce the
trol ry battery access frequency.
API confi charge/ For the same plant, do not call this API repeatedly
s gurat discharge before a task is complete.
ion tasks
Maximum number of API calls for each API
account: once per minute.
Invert API for Call the API only when necessary to reduce the
er delivering access frequency.
activ an inverter For the same plant, do not call this API repeatedly
e active power before a task is complete.
powe setting task
r Maximum number of API calls for each API
contr account: once per minute.
ol
API for Call the API only when necessary to reduce the
querying an access frequency.
inverter For the same plant, do not call this API repeatedly
active power before a task is complete.
setting task
Maximum number of API calls for each API
account: once per minute.
Settin API for Call the API only when necessary to reduce the
g the Delivering a access frequency.
batte Task for For the same plant, do not call this API repeatedly
ry Setting the before a task is complete.
worki Battery
ng Working Maximum number of API calls for each API
mode Mode account: once per minute.
API for Call the API only when necessary to reduce the
Querying a access frequency.
Task for For the same plant, do not call this API repeatedly
Setting the before a task is complete.
Battery
Working Maximum number of API calls for each API
Mode account: once per minute.
Batte API for Call the API only when necessary to reduce the
ry Delivering a access frequency.
para Task for For the same plant, do not call this API repeatedly
mete Setting before a task is complete.
r Battery
settin Parameters Maximum number of API calls for each API
g account: once per minute.
API for Call the API only when necessary to reduce the
Querying a access frequency.
Task for For the same plant, do not call this API repeatedly
Setting before a task is complete.
Battery
Parameters Maximum number of API calls for each API
account: once per minute.
5 API Reference
5.1.1 Basic
API Description
This API is used to query the plant list. When the pagination parameters (a
maximum of 100 records can be displayed on each page) and grid connection
time are transferred (if only the grid connection start time is transferred, the grid
connection end time is the current time by default; if only the grid connection end
time is transferred, the default grid connection start time is 1970-01-01 08:00:00),
the plant list is queried in pages based on the grid connection time. When only
the pagination parameter is transferred, the plant list is queried in pages.
CAUTION
If no data is queried or only some data is returned when the plant list API is used,
rectify the fault by referring to 8.3 Why Is No Data or Only Part of Data Found
When I Call a Northbound API for Data Query?
If the returned plant ID is inconsistent with that displayed on the SmartPVMS,
rectify the fault by referring to 8.8 Why Is the Plant ID Returned by the Plant
List Inconsistent with That Displayed on the SmartPVMS?
If the plant IDs returned vary depending on open API users, rectify the fault by
referring to 8.9 Why Do the Plant IDs Returned for the Same Plant Vary
Depending on Open API Users?
Request URL
https://Domain name of the management system/thirdData/stations
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remarks
Type
Examples
Request example:
{
"pageNo": 1,
"gridConnectedStartTime":1664718569000,
"gridConnectedEndTime":1667396969000
}
Response examples:
Example 1: An error code is returned.
{
"success": false,
"data": null,
"failCode": 20605,
"message": "The time cannot be a negative number."
}
"data": {
"list": [
{
"plantCode": "NE=12345678",
"plantName": "NMplant1",
"plantAddress": null,
"longitude": null,
"latitude": null,
"capacity": 146.5,
"contactPerson": "",
"contactMethod": "",
"gridConnectionDate": "2022-11-21T16:23:00+08:00"
},
{
"plantCode": "NE=23456789",
"plantName": "plant2",
"plantAddress": null,
"longitude": null,
"latitude": null,
"capacity": 123.3,
"contactPerson": "",
"contactMethod": "",
"gridConnectionDate": "2022-11-21T16:30:28-12:00"
}
],
"pageCount": 1,
"pageNo": 1,
"pageSize": 100,
"total": 2
},
"failCode": 0,
"message": "get plant list success"
}
API Description
This API is used to obtain basic device information. Before invoking other APIs to
obtain device data, you need to call this API to obtain the device ID.
When you query devices by plant ID set, devices of a maximum of 100 plants can
be queried at a time.
CAUTION
If no data is queried or only some data is returned when the device list API is
used, rectify the fault by referring to 8.3 Why Is No Data or Only Part of Data
Found When I Call a Northbound API for Data Query?
Request URL
https://Domain name of the management system/thirdData/getDevList
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter
id Device ID Long -
Examples
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5"
}
Response examples:
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
5.1.2 Monitoring
API Description
This API is used to obtain real-time plant data by plant ID set. Data of a maximum
of 100 plants can be queried at a time.
For details about the data list that can be queried through this API, see the real-
time plant data list below.
Request URL
https://Domain name of the management system/thirdData/getStationRealKpi
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Type Remark
s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter
Example
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5"
}
Response example:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"currentTime":1503046597854
},
"message":null
}
"real_health_state":"3",
"day_power":"10000",
"total_power":"900.000",
"day_income":"0.000",
"month_power":"900.000",
"total_income":"2088.000"
},
"stationCode":"BA4372D08E014822AB065017416F254C"
},
{
"dataItemMap":{
"real_health_state":"1",
"day_power":"16770.000",
"total_power":"35100.000",
"day_income":"26832.000",
"month_power":"35100.000",
"total_income":"61152.000"
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5"
}
],
"failCode":0,
"params":{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"currentTime":1503046597854
},
"message":null
}
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain real-time device data by device type and device ID set.
The data varies depending on device types. Data of a maximum of 100 devices of
the same type can be queried at a time.
For details about the data list that can be queried through this API, see the real-
time device data list below.
Request URL
https://Domain name of the management system/thirdData/getDevRealKpi
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
devIds List of device IDs. The device IDs are String Optional
obtained from id in 5.1.1.2 Device List
API. Use commas (,) to separate multiple
device IDs. Either sns or devIds must be
set.
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
devIds Device ID list in the request String -
parameter
sn Device SN String
efficiency Inverter % Do
conversion ubl
efficiency e
(manufacturer)
temperature Internal °C Do
temperature ubl
e
close_time Inverter ms Do
shutdown time ubl
e
efficiency Inverter % Do
conversion ubl
efficiency e
(manufacturer)
temperature Internal °C Do
temperature ubl
e
close_time Inverter ms Do
shutdown time ubl
e
max_charge_po Maximum W Do
wer charge power ubl
e
max_discharge_ Maximum W Do
power discharge power ubl
e
ch_discharge_po Charge/ W Do
wer Discharge power ubl
e
ac_current AC current A Do
ubl
e
ac_frequency AC frequency Hz Do
ubl
e
inverter_frequen Inverter Hz Do
cy frequency ubl
e
ac_output_volta AC output V Do
ge voltage ubl
e
ac_output_curre AC output A Do
nt current ubl
e
ac_output_frequ AC output kW Do
ency frequency ubl
e
soc SOC % Do
ubl
e
charge_discharg Charge/ kW Do
e_power Discharge power ubl
e
voltage Voltage V Do
ubl
e
current Current A Do
ubl
e
remaining_back Remaining h Do
up_time power reserve ubl
duration e
0 Standby: initializing
256 Start
512 Grid-connected
Examples
Request example:
{
"devIds":"214060404588862,213472461631079",
"devTypeId":"1"
}
"mppt_7_cap":0,
"mppt_8_cap":0,
"mppt_9_cap":0,
"mppt_10_cap":0,
"pv4_u":0,
"close_time":0,
"day_cap":0,
"ca_u":0,
"a_i":0,
"pv5_u":0,
"a_u":0,
"pv3_u":0,
"pv14_u":0,
"pv14_i":0,
"pv15_u":0,
"pv15_i":0,
"pv16_u":0,
"pv16_i":0,
"pv17_u":0,
"pv17_i":0,
"pv18_u":0,
"pv18_i":0,
"pv19_u":0,
"pv19_i":0,
"pv20_u":0,
"pv20_i":0,
"pv21_u":0,
"pv21_i":0,
"pv22_u":0,
"pv22_i":0,
"pv23_u":0,
"pv23_i":0,
"pv24_u":0,
"pv24_i":0,
"pv25_u":0,
"pv25_i":0,
"pv26_u":0,
"pv26_i":0,
"pv27_u":0,
"pv27_i":0,
"pv28_u":0,
"pv28_i":0,
"efficiency":0,
"pv2_u":0
},
"devId":213472461631079
},
{
"dataItemMap":{
"pv7_u":0,
"pv1_u":0,
"b_u":0,
"c_u":0,
"pv6_u":0,
"temperature":0,
"open_time":0,
"b_i":0,
"bc_u":0,
"pv9_u":0,
"pv8_u":0,
"c_i":0,
"mppt_total_cap":0,
"pv9_i":0,
"mppt_3_cap":0,
"run_state":0,
"mppt_2_cap":0,
"inverter_state":0,
"pv8_i":0,
"mppt_1_cap":0,
"pv6_i":0,
"mppt_power":0,
"pv1_i":0,
"total_cap":0,
"ab_u":0,
"pv7_i":0,
"pv13_u":0,
"reactive_power":0,
"pv10_u":0,
"pv12_i":0,
"pv11_i":0,
"pv3_i":0,
"pv11_u":0,
"pv2_i":0,
"pv13_i":0,
"power_factor":0,
"pv12_u":0,
"pv5_i":0,
"active_power":0,
"elec_freq":0,
"pv10_i":0,
"pv4_i":0,
"mppt_4_cap":0,
"mppt_5_cap":0,
"mppt_6_cap":0,
"mppt_7_cap":0,
"mppt_8_cap":0,
"mppt_9_cap":0,
"mppt_10_cap":0,
"pv4_u":0,
"close_time":0,
"day_cap":0,
"ca_u":0,
"a_i":0,
"pv5_u":0,
"a_u":0,
"pv3_u":0,
"pv14_u":0,
"pv14_i":0,
"pv15_u":0,
"pv15_i":0,
"pv16_u":0,
"pv16_i":0,
"pv17_u":0,
"pv17_i":0,
"pv18_u":0,
"pv18_i":0,
"pv19_u":0,
"pv19_i":0,
"pv20_u":0,
"pv20_i":0,
"pv21_u":0,
"pv21_i":0,
"pv22_u":0,
"pv22_i":0,
"pv23_u":0,
"pv23_i":0,
"pv24_u":0,
"pv24_i":0,
"pv25_u":0,
"pv25_i":0,
"pv26_u":0,
"pv26_i":0,
"pv27_u":0,
"pv27_i":0,
"pv28_u":0,
"pv28_i":0,
"efficiency":0,
"pv2_u":0
},
"devId":214060404588862
}
],
"failCode":0,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":"1",
"currentTime":1503046597854
},
"message":null
}
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain 5-minute device data in a specified time period. The 5-
minute data of a maximum of 10 devices of the same type in three days can be
queried at a time.
For details about the data list that can be queried through this API, see the
historical device data list below.
Request URL
https://Domain name of the management system/thirdData/getDevHistoryKpi
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
devIds List of device IDs. The device IDs are String Optional
obtained from id in 5.1.1.2 Device List
API. Use commas (,) to separate multiple
device IDs. Either sns or devIds must be
set.
devTypeId Device type ID. Use the device type ID Integer Mandato
obtained in 5.1.1.2 Device List API. ry
The following device types are supported:
1: string inverter
10: EMI
17: grid meter
38: residential inverter
39: battery
41: ESS
47: power sensor
60001: mains
60003: genset
60043: SSU group
60014: lithium battery rack
60010: AC output power distribution
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
devIds Device ID list in the request String -
parameter
sn Device SN String
efficiency Inverter % Do
conversion ubl
efficiency e
(manufacturer)
temperature Internal °C Do
temperature ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 100
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 101
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 102
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 103
SmartPVMS
NBI Reference 5 API Reference
close_time Inverter ms Do
shutdown time ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 104
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 105
SmartPVMS
NBI Reference 5 API Reference
efficiency Inverter % Do
conversion ubl
efficiency e
(manufacturer)
temperature Internal °C Do
temperature ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 106
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 107
SmartPVMS
NBI Reference 5 API Reference
close_time Inverter ms Do
shutdown time ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 108
SmartPVMS
NBI Reference 5 API Reference
pv_temperature PV temperature °C Do
ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 109
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 110
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 111
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 112
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 113
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 114
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 115
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 116
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 117
SmartPVMS
NBI Reference 5 API Reference
max_charge_po Maximum W Do
wer charge power ubl
e
max_discharge_ Maximum W Do
power discharge power ubl
e
ch_discharge_po Charge/ W Do
wer Discharge power ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 118
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 119
SmartPVMS
NBI Reference 5 API Reference
ac_current AC current A Do
ubl
e
ac_frequency AC frequency Hz Do
ubl
e
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 120
SmartPVMS
NBI Reference 5 API Reference
0 Standby: initializing
256 Start
512 Grid-connected
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 121
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example:
{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"startTime":1501862400000,
"endTime":1501872400000
}
Response examples:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"startTime":1501862400000,
"endTime":1501872400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 122
SmartPVMS
NBI Reference 5 API Reference
"pv8_u":null,
"c_i":25,
"mppt_total_cap":null,
"pv9_i":null,
"mppt_3_cap":null,
"mppt_2_cap":null,
"inverter_state":512,
"pv8_i":null,
"mppt_1_cap":null,
"pv6_i":7.1,
"mppt_power":21.962,
"pv1_i":7.1,
"total_cap":655.37,
"ab_u":495.4,
"pv7_i":null,
"pv13_u":null,
"reactive_power":20.95,
"pv10_u":null,
"pv12_i":null,
"pv11_i":null,
"pv3_i":7.1,
"pv11_u":null,
"pv2_i":7.1,
"pv13_i":null,
"power_factor":0,
"pv12_u":null,
"pv5_i":7.2,
"active_power":21.05,
"elec_freq":50.05,
"pv10_i":null,
"pv4_i":7,
"mppt_4_cap":null,
"mppt_5_cap":0,
"mppt_6_cap":0,
"mppt_7_cap":0,
"mppt_8_cap":0,
"mppt_9_cap":0,
"mppt_10_cap":0,
"pv4_u":577.8,
"close_time":null,
"day_cap":159.26,
"ca_u":496.9,
"a_i":24.9,
"pv5_u":576.1,
"a_u":286,
"pv3_u":577.8,
"pv14_u":null,
"pv14_i":null,
"pv15_u":0,
"pv15_i":0,
"pv16_u":0,
"pv16_i":0,
"pv17_u":0,
"pv17_i":0,
"pv18_u":0,
"pv18_i":0,
"pv19_u":0,
"pv19_i":0,
"pv20_u":0,
"pv20_i":0,
"pv21_u":0,
"pv21_i":0,
"pv22_u":0,
"pv22_i":0,
"pv23_u":0,
"pv23_i":0,
"pv24_u":0,
"pv24_i":0,
"pv25_u":0,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 123
SmartPVMS
NBI Reference 5 API Reference
"pv25_i":0,
"pv26_u":0,
"pv26_i":0,
"pv27_u":0,
"pv27_i":0,
"pv28_u":0,
"pv28_i":0,
"efficiency":null,
"pv2_u":575.3
},
"devId":213472461631079,
"collectTime":1501862400000
},
{
"dataItemMap":{
"pv7_u":null,
"pv1_u":575.3,
"b_u":286.1,
"c_u":286.9,
"pv6_u":576.1,
"temperature":44.6,
"open_time":null,
"b_i":24.9,
"bc_u":495.6,
"pv9_u":null,
"pv8_u":null,
"c_i":25,
"mppt_total_cap":null,
"pv9_i":null,
"mppt_3_cap":null,
"mppt_2_cap":null,
"inverter_state":512,
"pv8_i":null,
"mppt_1_cap":null,
"pv6_i":7.1,
"mppt_power":21.962,
"pv1_i":7.1,
"total_cap":655.37,
"ab_u":495.4,
"pv7_i":null,
"pv13_u":null,
"reactive_power":20.95,
"pv10_u":null,
"pv12_i":null,
"pv11_i":null,
"pv3_i":7.1,
"pv11_u":null,
"pv2_i":7.1,
"pv13_i":null,
"power_factor":0,
"pv12_u":null,
"pv5_i":7.2,
"active_power":21.05,
"elec_freq":50.05,
"pv10_i":null,
"pv4_i":7,
"mppt_4_cap":null,
"mppt_5_cap":0,
"mppt_6_cap":0,
"mppt_7_cap":0,
"mppt_8_cap":0,
"mppt_9_cap":0,
"mppt_10_cap":0,
"pv4_u":577.8,
"close_time":null,
"day_cap":159.26,
"ca_u":496.9,
"a_i":24.9,
"pv5_u":576.1,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 124
SmartPVMS
NBI Reference 5 API Reference
"a_u":286,
"pv3_u":577.8,
"pv14_u":null,
"pv14_i":null,
"pv15_u":0,
"pv15_i":0,
"pv16_u":0,
"pv16_i":0,
"pv17_u":0,
"pv17_i":0,
"pv18_u":0,
"pv18_i":0,
"pv19_u":0,
"pv19_i":0,
"pv20_u":0,
"pv20_i":0,
"pv21_u":0,
"pv21_i":0,
"pv22_u":0,
"pv22_i":0,
"pv23_u":0,
"pv23_i":0,
"pv24_u":0,
"pv24_i":0,
"pv25_u":0,
"pv25_i":0,
"pv26_u":0,
"pv26_i":0,
"pv27_u":0,
"pv27_i":0,
"pv28_u":0,
"pv28_i":0,
"efficiency":null,
"pv2_u":575.3
},
"devId":213472461631079,
"collectTime":1501862700000
}
],
"failCode":0,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"startTime":1501862400000,
"endTime":1501872400000,
"currentTime":1503046597854
},
"message":null
}
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
5.1.3 Alarm
API Description
This API is used to query the current (active) alarm information of a device. If the
query is based on plants, a maximum of 100 plants can be queried at a time. If
the query is based on device SNs, a maximum of 100 devices can be queried at a
time. If the transferred plant ID list is not empty, device alarm information is
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 125
SmartPVMS
NBI Reference 5 API Reference
queried based on the plant ID list. If the plant ID list is empty and the device SN
list is not empty, device alarm information is queried based on the device SN list.
Request URL
https://Domain name of the management system/thirdData/getAlarmList
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 126
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 127
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 128
SmartPVMS
NBI Reference 5 API Reference
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 129
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 130
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"stationCodes":"NE=33554785,NE=33554792",
"sns":"Inverter01",
"beginTime":"1664553600000",
"endTime":"1667231999000",
"language":"zh_CN",
"levels":"1,2,3,4",
"devTypes":"1,2,38,46,62"
}
Response examples:
Example 1: An error code is returned.
{
"data": null,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 131
SmartPVMS
NBI Reference 5 API Reference
"failCode": 20055,
"message": null,
"params": {
"currentTime": 1667399781133,
"sns": "",
"language": "zh_CN",
"beginTime": 1664553600000,
"devTypes": "1,2,38,46,62",
"endTime": 1667231999000,
"levels": "1,2,3,4",
"stationCodes": ""
},
"success": false
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 132
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
5.1.4 Report
API Description
This API is used to obtain hourly plant data. Data of a maximum of 100 plants can
be queried at a time.
The backend calculates the date of the collection time based on the request
parameter collectTime (collection time in milliseconds) and the time zone where
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 133
SmartPVMS
NBI Reference 5 API Reference
the plant is located. Then, you can query the hourly data of the plant by plant ID
in the current day. If data is generated for n (0 ≤ n ≤ 24) hours of the day, n (0 ≤ n
≤ 24) results are returned.
For details about the data list that can be queried through this API, see the hourly
plant data list below.
Request URL
https://Domain name of the management system/thirdData/getKpiStationHour
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 134
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 135
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000
}
Response example:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 136
SmartPVMS
NBI Reference 5 API Reference
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501866000000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"BA4372D08E014822AB065017416F254C",
"collectTime":1501873200000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501876800000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501880400000
},
{
"dataItemMap":{
"radiation_intensity":null,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 137
SmartPVMS
NBI Reference 5 API Reference
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501884000000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501887600000
},
{
"dataItemMap":{
"radiation_intensity":null,
"theory_power":null,
"inverter_power":0,
"ongrid_power":null,
"power_profit":0,
"chargeCap":null,
"dischargeCap":null,
"selfProvide":null,
},
"stationCode":"BA4372D08E014822AB065017416F254C",
"collectTime":1501887600000
}
],
"failCode":0,
"params":{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 138
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain daily plant data. Data of a maximum of 100 plants can
be queried at a time.
The backend calculates the month of the collection time based on the request
parameter collectTime (collection time in milliseconds) and the time zone where
the plant is located. Then, you can query the daily data of the plant by plant ID in
the current month. If data is generated for n (0 ≤ n ≤ 31) days of the month, n (0
≤ n ≤ 31) results are returned.
For details about the data list that can be queried through this API, see the daily
plant data list below.
Request URL
https://{Domain name of the management system}/thirdData/getKpiStationDay
Request Mode
HTTP method: POST
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 139
SmartPVMS
NBI Reference 5 API Reference
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 140
SmartPVMS
NBI Reference 5 API Reference
performance_rat Performance %
io ratio
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 141
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000
}
Response examples:
Example 1: An error code is returned.
{
"data": null,
"failCode": 20012,
"message": null,
"params": {
"currentTime": 1687788735543,
"collectTime": -1677051223000,
"stationCodes": "BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5"
},
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 142
SmartPVMS
NBI Reference 5 API Reference
"success": false
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 143
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain monthly plant data. Data of a maximum of 100 plants
can be queried at a time.
The backend calculates the year of the collection time based on the request
parameter collectTime (collection time in milliseconds) and the time zone where
the plant is located. Then, you can query the monthly data of the plant by plant
ID in the current year. If data is generated for n (0 ≤ n ≤ 12) months of the year, n
(0 ≤ n ≤ 12) results are returned.
For details about the data list that can be queried through this API, see the
monthly plant data list below.
Request URL
https://{Domain name of the management system}/thirdData/getKpiStationMonth
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 144
SmartPVMS
NBI Reference 5 API Reference
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 145
SmartPVMS
NBI Reference 5 API Reference
performance_rat Performance %
io ratio
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 146
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000
}
Response examples:
Example 1: An error code is returned.
{
"data": null,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 147
SmartPVMS
NBI Reference 5 API Reference
"failCode": 20012,
"message": null,
"params": {
"currentTime": 1687788735543,
"collectTime": -1677051223000,
"stationCodes": "BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5"
},
"success": false
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 148
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain yearly plant data. Data of a maximum of 100 plants can
be queried at a time.
Based on the plant ID, the backend queries the data of each year since the plant
was constructed (including the current year).
For details about the data list that can be queried through this API, see the yearly
plant data list below.
Request URL
https://Domain name of the management system/thirdData/getKpiStationYear
Request Mode
HTTP method: POST
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 149
SmartPVMS
NBI Reference 5 API Reference
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
stationCodes Plant ID list in the request String -
parameter
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 150
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 151
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000
}
Response examples:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"stationCodes":"BA4372D08E014822AB065017416F254C,5D02E8B40AD342159AC8D8A2BCD4FAB5",
"collectTime":1501862400000,
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 152
SmartPVMS
NBI Reference 5 API Reference
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 153
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain daily device data. The daily data of a maximum of 100
devices of the same type can be queried at a time.
The backend calculates the month of the collection time based on the request
parameter collectTime (collection time in milliseconds) and the time zone where
the device is located. Then, you can query the daily data of the device by device ID
in the current month. If data is generated for n (0 ≤ n ≤ 31) days of the month, n
(0 ≤ n ≤ 31) results are returned.
For details about the data list that can be queried through this API, see the daily
device data list below.
Request URL
https://Domain name of the management system/thirdData/getDevKpiDay
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 154
SmartPVMS
NBI Reference 5 API Reference
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
devIds List of device IDs. The device IDs are String Optional
obtained from id in 5.1.1.2 Device List
API. Use commas (,) to separate multiple
device IDs. Either sns or devIds must be
set.
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 155
SmartPVMS
NBI Reference 5 API Reference
sn Device SN String
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 156
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example:
{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000
}
Response example:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 157
SmartPVMS
NBI Reference 5 API Reference
"product_power":300
},
"devId":213472461631079,
"collectTime":1501776000000
},
{
"dataItemMap":{
"installed_capacity":30.24,
"perpower_ratio":0.543,
"product_power":16.43
},
"devId":214060404588862,
"collectTime":1501776000000
}
],
"failCode":0,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 158
SmartPVMS
NBI Reference 5 API Reference
API Description
This API is used to obtain monthly device data. The monthly data of a maximum
of 100 devices of the same type can be queried at a time.
The backend calculates the year of the collection time based on the request
parameter collectTime (collection time in milliseconds) and the time zone where
the device is located. Then, you can query the monthly data of the device by
device ID in the current year. If data is generated for n (0 ≤ n ≤ 12) months of the
year, n (0 ≤ n ≤ 12) results are returned.
For details about the data list that can be queried through this API, see the
monthly device data list below.
Request URL
https://Domain name of the management system/thirdData/getDevKpiMonth
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
devIds List of device IDs. The device IDs are String Optional
obtained from id in 5.1.1.2 Device List
API. Use commas (,) to separate multiple
device IDs. Either sns or devIds must be
set.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 159
SmartPVMS
NBI Reference 5 API Reference
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
devIds Device ID list in the request String -
parameter
sn Device SN String
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 160
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example:
{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 161
SmartPVMS
NBI Reference 5 API Reference
Response example:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 162
SmartPVMS
NBI Reference 5 API Reference
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
API Description
This API is used to obtain yearly device data. The yearly data of a maximum of
100 devices of the same type can be queried at a time.
The backend queries the data of each year since the device was connected based
on the device ID.
For details about the data list that can be queried using this API, see #EN-
US_TOPIC_0000001701648221/p2057810145254.
Request URL
https://Domain name of the management system/thirdData/getDevKpiYear
Request Mode
HTTP method: POST
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 163
SmartPVMS
NBI Reference 5 API Reference
Request Parameters
Parameter Description Data Mandato
Type ry/
Optional
devIds List of device IDs. The device IDs are String Optional
obtained from id in 5.1.1.2 Device List
API. Use commas (,) to separate multiple
device IDs. Either sns or devIds must be
set.
NOTE
Response Packet
Parameter Description Data Remark
Type s
param Parameters - - -
s
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 164
SmartPVMS
NBI Reference 5 API Reference
sn Device SN String
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 165
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example:
{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000
}
Response example:
Example 1: An error code is returned.
{
"success":false,
"data":null,
"failCode":20009,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 166
SmartPVMS
NBI Reference 5 API Reference
"data":[
{
"dataItemMap":{
"installed_capacity":30.24,
"perpower_ratio":null,
"product_power":300
},
"devId":213472461631079,
"collectTime":1501516800000
}
],
"failCode":0,
"params":{
"devIds":"214060404588862,213472461631079",
"devTypeId":1,
"collectTime":1501862400000,
"currentTime":1503046597854
},
"message":null
}
NOTE
Prerequisites for obtaining data: The API account has the permission to access this API.
Request example:
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 167
SmartPVMS
NBI Reference 5 API Reference
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v2/
control/charge-and-discharge/async-task
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 168
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 169
SmartPVMS
NBI Reference 5 API Reference
NOTICE
● This API will change the device running parameters. Exercise caution when
invoking this API.
● The LG battery does not support SOC control.
● When a task is not complete (that is, the status bit is 1), the same signals
cannot be sent to the device corresponding to the task.
● This API can only be used to control the residential ESS.
● When the battery is disconnected, charge and discharge tasks cannot be
delivered to the battery.
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 170
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example (the first task is time control and the second task is SOC
control.)
{
"tasks": [
{
"plantCode": "NE=12345678",
"dispatchSwitch": 1,
"controlType": 2,
"dispatchTime": 600,
"powerDispatch": 5000
},
{
"plantCode": "NE=23456789",
"dispatchSwitch": 1,
"controlType": 1,
"targetSOC": 100,
"powerDispatch": 5000
}
]
}
Response examples:
Example 1: The task fails.
{
"data": null,
"failCode": 2,
"message": "Battery charge and discharge task list is empty.",
"success": false
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 171
SmartPVMS
NBI Reference 5 API Reference
"result": [
{
"plantCode": "NE=12345678",
"sn": null,
"dispatchResult": 1,
"subTaskId": null,
"description": "PowerDispatch is illegal. The value should be greater than 0 during forced charge
(dispatchSwitch = 1) and smaller than 0 during forced discharge (dispatchSwitch = 2)."
},
{
"plantCode": "NE=23456789",
"sn": null,
"dispatchResult": 1,
"subTaskId": null,
"description": "DispatchSwitch is illegal, valid value: 0 or 1 or 2"
}
]
},
"failCode": 2,
"message": "Failed to deliver the battery charge/discharge task.",
"success": false
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 172
SmartPVMS
NBI Reference 5 API Reference
}
]
},
"failCode": 0,
"message": "The battery charge/discharge task is delivered successfully.",
"success": true
}
Request URL
https://Domain name of the management system/rest/openapi/pvms/v1/vpp/
chargeAndDischargeStatus
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
NOTICE
● If the charging and discharging task information of the battery in the plant
changes, the task is processed as an exception (status is 0). The exception
information is described in message.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 173
SmartPVMS
NBI Reference 5 API Reference
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 174
SmartPVMS
NBI Reference 5 API Reference
Examples
Request example:
{
"requestID": 432523532523
}
Response examples:
Example 1: An error code is returned.
{
"success": false,
"data": null,
"failCode": 20008,
"message": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 175
SmartPVMS
NBI Reference 5 API Reference
"message":null,
"execStartTime":"2020-02-06T00:00:10+08:00",
"execEndTime":"2020-02-06T00:01:10+08:00"
},
{
"plantCode":"NE=23456789",
"sn":"6fbfk11",
"remoteID":"23456789",
"status":0,
"chargedCapacity":2000,
"message":null,
"startTime":"2020-02-06T00:00:00+08:00",
"endTime":"2020-02-06T00:01:00+08:00"
}
]
}
5.2.3 API for Delivering a Task for Setting the Battery Working
Mode
API Description
This API is used to set the working mode of plant-level batteries based on the
plant DN. A task supports a maximum of 10 plants. Different parameters can be
delivered to each plant.
Call the API only when necessary to reduce the access frequency. For the same PV
plant, do not call this API repeatedly before a task is complete.
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v1/
control/battery/mode/async-task
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 176
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 177
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 178
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 179
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 180
SmartPVMS
NBI Reference 5 API Reference
NOTICE
● This API will change the device running parameters. Exercise caution when
calling this API.
● Do not send a new task to the same plant when the task is not complete (that
is, the status is RUNNING).
● For the same plant, multiple overlapped time segments cannot be set on the
same day.
● The battery working mode cannot be set for LG batteries.
● For a PV plant, if operationMode is set to TOU, the
chargingAndDischargingTimeWindow parameter must be set.
● When the controller in the plant is disconnected, the task of setting the battery
working mode cannot be delivered to the plant.
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 181
SmartPVMS
NBI Reference 5 API Reference
Example
Request example (The first task is set to maximumSelfConsumption and the
second task is set to TOU.):
{
"tasks":[
{
"plantCode":"NE=123456789",
"operationMode":"maximumSelfConsumption"
},
{
"plantCode":"NE=234567891",
"operationMode":"TOU",
"redundantPVEnergyPriority":"fedToGridPreference",
"allowedAcChargePower":10,
"chargingAndDischargingTimeWindow":[
{
"startTime":"00:00",
"endTime":"02:00",
"chargeOrDischarge":"charge",
"repeat":[
2,
3
]
},
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 182
SmartPVMS
NBI Reference 5 API Reference
{
"startTime":"00:00",
"endTime":"05:00",
"chargeOrDischarge":"charge",
"repeat":[
5,
6
]
}
]
}
]
}
Response example:
Example 1: The task fails.
{
"failCode": 2,
"success": false,
"message": "Exist no permission resources. plantCodes: [NE=123456789, NE=234567891]",
"data": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 183
SmartPVMS
NBI Reference 5 API Reference
5.2.4 API for Querying a Task for Setting the Battery Working
Mode
API Description
This API is used to query the execution status of the task for setting the battery
working mode based on the task ID. Only one task can be queried at a time.
Call the API only when necessary to reduce the access frequency. For the same PV
plant, do not call this API repeatedly before a task is complete.
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v1/
control/battery/mode/task-info
Request Mode
HTTP method: POST
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 184
SmartPVMS
NBI Reference 5 API Reference
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 185
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 186
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"taskId": "3051190140256431"
}
Response examples:
Example 1: An error code is returned.
{
"failCode": 20620,
"success": false,
"message": "The taskId is not exist.",
"data": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 187
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 188
SmartPVMS
NBI Reference 5 API Reference
5,
6
],
"startTime": "00:00",
"endTime": "05:00"
}
]
}
],
"startTime": "2024-02-29T23:02:49+08:00",
"endTime": "2024-02-29T23:02:55+08:00"
}
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 189
SmartPVMS
NBI Reference 5 API Reference
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v1/
control/battery/configuration/async-task
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 190
SmartPVMS
NBI Reference 5 API Reference
NOTICE
● This API will change the device running parameters. Exercise caution when
calling this API.
● Do not send a new task to the same plant when the task is not complete (that
is, the status is RUNNING).
● Battery parameters cannot be set for LG batteries.
● When the battery is disconnected, the parameter setting task cannot be
delivered to the battery.
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 191
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"tasks": [
{
"plantCode": "NE=12345678",
"batteryConfigurationInfo": {
"endOfDischargeSoc" : 18,
"endOfChargeSoc": 98,
"maximumDischargePower": 48,
"maximumChargePower": 22
}
},
{
"plantCode": "NE=23456789",
"batteryConfigurationInfo": {
"endOfDischargeSoc" : 18
}
},
{
"plantCode": "NE=34567890",
"batteryConfigurationInfo": {
"endOfChargeSoc": 98
}
},
{
"plantCode": "NE=45678901",
"batteryConfigurationInfo": {
"maximumDischargePower": 48,
"maximumChargePower": 22
}
}
]
}
Response examples:
Example 1: The task fails.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 192
SmartPVMS
NBI Reference 5 API Reference
{
"failCode": 2,
"success": false,
"message": "Exist no permission plants, plantCodes: [NE=45111870, NE=56433603]"
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 193
SmartPVMS
NBI Reference 5 API Reference
"plantCode": "NE=12345678",
"status": "RUNNING"
}
]
}
}
API Description
This API is used to query the execution status of the task for setting the battery
parameters based on the task ID. Only one task can be queried at a time.
Call the API only when necessary to reduce the access frequency. For the same PV
plant, do not call this API repeatedly before a task is complete.
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v1/
control/battery/configuration/task-info
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 194
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 195
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"taskId": "3051190140256431"
}
Response examples:
Example 1: An error code is returned.
{
"failCode": 20620,
"success": false,
"message": "The taskId is not exist.",
"data": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 196
SmartPVMS
NBI Reference 5 API Reference
],
"detailArgs": [
"taskId may not be null"
],
"adviceArgs": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 197
SmartPVMS
NBI Reference 5 API Reference
"endOfDischargeSoc": 13.0,
"maximumChargePower": 22,
"maximumDischargePower": 0
}
}
],
"startTime": "2024-02-29T18:01:06+08:00",
"endTime": "2024-02-29T18:06:18+08:00"
}
}
Request URL
https://Domain name of the management system/rest/openapi/pvms/nbi/v2/
control/active-power-control/async-task
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 198
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 199
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 200
SmartPVMS
NBI Reference 5 API Reference
NOTICE
● This API will change the device running parameters. Exercise caution when
calling this API.
● Do not send a new task to the same plant when the task is not complete (that
is, the status is RUNNING).
● For a PV plant, if controlMode is set to 0, controlInfo will be ignored during
task delivery.
● When the SmartLogger is used, SmartLogger (devTypeId = 2) and the
distributed SmartLogger (devTypeId = 63) are distinguished. The devTypeId
can be queried in 5.1.1.2 Device List API. The maximum grid feed-in power of
the SmartLogger falls in the range of [-1000.000, 5000.000], and that of the
distributed SmartLogger falls in the range of [-1000.000, 50000.000].
● For a plant where SmartLogger is used, if controlMode is set to 6, Start
control is set to Yes by default after a task is delivered.
● When the controller in the plant is disconnected, the active power setting task
cannot be delivered to the plant.
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 201
SmartPVMS
NBI Reference 5 API Reference
Example
Example request (The active power control mode of the first task is Unlimited,
and that of the second task is Limited feed-in (kW).):
{
"tasks":[
{
"plantCode":"NE=123456789",
"controlMode":"0"
},
{
"plantCode":"NE=234567891",
"controlMode":"6",
"controlInfo":{
"maxGridFeedInPower":53,
"limitationMode":"1"
}
}
]
}
Response examples:
Example 1: The task fails.
{
"failCode": 2,
"success": false,
"message": "Exist no permission resources. plantCodes: [NE=123456789, NE=234567891]",
"data": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 202
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 203
SmartPVMS
NBI Reference 5 API Reference
API Description
This API is used to query the execution status of the inverter active power setting
task based on the task ID. Only one task can be queried at a time.
Call the API only when necessary to reduce the access frequency. For the same PV
plant, do not call this API repeatedly before a task is complete.
Request URL
https://management system domain name/rest/openapi/pvms/nbi/v2/control/
active-power-control/task-info
Request Mode
HTTP method: POST
Request Parameters
Parameter Description Data Type Mandatory/
Optional
Response Packet
Parameter Description Data Type Remarks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 204
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 205
SmartPVMS
NBI Reference 5 API Reference
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 206
SmartPVMS
NBI Reference 5 API Reference
Example
Request example:
{
"taskId": "3051190140256431"
}
Response examples:
Example 1: An error code is returned.
{
"failCode": 20620,
"success": false,
"message": "The taskId is not exist.",
"data": null
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 207
SmartPVMS
NBI Reference 5 API Reference
}
}
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 208
SmartPVMS
NBI Reference 6 References
6 References
7 20007 The system does not have the desired power plant
resources.
8 20008 The system does not have the desired device resources.
13 20013 The device type is incorrect. The API does not support
operations on some devices.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 209
SmartPVMS
NBI Reference 6 References
22 20022 The upgrade records of the devices in the system are not
found.
26 20023 The query start time cannot be later than the query end
time.
30 20027 The query time period cannot span more than 31 days.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 210
SmartPVMS
NBI Reference 6 References
41 20041 The control type cannot be empty for forced charge and
discharge.
52 20055 The plant list and device list parameters cannot be empty
at the same time.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 211
SmartPVMS
NBI Reference 6 References
60 20606 If only the start time is entered and the end time is empty,
the start time cannot be later than or equal to the current
time.
67 20613 The default setting task fails to be sent for all plants.
71 20617 The query result of the default plant setting task is empty.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 212
SmartPVMS
NBI Reference 6 References
103 22010 The plant with the iSitePower-M cannot connect to other
devices.
104 23000 The plant-level string capacity and PV-level string capacity
cannot be empty at the same time.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 213
SmartPVMS
NBI Reference 6 References
112 24001 The electricity price date settings must cover a complete
year and without overlapping.
113 24002 The electricity price time segments must cover 24 hours of
the day without overlapping.
122 25004 The safe running time of the plant must be a positive
number.
128 26002 The company authorized by the API account does not exist.
130 26004 Failed to unbind the API account from the device.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 214
SmartPVMS
NBI Reference 6 References
136 30006 The value of pageSize is out of range. The allowed range
is {10, 20, 30, 50, 100}.
147 30017 The value of dns is invalid. The number of devices exceeds
100 or devices on which the API account does not have
permission exist.
148 30018 The value of taskName is invalid (for example, null field).
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 215
SmartPVMS
NBI Reference 6 References
162 30032 The time parameter is invalid. The query time segment
cannot be longer than three days.
Basic Plant list Maximum number of API calls for each API account:
data 10/minute
Device list Maximum number of API calls for each API account:
10/minute
Monit Real-time Maximum number of API calls for each API account:
oring plant data 30/minute
data
Real-time Maximum number of API calls for each API account:
device data 10/minute
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 216
SmartPVMS
NBI Reference 6 References
Alarm Querying Maximum number of API calls for each API account:
data active alarms 10/minute
Repor Hourly plant Maximum number of API calls for each API account:
t data data 10/minute
Daily plant Maximum number of API calls for each API account:
data 10/minute
Monthly plant Maximum number of API calls for each API account:
data 10/minute
Yearly plant Maximum number of API calls for each API account:
data 10/minute
Daily device Maximum number of API calls for each API account:
data 10/minute
Monthly device Maximum number of API calls for each API account:
data 10/minute
Yearly device Maximum number of API calls for each API account:
data 10/minute
Contr Delivering Maximum number of API calls for each API account:
ol API battery charge/ 10/minute
discharge tasks
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 217
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 218
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 219
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 220
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 221
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 222
SmartPVMS
NBI Reference 6 References
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 223
SmartPVMS
NBI Reference 6 References
1 400 Parameter
verification
failed.
2 500 System
error.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 224
SmartPVMS
NBI Reference 7 Best Practices
7 Best Practices
NOTICE
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 225
SmartPVMS
NBI Reference 7 Best Practices
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 226
SmartPVMS
NBI Reference 7 Best Practices
NOTE
Expand the details in the data field to obtain the basic information about a plant, including
plantCode, the unique identifier for data query. You can save the information for future
use.
1. Method: POST
3. Request body: Enter the value in plantCode obtained from the plant list API. If
multiple values are used, separate them using commas (,). A maximum of 100
values are supported.
5. HTTP status code: The response status code 200 indicates that the API is
successfully called.
7. Response body: The queried real-time plant data is shown in the data field.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 227
SmartPVMS
NBI Reference 7 Best Practices
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 228
SmartPVMS
NBI Reference 7 Best Practices
Step 1 Use API 1 for forcible battery charge and discharge. The charge and discharge
power, duration, and target SOC can be set.
----End
1. The API allows users to set the target SOC and charge/discharge duration for
residential batteries.
2. API 1 does not change the original working mode of the battery. After the
task is complete, the battery continues to work in the original working mode.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 229
SmartPVMS
NBI Reference 7 Best Practices
Step 2 Use API 1 for forcible battery charge and discharge. The charge and discharge
power, duration, and target SOC can be set.
----End
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 230
SmartPVMS
NBI Reference 8 FAQs
8 FAQs
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 231
SmartPVMS
NBI Reference 8 FAQs
8.1.3 Why Does the Northbound API Return Error Code 305?
If error code 305 is returned when you call a northbound API, as shown in the
following figure, the access token is invalid. That is, the owner's authorization
information cannot be parsed through the access token. The possible cause is that
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 232
SmartPVMS
NBI Reference 8 FAQs
the access token has expired (validity period: one hour). In this case, you need to
use the refresh token to obtain the access token again. For details, see 3.1.2.3
Obtaining the Access Token of the Open API by a Third-Party App.
8.1.4 Why Does the Northbound API Return Error Code 401?
If error code 401 is returned when you call a northbound API, as shown in the
following figure, you do not have sufficient access token permissions. That is, the
permission set authorized by the owner to the OAuth 2.0 client does not contain
the requested open API. In this case, the owner needs to authorize the permission
group to which the open API belongs. For details, see 3.1.2.2 Initiating
Authorization to a Third-party App by an Owner.
8.1.5 Why Does the Northbound API Return Error Code 407 or
429?
If error code 407 or 429 is returned when you call a northbound API, as shown in
the following figure, the API is called too frequently in a period of time, triggering
API flow control. See 4.1 Flow Control Policy in OAuth Connect Mode for the
flow control policies in OAuth Connect mode.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 233
SmartPVMS
NBI Reference 8 FAQs
NOTICE
Connecting to open APIs in OAuth Connect mode is for trial use only in Europe.
The following O&M support modes are available only to European customers.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 234
SmartPVMS
NBI Reference 8 FAQs
If you fail to create an API account, check whether the number of created API
accounts exceeds the upper limit (five by default).
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 235
SmartPVMS
NBI Reference 8 FAQs
Old policy: The static flow control policy is adopted, which means that each API
account is allowed to send the same number of calling requests for one API. For
details, see 6.2 Old Policy for API Flow Control.
New policy: The dynamic flow control policy is adopted, which means that the
new policy is based on the number of resources owned by API accounts. An API
account with more plants and devices is allowed to send more API calling requests
in a period of time. For details, see 4.2 Flow Control Using the API Account.
8.2.3 Why Does the Login Fail After I Enter the Correct
Username and Password?
If the login still fails after you enter the correct username and password, try the
following steps:
Step 1 Check whether parameter names are correct.
Step 2 Check whether the API account has expired.
Step 3 Check whether the API account is disabled.
Step 4 Check whether the API account is locked. If you enter incorrect login passwords for
five consecutive times, the account will be locked.
----End
8.2.5 Why Does the Northbound API Return Error Code 401?
This error code is returned when you call the northbound API, as shown in the
following figure.
In this case, you need to check whether the API account has the permission to
access the API. You can try the following steps to check the permissions for basic
and control APIs:
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 236
SmartPVMS
NBI Reference 8 FAQs
Step 1 Log in to the NMS as an administrator and choose System > Company
Management > Northbound Management.
Step 2 Locate the API account and click Modify in the Operation column. On the
displayed page, check whether the corresponding APIs option is enabled.
----End
If the API you access is within the basic and control API ranges, you have not
granted the permission on the restricted APIs.
8.2.6 Why Does the Northbound API Return Error Code 407 or
429?
If error code 407 or 429 is returned when you call a northbound API, as shown in
the following figure, the API is called too frequently in a period of time, triggering
API flow control.
There are new and old policies for API accounts. For details about the new policy,
see 4.2 Flow Control Using the API Account. For details about the old policy, see
6.2 Old Policy for API Flow Control.
Step 1 Check whether the target plant or device exists and whether the plant or device is
bound to the corresponding OAuth 2.0 client of the API account or third-party app
by comparing the parameters returned in 5.1.1.1 Plant List API or 5.1.1.2 Device
List API.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 237
SmartPVMS
NBI Reference 8 FAQs
Step 2 Find the corresponding northbound API in 5 API Reference, check whether the API
supports the target device type, and check whether the device type is correct.
Step 3 Check whether the target device is disconnected.
Step 4 If Configure Owner Authorization is enabled for the company to which the plant
or device belongs and the company has been bound to the OAuth 2.0 client of the
API account or third-party app, as shown in the following figure, choose Plants >
Operation. In the Set Permissions dialogue box, check whether API Access is
enabled.
Owners can log in to the FusionSolar app, choose Me > Plant management on
the toolbar at the bottom, select a plant, choose Set Permissions, and check
whether to enable API Access.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 238
SmartPVMS
NBI Reference 8 FAQs
Figure 8-1
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 239
SmartPVMS
NBI Reference 8 FAQs
Figure 8-2
Figure 8-3
----End
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 240
SmartPVMS
NBI Reference 8 FAQs
8.9 Why Do the Plant IDs Returned for the Same Plant
Vary Depending on Open API Users?
During the evolution of the management system, the plant IDs change. To ensure
user experience of existing open API users, the management system is compatible
with the plant IDs of these open API users.
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 241
SmartPVMS
NBI Reference 8 FAQs
If you have multiple open API accounts applied for in different periods, their plant
IDs may be different.
Figure 8-4 If the page shown in the following figure is displayed, view the
company bound to the API account in the plant list API.
Figure 8-5 If the page shown in the following figure is displayed, view the
company bound to the API account in the selected company area.
Step 2 Choose Plants > Plant Management, select the company bound to the API
account, and click Export to obtain all the plants of the company. If there are a
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 242
SmartPVMS
NBI Reference 8 FAQs
large number of plants, you are advised to adjust the records displayed on each
page.
Figure 8-6
Step 3 Compare the plants exported from the page with those returned by the plant list
API to obtain the plants that are not returned.
----End
Issue 01 (2024-07-01) Copyright © Huawei Digital Power Technologies Co., Ltd. 243