openApi (1.0.0)

Download OpenAPI specification:Download

Authentication

To ensure the system's security and data confidentiality, we use an HTTP request authentication mechanism based on accessKey and secret. This mechanism ensures that only legitimate requests are accepted by the system through timestamp verification and request path checking.

Authentication Process

  1. Timestamp Generation and Encryption

    • The caller needs to generate the current timestamp (timeStamp).
    • Encrypt the timeStamp using the ECB mode of the AES encryption algorithm to obtain the encrypted signature (sign).
    • During the encryption process, use PKCS7 padding mode to ensure the encrypted data block size meets the requirements.
  2. Request Header Information Setup

    • Place the encrypted sign into the HTTP request header with the key name X-Signature.
    • Place the accessKey into the HTTP request header with the key name X-AccessKey.

Example Code to get a Signature

var cryptoJs = require("crypto-js");

const time = Date.now().toString();
const key = cryptoJs.enc.Utf8.parse('your secret key'); 

var sign = cryptoJs.AES.encrypt(time,key,{
    mode: cryptoJs.mode.ECB,
    padding: cryptoJs.pad.Pkcs7
}).toString();

Device registration flow

device register flow

openApi/device

0. Just a health check

Just a health check

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": { },
  • "message": "string",
  • "requestId": "string"
}

1. Get Communication Device Information by Serial Number

Get Communication Device Information by Serial Number

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

2. Network config flow, nothing return

Steps to Configure Device

Step 1: Call API to Get Device Information

Call the API: Get Communication Device Information by Serial Number. Retrieve the response data and extract the following parameters:

  • productIdentifier
  • deviceName
  • deviceSecret
  • sn

Step 2: Write Network Configuration Command to Bluetooth BLE Device

Send the following command to the Bluetooth BLE device:

{
  "id": "xx1xx",
  "t": 2, 
  "pw":{ 
    "pk": {your_productIdentifier}, 
    "dn": {your_deviceName}, 
    "ds": {your_deviceSecret}, 
    "wn": {your_wifiName}, 
    "wp": {your_wifiPassword},
    "sn": {your_sn}
  }
}

Parameter Explanation:

  • id: A unique ID for the command
  • t: Command type, 2 for network configuration
  • pw: Network configuration parameters
    • pk: The productIdentifier from Step 1
    • dn: The deviceName from Step 1
    • ds: The deviceSecret from Step 1
    • wn: WiFi name
    • wp: WiFi password
    • sn: The sn from Step 1

After completing these steps, you can call the API: Get Communication Device Information by Serial Number to check the device's network connection status.

Responses

Response samples

Content type
application/json
{
  • "id": "xx1xx",
  • "result": "OK"
}

3. Device Registration

  1. Device Registration
Request Body schema: application/json
required

the sn of the device

sn
required
string

sn

Responses

Request samples

Content type
application/json
{
  • "sn": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": false,
  • "message": "string",
  • "requestId": "string"
}

4. Get Your Communication Devices

  1. Get Your Communication Devices
Request Body schema: application/json
required
pageNo
required
integer <int32>

page number

pageSize
required
integer <int32>

page size

Responses

Request samples

Content type
application/json
{
  • "pageNo": 0,
  • "pageSize": 0
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

5. Get Realtime Power Energy Flow Data

Get Realtime Power Energy Flow Data

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

6. Get Historical Energy Flow Data

Get Historical Energy Flow Data

Request Body schema: application/json
required
end
string

End Time - Depending on the specific query type, for dates, pass yyyy-MM-dd; for weekly, pass yyyy-MM-dd; for months, pass yyyy-MM; for years, pass yyyy format; for total in summary, this parameter does not need to be passed.

periodType
string
Enum: "DATE" "MONTH" "TOTAL" "WEEK" "YEAR"

Query Cycle Type

sn
string

sn

start
string

Start Time - Depending on the specific query type, for dates, pass yyyy-MM-dd; for weekly, pass yyyy-MM-dd; for months, pass yyyy-MM; for years, pass yyyy format; for total in summary, this parameter does not need to be passed.

Responses

Request samples

Content type
application/json
{
  • "end": "string",
  • "periodType": "DATE",
  • "sn": "string",
  • "start": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": [
    ],
  • "message": "string",
  • "requestId": "string"
}

7. Get the inverter basic Setting info

Get the inverter basic Setting info, from this you are able to read some basic setting status of the inverter, for example. to know whether is the inverter on, just read the attribute TurnOn return, if the value equal 1, it means the inverter is working now

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

8. Set the inverter basic Setting info

Set the inverter basic Setting info,make you able to change the work mode ,output power and such so on settings of inverter.

  • This interface uses asynchronous commands for issuing instructions and does not directly return the result of whether the setting was successful or not. To check if the setting was successful, please query the Get the inverter basic Setting info interface. The data from this interface is updated once per minute.
  • The value of the deviceIdentifier parameter is the same as the field attributes of OpenInverterSettingInfo returned by the 7 .Get the inverter basic Setting info interface. You can take the corresponding required field attributes directly. for example. aim to turn on the inverter, just set the param of propertyIdentifier to 'TurnOn' ,and the value set to 1, so the request body would like below { "propertyIdentifier":"TurnOn", "value":1 }
path Parameters
sn
required
string

sn

Request Body schema: application/json
required
propertyIdentifier
required
string

device propertyIdentifier, same with the attribute of OpenInverterSettingInfo,just pick one of them to set

value
required
object

propertyValue, support number and string, value range refer to the OpenInverterSettingInfo attribute description

Responses

Request samples

Content type
application/json
{
  • "propertyIdentifier": "TurnOn",
  • "value": 1
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": false,
  • "message": "string",
  • "requestId": "string"
}

9. Get the battery basic Setting info

Get the battery basic Setting info

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

10. Get the latest consumption data

Get the latest consumption data

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

11. Get Latest System Data

Get Latest System Data

path Parameters
sn
required
string

sn

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

12. Get Inverter Events by type

Events are classified based on urgency into the following levels (from highest to lowest):

  • URGENT

  • IMPORTANT

  • SECONDARY

  • REMINDER

You can filter or query events of a specific level using the warnType field

query Parameters
endTime
string

format yyyy-MM-dd HH:mm:ss

pageNo
required
integer

pageNo

pageSize
required
integer

pageSize

sn
required
string

device sn

startTime
string

format yyyy-MM-dd HH:mm:ss

type
required
string

type of notify, support BATTERY, DIESEL, INVERTER

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "",
  • "requestId": ""
}

13. Time schedule discharge control

Time schedule discharge control

Request Body schema: application/json
Array of objects (OpenDevicePlanSeasonCreateVO)

schedule time period

sn
string

device sn

Responses

Request samples

Content type
application/json
{
  • "periodList": [
    ],
  • "sn": "string"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string",
  • "requestId": "string"
}

14. Page list battery historical data

page list battery historical data

Request Body schema: application/json
pageNo
required
integer <int32>

page number,min value 1

pageSize
required
integer <int32>

page size,max value 1000

sn
required
string

sn

startTime
string <date-time>

startTime,format yyyy-MM-dd HH:mm:ss,which to limit the data range, sorted by updateTime desc

endTime
string <date-time>

endTime,format yyyy-MM-dd HH:mm:ss,which to limit the data range, sorted by updateTime desc

Responses

Request samples

Content type
application/json
{
  • "pageNo": 0,
  • "pageSize": 0,
  • "sn": "string",
  • "startTime": "2019-08-24T14:15:22Z",
  • "endTime": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "data": {
    },
  • "message": "string",
  • "requestId": "string"
}

For More, Coming Soon

For More, Coming Soon