EcoWatt Technologies Logo

Solver – BESS C\&D strategy

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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_listcharge_list
    datadatatrueMessage content-See Payload - data/ChargeDetail
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Payload – data/ChargeDetail

    ParameterTypeRequiredDescriptionRangeExample
    idinttrueID-1
    charge_typeinttrueCharging/Discharging type (more types later)1 - scheduled charging/discharging1
    statusinttrueStrategy switch0 - off, 1 - on1
    yearinttrueYear(required if mode=1)2024
    month[]inttrueMonth selection (0 = January)[0..11][1,7,8,11]
    week_day[]intfalseDay of week selection (0 = Monday)[0..6][5,6]
    dates[]intfalseDate selection (0 = 1st)[0..30] (depends on month & year)[0,1]
    modeinttrueMode (depending on its value, week_day or dates are required)1 - monthly-date mode, 2 - monthly-week mode1 (if mode=1, dates required; if mode=2, week_day required)
    ems_devices[]emsDevicetrueDevice list--
    settings[]chargeTimetrueCharging/Discharging time segments--
    apply_to_allbooltrueWhether to include all first-level devices-false
  • Payload – emsDevice

    ParameterTypeRequiredDescriptionRangeExample
    idinttrueDevice ID-1
    namestrtrueDevice name-ems device
    site_namestrtrueSite name-ems site
    locationstrtrueDetailed location-Shanghai
    longitudefloattrueLongitude-
    latitudefloattrueLatitude-
    levelinttrueEMS level[1, 2]1
    typestrtrueDevice type-ems
    running_statusinttrueRunning status (1-run,2-offline,3-fault)[1,2,3]1
    hoststrtrueAddress-192.168.0.1
    portstrtruePort[0..65525]2171
    licensestrtrueActivation code-2YIZedmOtl4pcqo1EA4zhM5gofDI
  • Payload – chargeTime

    ParameterTypeRequiredDescriptionRangeExample
    start_hourinttrueStart hour[0..23]20
    start_minuteinttrueStart minute[0..59]0
    end_hourinttrueEnd hour[0..23]0
    end_minuteinttrueEnd minute[0..59]0
    cdc_enable_modeinttrueCharging/Discharging setting0-standby,1-charge,2-discharge1
    run_powerinttrueOperating power (in kW)[0..65535]300

    Time Explanation: start_hour,start_minute,end_hour,end_minute define a left-closed, right-open interval

    • For example, start_hour=14, start_minute=15, end_hour=15, end_minute=00 represents [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=00 represents [20:00, 00:00), i.e., from 20:00 up to midnight.
  • 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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_synccharge_sync
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage 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": "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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    replyUUIDtrueThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_synccharge_sync
    datadatatrueMessage content-See Payload - data/ChargeDetail
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage 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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_createcharge_create
    datadatatrueMessage content-See Payload - data/ChargeCreate
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Payload - data/ChargeCreate

    ParameterTypeRequiredDescriptionRangeExample
    charge_typeinttrueCharging/Discharging type (will support more)1 - scheduled charging/discharging1
    statusinttrueStrategy switch0-off,1-on1
    yearinttrueYear(if mode=1, required)2024
    month[]inttrueMonth selection (0 = January)[0..11][1,7,8,11]
    week_day[]intfalseDay of week selection (0 = Monday)[0..6][5,6]
    dates[]intfalseDate selection (0 = 1st)[0..30][0,1,2]
    modeinttrueMode (based on parameter value, check if week_day/dates is required)1-month/day,2-month/week1
    ems_device_uids[]stringfalseDevice UID list (uids, ids, apply_to_all choose one)--
    ems_device_ids[]intfalseDevice ID list (uids, ids, apply_to_all choose one)--
    apply_to_allboolfalseWhether to include all first-level devices (uids, ids, apply_to_all choose one)-true
    settings[]chargeTimetrueCharging/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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
    replyUUIDtrueThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_createcharge_create
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    datadatatrueOther dataSee data
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Response Codes

    Error CodeDescriptionNotes
    200Issued successfully
    400Parameter error
  • Data

    ParameterTypeDescription
    policy_idintCharging/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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_updatecharge_update
    datadatatrueMessage content-See Payload - data/ChargeUpdate
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Payload – data/ChargeUpdate

    ParameterTypeRequiredDescriptionRangeExample
    idinttrueStrategy ID--
    other fields seePayload - data/ChargeCreatefalse
  • 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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
    replyUUIDtrueThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_updatecharge_update
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage 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": "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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_deletecharge_delete
    datadatatrueMessage content-See Payload - data
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Payload – data

    ParameterTypeRequiredDescriptionRangeExample
    idinttrueCharging/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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
    replyUUIDtrueThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_deletecharge_delete
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage 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": "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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_update_allcharge_update_all
    datadatatrueMessage content-See Payload - data
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage 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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    replyUUIDtrueThe mid being replied to-ee2e8f09-b280-4e4d-bcb9-1529b703cfed
    typestrtrueMessage typecharge_update_allcharge_update_all
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (ms)(0, ∞)1696837112000
  • Response Codes

    Error CodeDescriptionNotes
    200Issued successfully
    400Parameter 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
  • Permission: Publish

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_by_nodecharge_by_node
    datadatatrueMessage content-See Payload - data/ChargeByNode
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (milliseconds)(0, ∞)1696837112000

Payload – data/ChargeByNode

ParameterTypeRequiredDescriptionRangeExample
node_idinttrueBranch 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
  • Permission: Subscribe

  • Payload Main Structure

    ParameterTypeRequiredDescriptionRangeExample
    midUUIDtrueMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
    replyUUIDtrueThe mid being replied to-3e681859-6917-4b9a-9afd-3f162cd185bd
    typestrtrueMessage typecharge_by_nodecharge_by_node
    codeinttrueResponse code-See Response Codes
    msgstrfalseFailure reason-Parameter error
    datadatatrueAdditional data-See Data below
    device_uidstrtrue(Secondary) device UID-iYRkfVpi77
    timestampinttrueMessage timestamp (milliseconds)(0, ∞)1696837112000

Response Codes

Error CodeDescriptionNotes
200Issued successfully
400Parameter error

Data

ParameterTypeDescription
policy_idintCharging/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
}