Reporting Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/list/post
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/list/post
- Permission: Reporting
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_list | pail_charge_list |
| data | data | Yes | Message Content | - | See Payload – data/ChargeDetail |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0, ∞) | 1696837112000 |
Payload – data/ChargeDetail
| Parameter | Type | Required | Description | Range | Example |
|---|
| id | int | Yes | ID | - | 1 |
| charge_type | int | Yes | Charge/discharge type (more types may be supported in future) | 1 – timed charge/discharge | 1 |
| status | int | Yes | Strategy Switch | 0=Off, 1=On | 1 |
| year | int | Yes | Year (if mode=1, year is required) | | 2024 |
| month | []int | Yes | Selected months (0 stands for January) | [0..11] | [1,7,8,11] |
| week_day | []int | No | Selected weekdays (0 stands for Monday) | [0..6] | [5,6] |
| dates | []int | No | Selected dates (0 stands for day 1) | [0..30] vary by year/month | [0,1] |
| mode | int | Yes | Mode (depending on value, week_day or dates is required) | 1=Month/Day mode, 2=Month/Week mode | 1 (if mode=1 => dates needed; if mode=2 => week_day needed) |
| devices | []Device | Yes | List of PV devices | - | - |
| settings | []chargeTime | Yes | Charge/discharge time periods | - | - |
| apply_to_all | bool | Yes | Whether it applies to all devices | - | false |
Payload – Device
| Parameter | Type | Required | Description | Range | Example |
|---|
| uid | str | Yes | Device UID | - | DGHDJSJKD-1 |
| name | str | Yes | Device Name | - | ems device |
| site_name | str | Yes | Site Name | - | ems site |
| location | str | Yes | Detailed Location | - | Shanghai |
| longitude | float | Yes | Longitude | - | - |
| latitude | float | Yes | Latitude | - | - |
| level | int | Yes | EMS Level | [1,2] | 1 |
| type | str | Yes | Device Type | - | ems |
| running_status | int | Yes | Running Status | [1=Running,2=Offline,3=Fault] | 1 |
| host | str | Yes | Address | - | 192.168.0.1 |
| port | str | Yes | Port | [0..65525] | 2171 |
| license | str | Yes | Activation code | - | 2YIZedmOtl4pcqo1EA4zhM5gofDI |
Payload – chargeTime
| Parameter | Type | Required | Description | Range | Example |
|---|
| start_hour | int | Yes | Start hour | [0..23] | 20 |
| start_minute | int | Yes | Start minute | [0..59] | 0 |
| end_hour | int | Yes | End hour | [0..23] | 0 |
| end_minute | int | Yes | End minute | [0..59] | 0 |
| cdc_enable_mode | int | Yes | Charge/discharge setting (0=Standby,1=Charge,2=Discharge) | 0..2 | 1 |
| run_power | int | Yes | Operating power (kW) | [0..65535] | 300 |
Time explanation: start_hour, start_minute, end_hour, end_minute form a half-open interval [start, end) For example:
start_hour=14, start_minute=15, end_hour=15, end_minute=00 means [14:15, 15:00).
start_hour=20, start_minute=00, end_hour=00, end_minute=00 means [20:00, 00:00) (from 20:00 to midnight).
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "pail_charge_list",
"data": [{
"id": 1,
"charge_type": 1,
"status": 1,
"year": 2024,
"month": [1,7,8,11],
"dates": [1,2],
"mode": 1,
"devices": [
{
"id": 1,
"proto_id": 6,
"proto_type": 1,
"application_proto_type": 2,
"host": "192.168.77.208",
"port": 1510,
"com_addr": "/dev/ttyS3",
"com_no": 3,
"baud_rate": 9600,
"data_bits": 8,
"stop_bits": 1,
"parity": "N",
"dlt_addr": "",
"slave_id": 1,
"uid": "",
"station_name": "Test Site",
"name": "Charging Pile 1",
"model": 1,
"ele_meter_id": null,
"pt": 0,
"ct": 0,
"direction": 0,
"charge_power": 10,
"point_table_proto_type": {
"id": 0,
"device_type": 0,
"name": ""
},
"running_status": 1,
"charges": null,
"power_node_pail": null
}
],
"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 Requests Sync of PV Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/sync/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/sync/command
- Permission: Subscribe
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_sync | pail_charge_sync |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Response Codes
| Error Code | Description | Note |
|---|
| 200 | Issued Successfully | - |
| 400 | Parameter Error | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "pail_charge_sync",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Synchronize Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/sync/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/sync/result
- Permission: Publish
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 |
| reply | UUID | Yes | The mid to which this replies | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_sync | pail_charge_sync |
| data | data | Yes | Message content | - | See Payload – data/ChargeDetail |
| code | int | Yes | Response Code | - | See Response Codes |
| msg | str | No | Failure Reason | - | Parameter Error |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "pail_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,
"devices": [
{
"id": 1,
"proto_id": 6,
"proto_type": 1,
"application_proto_type": 2,
"host": "192.168.77.208",
"port": 1510,
"com_addr": "/dev/ttyS3",
"com_no": 3,
"baud_rate": 9600,
"data_bits": 8,
"stop_bits": 1,
"parity": "N",
"dlt_addr": "",
"slave_id": 1,
"uid": "",
"station_name": "Test Site",
"name": "Charging Pile 1",
"model": 1,
"ele_meter_id": null,
"pt": 0,
"ct": 0,
"direction": 0,
"charge_power": 10,
"point_table_proto_type": {
"id": 0,
"device_type": 0,
"name": ""
},
"running_status": 1,
"charges": null,
"power_node_pail": null
}
],
"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
}
Issue Command to Create Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/create/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/create/command
- Permission: Reporting
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_list | pail_charge_list |
| data | data | Yes | Message Content | - | See Payload – data/ChargeCreate |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Payload – data/ChargeCreate
| Parameter | Type | Required | Description | Range | Example |
|---|
| charge_type | int | Yes | Charge/Discharge type (more types possible in future) | 1=timed charge/discharge | 1 |
| status | int | Yes | Strategy Switch | 0=off,1=on | 1 |
| year | int | Yes | Year (if mode=1, year is required) | | 2024 |
| month | []int | Yes | Selected months (0=January) | [0..11] | [1,7,8,11] |
| week_day | []int | No | Selected weekdays (0=Monday) | [0..6] | [5,6] |
| dates | []int | No | Selected dates (0=Day1) | [0..30] | [0,1,2] |
| mode | int | Yes | Mode (depending on mode, week_day or dates must be filled) | 1=Month/Day,2=Month/Week | 1 |
| device_ids | []int | No | Device IDs list (either uids, ids, or apply_to_all) | - | - |
| apply_to_all | bool | No | Whether it includes all first-level devices (either uids, ids, or apply_to_all) | - | true |
| settings | []chargeTime | Yes | Charge/Discharge time periods | - | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "pail_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
}
],
"device_ids": [1]
// "apply_to_all": true,
// "ems_device_ids": ["1"] // ems_device_ids, ems_device_uids, or apply_to_all are alternatives
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Create Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/create/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/create/result
- Permission: Subscribe
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 |
| reply | UUID | Yes | The mid of the message to which it replies | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_create | pail_charge_create |
| code | int | Yes | Response Code | - | See Response Codes |
| msg | str | No | Failure Reason | - | Parameter error |
| data | data | Yes | Additional data | | See data |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Response Codes
| Error Code | Description | Notes |
|---|
| 200 | Issued Successfully | - |
| 400 | Parameter Error | - |
Data
| Parameter | Type | Description |
|---|
| policy_id | int | Charge/Discharge policy id |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "pail_charge_create",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"data": {
"policy_id": 1
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issue Command to Modify Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/update/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/update/command
- Permission: Reporting
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_update | pail_charge_update |
| data | data | Yes | Message Content | - | See Payload – data/ChargeUpdate |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Payload – data/ChargeUpdate
| Parameter | Type | Required | Description | Range | Example |
|---|
| id | int | Yes | Strategy ID | - | - |
| The rest | - | No | see Payload – data/ChargeCreate | - | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "pail_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
}
],
"device_ids": [1]
// "apply_to_all": true,
// "ems_device_ids": ["1"] // ems_device_ids, ems_device_uids, or apply_to_all
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Modify Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/update/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/update/result
- Permission: Subscribe
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 |
| reply | UUID | Yes | The mid being replied to | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_update | pail_charge_update |
| code | int | Yes | Response Code | - | See Response Codes |
| msg | str | No | Failure Reason | - | Parameter Error |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | 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": "pail_charge_update",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issue Command to Delete Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/delete/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/delete/command
- Permission: Reporting
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_delete | pail_charge_delete |
| data | data | Yes | Message Content | - | See Payload – data |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Payload – data
| Parameter | Type | Required | Description | Range | Example |
|---|
| id | int | Yes | Charge/Discharge Strategy ID | - | 1 |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "pail_charge_delete",
"data": {
"id": 1
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Delete Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/delete/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/delete/result
- Permission: Subscribe
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 |
| reply | UUID | Yes | The mid to which this is replying | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_delete | pail_charge_delete |
| code | int | Yes | Response Code | - | See Response Codes |
| msg | str | No | Failure Reason | - | Parameter Error |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | 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": "pail_charge_delete",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issue Command to Batch Update Charge/Discharge Strategies
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/update_all/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/update_all/command
- Permission: Publish
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_update_all | pail_charge_update_all |
| data | data | Yes | Message Content | - | See Payload – data |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message Timestamp (ms) | (0,∞) | 1696837112000 |
Payload – Data: []ChargeCreate
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed",
"type": "pail_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"
}
Batch Update Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_pail/update_all/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_pail/update_all/result
- Permission: Publish
Payload – Main Structure
| Parameter | Type | Required | Description | Range | Example |
|---|
| mid | UUID | Yes | Message ID | - | 4c5b3c27-cea8-4ea1-a936-41fd3596e0e9 |
| reply | UUID | Yes | The mid of the message being replied to | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | pail_charge_update_all | pail_charge_update_all |
| code | int | Yes | Response Code | - | See Response Codes |
| msg | str | No | Failure Reason | - | Parameter Error |
| device_uid | str | Yes | (Secondary) Device UID | - | iYRkfVpi77 |
| timestamp | int | Yes | Message timestamp (milliseconds) | (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": "pail_charge_update_all",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}