EcoWatt Technologies Logo

Setting - Architecture Design

Reporting Branch Design

  • Topic:
    • Custom MQTT by user: v1/watt/${PRODUCT_KEY}/${DEVICE}/power_node/list/post
    • Default MQTT by platform: v1/user/${TENANT}/${DEVICE}/power_node/list/post
  • Permission: Subscribe

Payload – Main Structure

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

Payload – data

ParameterTypeRequiredDescriptionRangeExample
idintYesID-1
namestrYesBranch Name-电表1 (Meter1)
typeintYesDevice Type (1 = Meter, 2 = EMS)[1,2]1
deviceeleMeter/emsDeviceYesDevice Details--
parent_idintYesParent Node ID-0
pathstrYesPath--0-
running_statusintYesRunning Status (1=Running,2=Offline,3=Fault)[1,2,3]1
children[]powerNodeYesChild Nodes--

Payload – emsDevice

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_statusintYes1=Running,2=Offline,3=Fault[1,2,3]1
hoststrYesAddress-192.168.0.1
portstrYesPort[0,65525]2171
licensestrYesActivation Code-2YIZedmOtl4pcqo1EA4zhM5gofDI

Payload – eleMeter

ParameterTypeRequiredDescriptionRangeExample
uidstrYesMeter UID-QmqEhterhgrzS66grew-1
station_namestrYesSite Name-Site1
portintYesPort[0,65535]1
namestrYesDevice Name-East Transformer
rateintYesMultiplier(0, ∞)100
running_statusintYes1=Online, 2=Offline[1,2]1

Payload Example

{
  "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
  "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed",
  "type": "power_node_list",
  "data": [{
    "id": 1,
    "name": "Main Meter",
    "type": 1,
    "device": {
      "uid": "QmqEhterhgrzS66grew-1",
      "station_name": "",
      "port": 1,
      "com_addr": "/dev/ttyS9",
      "slave_id": 1,
      "name": "Main Meter",
      "running_status": 2,
      "direction": -1,
      "rate": 100
    },
    "parent_id": 0,
    "path": "-0-",
    "running_status": 0,
    "children": null
  },{
    "id": 2,
    "name": "Left Meter",
    "type": 1,
    "device": {
      "uid": "QmqEhterhgrzS66grew-2",
      "station_name": "",
      "port": 2,
      "com_addr": "/dev/ttyS5",
      "slave_id": 1,
      "name": "Left Meter",
      "running_status": 2,
      "direction": 1,
      "rate": 20
    },
    "parent_id": 1,
    "path": "-0-1-",
    "running_status": 0,
    "children": null
  },{
    "id": 3,
    "name": "Device204",
    "type": 2,
    "device": {
      "uid": "QmqEiSCEuFNXCozS66W9y8-5",
      "name": "Device204",
      "site_name": "Test Site",
      "location": "",
      "longitude": 0,
      "latitude": 0,
      "level": 1,
      "charges": null,
      "license": "",
      "type": "",
      "running_status": 2,
      "host": "192.168.77.204",
      "port": 1502
    },
    "parent_id": 2,
    "path": "-0-1-2-",
    "running_status": 0,
    "children": null
  }],
  "device_uid": "${DEVICE_UID}",
  "timestamp": 1695265371000
}

Platform Requests Synchronization of Branch Design

  • Topic:
    • Custom MQTT by user: v1/watt/${PRODUCT_KEY}/${DEVICE}/power_node/sync/command
    • Default MQTT by platform: v1/user/${TENANT}/${DEVICE}/power_node/sync/command
  • Permission: Publish

Payload – Main Structure

ParameterTypeRequiredDescriptionRangeExample
midUUIDYesMessage ID-4c5b3c27-cea8-4ea1-a936-41fd3596e0e9
replyUUIDYesmid of the msg replied-3e681859-6917-4b9a-9afd-3f162cd185bd
typestrYesMessage Typepower_node_syncpower_node_sync
codeintYesResponse Code-See Response Codes
msgstrNoFailure Reason-Parameter Error
device_uidstrYes(Secondary) Device UID-iYRkfVpi77
timestampintYesTimestamp (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": "power_node_sync",
    "code": 200,
    "msg": "",
    "device_uid": "iYRkfVpi77",
    "timestamp": 1695265671000
}

Synchronize Branch Design Response

  • Topic:
    • Custom MQTT by user: v1/watt/${PRODUCT_KEY}/${DEVICE}/power_node/sync/result
    • Default MQTT by platform: v1/user/${TENANT}/${DEVICE}/power_node/sync/result
  • Permission: Subscribe

Payload – Main Structure

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

Payload – data

ParameterTypeRequiredDescriptionRangeExample
idintYesID-1
namestrYesBranch Name-电表1 (Meter1)
typeintYesDevice Type (1=Meter,2=EMS)[1,2]1
deviceemsMeter/emsDeviceYesDevice Details--
parent_idintYesParent Node ID-0
pathstrYesPath--0-
running_statusintYesRunning Status(1=Running,2=Offline,3=Fault)[1,3]1
children[]powerNodeYesChild Nodes--

Payload – emsDevice

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_statusintYes1=Running,2=Offline,3=Fault[1,2,3]1
hoststrYesAddress-192.168.0.1
portstrYesPort[0,65525]2171
licensestrYesActivation Code-2YIZedmOtl4pcqo1EA4zhM5gofDI

Payload – eleMeter

ParameterTypeRequiredDescriptionRangeExample
uidstrYesMeter UID-QmqEhterhgrzS66grew-1
station_namestrYesSite Name-Site 1
portintYesPort[0,65535]1
namestrYesDevice Name-East Transformer
rateintYesMultiplier(0,∞)100
running_statusintYes1=Online,2=Offline[1,2]1

Payload Example

{
  "trace_id": "577f5df0-65d6-432d-8aac-0116e9530152",
  "mid": "ee2e8f09-b280-4e4d-bcb9-1529b703cfed",
  "type": "power_node_sync",
  "data": [{
    "id": 1,
    "name": "Main Meter",
    "type": 1,
    "device": {
      "uid": "QmqEhterhgrzS66grew-1",
      "station_name": "",
      "port": 1,
      "com_addr": "/dev/ttyS9",
      "slave_id": 1,
      "name": "Main Meter",
      "running_status": 2,
      "direction": -1,
      "rate": 100
    },
    "parent_id": 0,
    "path": "-0-",
    "running_status": 0,
    "children": null
  },{
    "id": 2,
    "name": "Left Meter",
    "type": 1,
    "device": {
      "uid": "QmqEhterhgrzS66grew-2",
      "station_name": "",
      "port": 2,
      "com_addr": "/dev/ttyS5",
      "slave_id": 1,
      "name": "Left Meter",
      "running_status": 2,
      "direction": 1,
      "rate": 20
    },
    "parent_id": 1,
    "path": "-0-1-",
    "running_status": 0,
    "children": null
  },{
    "id": 3,
    "name": "Device204",
    "type": 2,
    "device": {
      "uid": "QmqEiSCEuFNXCozS66W9y8-5",
      "name": "Device204",
      "site_name": "Test Site",
      "location": "",
      "longitude": 0,
      "latitude": 0,
      "level": 1,
      "charges": null,
      "license": "",
      "type": "",
      "running_status": 2,
      "host": "192.168.77.204",
      "port": 1502
    },
    "parent_id": 2,
    "path": "-0-1-2-",
    "running_status": 0,
    "children": null
  }],
  "device_uid": "${DEVICE_UID}",
  "timestamp": 1695265371000
}