EcoWatt Technologies Logo

Solver – PV C\&D strategy

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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_listphotovoltaic_charge_list
datadataYesMessage Content-See Payload – data/ChargeDetail
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0, ∞)1696837112000

Payload – data/ChargeDetail

ParameterTypeRequiredDescriptionRangeExample
idintYesID-1
charge_typeintYesCharge/Discharge type (more to be supported)1 = Timed Charge/Discharge1
statusintYesStrategy Switch0=Off, 1=On1
yearintYesYear (If mode=1, year is required)-2024
month[]intYesMonth selection (0 for January)[0..11][1,7,8,11]
week_day[]intNoWeekday selection (0 for Monday)[0..6][5,6]
dates[]intNoDate selection (0 for Day 1)[0..30] vary by month/year[0,1]
modeintYesMode (depending on value, must fill week_day or dates)1=Month/Day mode,2=Month/Week mode1 (If mode=1 => dates needed, if mode=2 => week_day needed)
devices[]DeviceYesList of PV devices--
settings[]chargeTimeYesCharge/Discharge time periods--
apply_to_allboolYesWhether it includes all devices-false

Payload – Device

ParameterTypeRequiredDescriptionRangeExample
idintYesID-1
namestrYesDevice Name-ems device
site_namestrYesSite Name-ems site
locationstrYesDetailed Address-Shanghai
longitudefloatYesLongitude-
latitudefloatYesLatitude-
levelintYesEMS Level[1, 2]1
typestrYesDevice Type-ems
running_statusintYesRunning Status1=Running,2=Offline,3=Fault1
hoststrYesAddress-192.168.0.1
portstrYesPort[0..65525]2171
licensestrYesActivation Code-2YIZedmOtl4pcqo1EA4zhM5gofDI

Payload – chargeTime

ParameterTypeRequiredDescriptionRangeExample
start_hourintYesStart hour[0..23]20
start_minuteintYesStart minute[0..59]0
end_hourintYesEnd hour[0..23]0
end_minuteintYesEnd minute[0..59]0
cdc_enable_modeintYesCharge/Discharge setting0=Standby,2=Discharge1
run_powerintYesOperating 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_syncphotovoltaic_charge_sync
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Response Codes

Error CodeDescriptionNote
200Issued Successfully-
400Parameter 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_syncphotovoltaic_charge_sync
datadataYesMessage content-See Payload – data/ChargeDetail
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typecharge_photovoltaic_createcharge_photovoltaic_create
datadataYesMessage Content-See Payload – data/ChargeCreate
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Payload – data/ChargeCreate

ParameterTypeRequiredDescriptionRangeExample
charge_typeintYesCharge/Discharge type (more possible)1=timed charge/discharge1
statusintYesStrategy Switch0=Off,1=On1
yearintYesYear (if mode=1 => year needed)2024
month[]intYesMonth selection (0=January)[0..11][1,7,8,11]
week_day[]intNoWeekday selection (0=Monday)[0..6][5,6]
dates[]intNoDate selection (0=Day1)[0..30][0,1,2]
modeintYesMode (depending on mode, fill week_day or dates)1=Month/Day,2=Month/Week1
device_ids[]intNoList of device IDs (uids, ids, or apply_to_all)--
apply_to_allboolNoWhether includes all first-level devices-true
settings[]chargeTimeYesCharge/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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_createphotovoltaic_charge_create
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
datadataYesAdditional DataSee data
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Response Codes

Error CodeDescriptionExplanation
200Issued Successfully-
400Parameter Error-

Data

ParameterTypeDescription
policy_idintCharge/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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_updatephotovoltaic_charge_update
datadataYesMessage Content-See Payload – data/ChargeUpdate
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Payload – data/ChargeUpdate

ParameterTypeRequiredDescriptionRangeExample
idintYesStrategy ID--
The rest-Nosee 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_updatephotovoltaic_charge_update
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Response Codes

Error CodeDescriptionExplanation
200Issued Successfully-
400Parameter 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_deletephotovoltaic_charge_delete
datadataYesMessage Content-See Payload – data
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (ms)(0,∞)1696837112000

Payload – data

ParameterTypeRequiredDescriptionRangeExample
idintYesCharge/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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid of the message replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_deletephotovoltaic_charge_delete
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesTimestamp (ms)(0,∞)1696837112000

Response Codes

Error CodeDescriptionNotes
200Issued Successfully-
400Parameter 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_update_allphotovoltaic_charge_update_all
datadataYesMessage Content-See Payload – data
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid of the message being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typephotovoltaic_charge_update_allphotovoltaic_charge_update_all
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage timestamp (milliseconds)(0,∞)1696837112000

Response Codes

Error CodeDescriptionNotes
200Issued Successfully-
400Parameter 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
}