EcoWatt Technologies Logo

Solver – EVSE C\&D strategy

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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_listpail_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 types may be supported in future)1 – timed charge/discharge1
statusintYesStrategy Switch0=Off, 1=On1
yearintYesYear (if mode=1, year is required)2024
month[]intYesSelected months (0 stands for January)[0..11][1,7,8,11]
week_day[]intNoSelected weekdays (0 stands for Monday)[0..6][5,6]
dates[]intNoSelected dates (0 stands for day 1)[0..30] vary by year/month[0,1]
modeintYesMode (depending on value, week_day or dates is required)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 applies to all devices-false

Payload – Device

ParameterTypeRequiredDescriptionRangeExample
uidstrYesDevice UID-DGHDJSJKD-1
namestrYesDevice Name-ems device
site_namestrYesSite Name-ems site
locationstrYesDetailed Location-Shanghai
longitudefloatYesLongitude--
latitudefloatYesLatitude--
levelintYesEMS Level[1,2]1
typestrYesDevice Type-ems
running_statusintYesRunning Status[1=Running,2=Offline,3=Fault]1
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 setting (0=Standby,1=Charge,2=Discharge)0..21
run_powerintYesOperating 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_syncpail_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": "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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid to which this replies-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_syncpail_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": "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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_listpail_charge_list
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 types possible in future)1=timed charge/discharge1
statusintYesStrategy Switch0=off,1=on1
yearintYesYear (if mode=1, year is required)2024
month[]intYesSelected months (0=January)[0..11][1,7,8,11]
week_day[]intNoSelected weekdays (0=Monday)[0..6][5,6]
dates[]intNoSelected dates (0=Day1)[0..30][0,1,2]
modeintYesMode (depending on mode, week_day or dates must be filled)1=Month/Day,2=Month/Week1
device_ids[]intNoDevice IDs list (either uids, ids, or apply_to_all)--
apply_to_allboolNoWhether it includes all first-level devices (either uids, ids, or apply_to_all)-true
settings[]chargeTimeYesCharge/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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid of the message to which it replies-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_createpail_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 CodeDescriptionNotes
200Issued Successfully-
400Parameter Error-

Data

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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_updatepail_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 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_updatepail_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 CodeDescriptionNotes
200Issued Successfully-
400Parameter 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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_deletepail_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": "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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid to which this is replying-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_deletepail_charge_delete
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesMessage Timestamp (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": "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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_update_allpail_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": "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

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesThe mid of the message being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepail_charge_update_allpail_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": "pail_charge_update_all",
  "reply": "3e681859-6917-4b9a-9afd-3f162cd185bd",
  "code": 200,
  "msg": "",
  "device_uid": "iYRkfVpi77",
  "timestamp": 1695265671000
}