Reporting the Charging and Discharging Strategy
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/list/post - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/list/post
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_list charge_list data data true Message content - See Payload - data/ChargeDetail device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload – data/ChargeDetail
Parameter Type Required Description Range Example id int true ID - 1 charge_type int true Charging/Discharging type (more types later) 1 - scheduled charging/discharging 1 status int true Strategy switch 0 - off, 1 - on 1 year int true Year (required if mode=1) 2024 month []int true Month selection (0 = January) [0..11] [1,7,8,11] week_day []int false Day of week selection (0 = Monday) [0..6] [5,6] dates []int false Date selection (0 = 1st) [0..30] (depends on month & year) [0,1] mode int true Mode (depending on its value, week_day or dates are required) 1 - monthly-date mode, 2 - monthly-week mode 1 (if mode=1, dates required; if mode=2, week_day required) ems_devices []emsDevice true Device list - - settings []chargeTime true Charging/Discharging time segments - - apply_to_all bool true Whether to include all first-level devices - false -
Payload – emsDevice
Parameter Type Required Description Range Example id int true Device ID - 1 name str true Device name - ems device site_name str true Site name - ems site location str true Detailed location - Shanghai longitude float true Longitude - latitude float true Latitude - level int true EMS level [1, 2] 1 type str true Device type - ems running_status int true Running status (1-run,2-offline,3-fault) [1,2,3] 1 host str true Address - 192.168.0.1 port str true Port [0..65525] 2171 license str true Activation code - 2YIZedmOtl4pcqo1EA4zhM5gofDI -
Payload – chargeTime
Parameter Type Required Description Range Example start_hour int true Start hour [0..23] 20 start_minute int true Start minute [0..59] 0 end_hour int true End hour [0..23] 0 end_minute int true End minute [0..59] 0 cdc_enable_mode int true Charging/Discharging setting 0-standby,1-charge,2-discharge 1 run_power int true Operating power (in kW) [0..65535] 300 Time Explanation:
start_hour,start_minute,end_hour,end_minutedefine a left-closed, right-open interval- For example,
start_hour=14,start_minute=15,end_hour=15,end_minute=00represents[14:15, 15:00), i.e., from 14:15 up to but not including 15:00. - For example,
start_hour=20,start_minute=00,end_hour=00,end_minute=00represents[20:00, 00:00), i.e., from 20:00 up to midnight.
- For example,
-
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_list",
"data": [{
"id": 1,
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
1,
7,
8,
11
],
"dates" : [1,2],
"mode" : 1,
"ems_devices": [{
"id": 1,
"name": "Right206",
"site_name": "Test site",
"location": "",
"longitude": 0,
"latitude": 0,
"statistics_port": 1504,
"level": 1,
"type": "ems",
"running_status": 1,
"host": "192.168.77.206",
"port": 1502,
"license": "xxxxx"
}],
"apply_to_all": false,
"settings": [
{
"start_hour": 20,
"start_minute": 0,
"end_hour": 0,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 300
},
{
"start_hour": 0,
"start_minute": 0,
"end_hour": 0,
"end_minute": 0,
"cdc_enable_mode": 21,
"run_power": 0
}
]
}],
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Platform Request to Synchronize the Charging and Discharging Strategy
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/sync/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/sync/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_sync charge_sync device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Response Codes
Error Code Description Notes 200 Issued successfully 400 Parameter error -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "charge_sync",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Response to Synchronizing the Charging and Discharging Strategy
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/sync/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/sync/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd reply UUID true The mid being replied to - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_sync charge_sync data data true Message content - See Payload - data/ChargeDetail code int true Response code - See Response Codes msg str false Failure reason - Parameter error device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_sync",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"data": [{
"id": 1,
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
1,
7,
8,
11
],
"week_day": [
5,
6
],
"mode":2,
"ems_devices": [{
"id": 1,
"name": "Right206",
"site_name": "Test site",
"location": "",
"longitude": 0,
"latitude": 0,
"statistics_port": 1504,
"level": 1,
"type": "ems",
"running_status": 1,
"host": "192.168.77.206",
"port": 1502
}],
"apply_to_all": false,
"settings": [
{
"start_hour": 20,
"start_minute": 0,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 300
},
{
"start_hour": 0,
"start_minute": 0,
"end_hour": 0,
"end_minute": 0,
"cdc_enable_mode": 21,
"run_power": 0
}
]
}],
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Issuing a Create Charging/Discharging Strategy Command
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/create/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/${DEVICE}/charge/create/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_create charge_create data data true Message content - See Payload - data/ChargeCreate device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload - data/ChargeCreate
Parameter Type Required Description Range Example charge_type int true Charging/Discharging type (will support more) 1 - scheduled charging/discharging 1 status int true Strategy switch 0-off,1-on 1 year int true Year (if mode=1, required) 2024 month []int true Month selection (0 = January) [0..11] [1,7,8,11] week_day []int false Day of week selection (0 = Monday) [0..6] [5,6] dates []int false Date selection (0 = 1st) [0..30] [0,1,2] mode int true Mode (based on parameter value, check if week_day/dates is required) 1-month/day,2-month/week 1 ems_device_uids []string false Device UID list (uids, ids, apply_to_all choose one) - - ems_device_ids []int false Device ID list (uids, ids, apply_to_all choose one) - - apply_to_all bool false Whether to include all first-level devices (uids, ids, apply_to_all choose one) - true settings []chargeTime true Charging/Discharging time segments - - -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_create",
"data": {
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
1,
7,
8,
11
],
"week_day": [
5,
6
],
"mode":2,
"settings": [
{
"start_hour": 1,
"start_minute": 50,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 100
}
],
// "ems_device_uids": [
// "ZedmOtl4pc"
// ],
// "apply_to_all": true,
"ems_device_ids": [
1,2,3
]
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Creating a Charging/Discharging Strategy Response
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/create/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/create/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 reply UUID true The mid being replied to - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_create charge_create code int true Response code - See Response Codes msg str false Failure reason - Parameter error data data true Other data See data device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Response Codes
Error Code Description Notes 200 Issued successfully 400 Parameter error -
Data
Parameter Type Description policy_id int Charging/Discharging strategy id -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "charge_create",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"data": {
"policy_id": 1
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issuing an Update Charging/Discharging Strategy Command
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/update/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/update/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_update charge_update data data true Message content - See Payload - data/ChargeUpdate device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload – data/ChargeUpdate
Parameter Type Required Description Range Example id int true Strategy ID - - other fields seePayload - data/ChargeCreate false -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_update",
"data": {
"id": 1,
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
1,
7,
8,
11
],
"week_day": [
5,
6
],
"mode":2,
"settings": [
{
"start_hour": 1,
"start_minute": 50,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 100
}
],
// "ems_device_uids": [
// "ZedmOtl4pc"
// ],
// "apply_to_all": true,
"ems_device_ids": [
1, 2, 3
]
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Response to Updating the Charging/Discharging Strategy
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/update/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/update/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 reply UUID true The mid being replied to - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_update charge_update code int true Response code - See Response Codes msg str false Failure reason - Parameter error device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Response Codes
Error Code Description Notes 200 Issued successfully 400 Parameter error -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "charge_update",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issuing a Delete Charging/Discharging Strategy Command
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/delete/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/delete/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_delete charge_delete data data true Message content - See Payload - data device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload – data
Parameter Type Required Description Range Example id int true Charging/Discharging strategy ID - 1 -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_delete",
"data": {
"id": 1
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Response to Issuing a Delete Charging/Discharging Strategy
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/delete/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/delete/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 reply UUID true The mid being replied to - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_delete charge_delete code int true Response code - See Response Codes msg str false Failure reason - Parameter error device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Response Codes
Error Code Description Notes 200 Issued successfully 400 Parameter error -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "charge_delete",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issuing a Batch Charging/Discharging Strategy Command
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/update_all/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/update_all/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_update_all charge_update_all data data true Message content - See Payload - data device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Payload - Data: []ChargeCreate
-
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed",
"type": "charge_update_all",
"data": [
{
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
8
],
"week_day": [
6
],
"mode":2,
"apply_to_all": true,
"settings": [
{
"start_hour": 1,
"start_minute": 50,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 100
}
]
}
],
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Response to a Batch Charging/Discharging Strategy Command
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/update_all/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/update_all/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd reply UUID true The mid being replied to - ee2e8f09-b280-4e4d-bcb9-1529b703cfed type str true Message type charge_update_all charge_update_all code int true Response code - See Response Codes msg str false Failure reason - Parameter error device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (ms) (0, ∞) 1696837112000 -
Response Codes
Error Code Description Notes 200 Issued successfully 400 Parameter error -
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"reply": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed",
"type": "charge_update_all",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Issuing Create/Update Charging/Discharging Strategy (Based on Branch ID)
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/by_node/command - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/by_node/command
- User-defined MQTT:
-
Permission: Publish
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_by_node charge_by_node data data true Message content - See Payload - data/ChargeByNode device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (milliseconds) (0, ∞) 1696837112000
Payload – data/ChargeByNode
| Parameter | Type | Required | Description | Range | Example |
|---|---|---|---|---|---|
| node_id | int | true | Branch node ID | - | - |
| (Other fields same as Payload - data/ChargeCreate) | false | - | - | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "charge_by_node",
"data": {
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [
6
],
"week_day": [
0,
1,
2,
3,
4,
5,
6
],
"mode": 2,
"node_id": 2,
"settings": [
{
"start_hour": 20,
"start_minute": 0,
"end_hour": 0,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 300
},
{
"start_hour": 0,
"start_minute": 0,
"end_hour": 1,
"end_minute": 0,
"cdc_enable_mode": 1,
"run_power": 300
}
]
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Response to Creating/Updating Charging/Discharging Strategy (Based on Branch ID)
-
Topic:
- User-defined MQTT:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge/by_node/result - Platform Default MQTT:
v1/user/${TENANT}/${DEVICE}/charge/by_node/result
- User-defined MQTT:
-
Permission: Subscribe
-
Payload Main Structure
Parameter Type Required Description Range Example mid UUID true Message ID - 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 reply UUID true The mid being replied to - 3e681859-6917-4b9a-9afd-3f162cd185bd type str true Message type charge_by_node charge_by_node code int true Response code - See Response Codes msg str false Failure reason - Parameter error data data true Additional data - See Data below device_uid str true (Secondary) device UID - iYRkfVpi77 timestamp int true Message timestamp (milliseconds) (0, ∞) 1696837112000
Response Codes
| Error Code | Description | Notes |
|---|---|---|
| 200 | Issued successfully | |
| 400 | Parameter error |
Data
| Parameter | Type | Description |
|---|---|---|
| policy_id | int | Charging/Discharging strategy ID |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "charge_by_node",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"data": {
"policy_id": 1
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
