Reporting Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/list/post
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/list/post
- 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 | photovoltaic_charge_list | photovoltaic_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 to be supported) | 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 | Month selection (0 for January) | [0..11] | [1,7,8,11] |
| week_day | []int | No | Weekday selection (0 for Monday) | [0..6] | [5,6] |
| dates | []int | No | Date selection (0 for Day 1) | [0..30] vary by month/year | [0,1] |
| mode | int | Yes | Mode (depending on value, must fill week_day or dates) | 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 includes all devices | - | false |
Payload – Device
| Parameter | Type | Required | Description | Range | Example |
|---|
| id | int | Yes | ID | - | 1 |
| name | str | Yes | Device Name | - | ems device |
| site_name | str | Yes | Site Name | - | ems site |
| location | str | Yes | Detailed Address | - | 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,2=Discharge | 1 |
| run_power | int | Yes | Operating power (kW) | [0..65535] | 300 |
Time Note: start_hour, start_minute, end_hour, end_minute form a left-closed/right-open interval
- e.g.,
start_hour=14, start_minute=15, end_hour=15, end_minute=00 => [14:15, 15:00)
- e.g.,
start_hour=20, start_minute=00, end_hour=00, end_minute=00 => [20:00, 00:00)
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "photovoltaic_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
}],
"apply_to_all": false,
"settings": [
{
"start_hour": 0,
"start_minute": 0,
"end_hour": 20,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 300
},
{
"start_hour": 20,
"start_minute": 0,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 0,
"run_power": 0
}
]
}],
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Platform Requests to Synchronize PV Charge/Discharge Strategy
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/sync/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/sync/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 | photovoltaic_charge_sync | photovoltaic_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": "photovoltaic_charge_sync",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Synchronize Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/sync/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/sync/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 | photovoltaic_charge_sync | photovoltaic_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": "photovoltaic_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,
"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": 0,
"start_minute": 0,
"end_hour": 10,
"end_minute": 0,
"cdc_enable_mode": 2,
"run_power": 300
},
{
"start_hour": 20,
"start_minute": 0,
"end_hour": 23,
"end_minute": 0,
"cdc_enable_mode": 1,
"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_photovoltaic/create/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/create/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 | charge_photovoltaic_create | charge_photovoltaic_create |
| 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 possible) | 1=timed charge/discharge | 1 |
| status | int | Yes | Strategy Switch | 0=Off,1=On | 1 |
| year | int | Yes | Year (if mode=1 => year needed) | | 2024 |
| month | []int | Yes | Month selection (0=January) | [0..11] | [1,7,8,11] |
| week_day | []int | No | Weekday selection (0=Monday) | [0..6] | [5,6] |
| dates | []int | No | Date selection (0=Day1) | [0..30] | [0,1,2] |
| mode | int | Yes | Mode (depending on mode, fill week_day or dates) | 1=Month/Day,2=Month/Week | 1 |
| device_ids | []int | No | List of device IDs (uids, ids, or apply_to_all) | - | - |
| apply_to_all | bool | No | Whether includes all first-level devices | - | true |
| settings | []chargeTime | Yes | Charge/Discharge time periods | - | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "photovoltaic_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,apply_to_all
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Create Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/create/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/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 being replied to | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | photovoltaic_charge_create | photovoltaic_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 | Explanation |
|---|
| 200 | Issued Successfully | - |
| 400 | Parameter Error | - |
Data
| Parameter | Type | Description |
|---|
| policy_id | int | Charge/Discharge ID |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "photovoltaic_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_photovoltaic/update/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/update/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 | photovoltaic_charge_update | photovoltaic_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 data/ChargeCreate | - | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"type": "photovoltaic_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]
},
"device_uid": "iYRkfVpi77",
"timestamp": 1695265371000
}
Modify Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/update/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/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 | photovoltaic_charge_update | photovoltaic_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 | Explanation |
|---|
| 200 | Issued Successfully | - |
| 400 | Parameter Error | - |
Payload Example
{
"trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
"mid": "4c5b3c27-cea8-4ea1-a936-41fd3596e0e9",
"type": "photovoltaic_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_photovoltaic/delete/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/delete/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 | photovoltaic_charge_delete | photovoltaic_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": "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_photovoltaic/delete/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/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 of the message replied to | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | photovoltaic_charge_delete | photovoltaic_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 | 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": "photovoltaic_charge_delete",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}
Issue Command for Bulk Update of Charge/Discharge Strategies
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/update_all/command
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/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 | photovoltaic_charge_update_all | photovoltaic_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": "photovoltaic_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
}
Bulk Update Charge/Discharge Strategy Response
- Topic:
- Custom MQTT by user:
v1/watt/${PRODUCT_KEY}/${DEVICE}/charge_photovoltaic/update_all/result
- Default MQTT by platform:
v1/user/${TENANT}/${DEVICE}/charge_photovoltaic/update_all/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 being replied to | - | 3e681859-6917-4b9a-9afd-3f162cd185bd |
| type | str | Yes | Message Type | photovoltaic_charge_update_all | photovoltaic_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": "photovoltaic_charge_update_all",
"reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
"code": 200,
"msg": "",
"device_uid": "iYRkfVpi77",
"timestamp": 1695265671000
}