JSON Payloads

YuDash LYNX and other IoT Devices support the following JSON payload formats of payload. Each format has a unique number (starting with 10).

We explain each JSON format with an example of energy monitoring:

  • There are three process variables/tags. Voltage, frequency and energy, namely: volt1_in freq_in and kwhr_in

  • Numerical values (floating points) are read by LYNX for reach variable.

  • There is a string variable status_var1 which is used to capture device status information. This is an optional variable in which LYNX sends in device information at bootup and periodically.

  • The variable names for device information are treated just like process variables.

  • The timestamp variables are processed as per the given JSON format. It is a purely optional parameter and should only be used when back-fill feature is required.

  • LYNX has two user provided input strings (Payload Gen Key#1 and Payload Gen Key#2). We will call them plKey1 and plKey2.

JSON PAYLOADS

JSON_FORMAT_10

  • This is the simplest JSON format with key value pairs.

  • plKey1 and plKey2 are not used.

Sample payload format

{
  "volt1_in": 237.67,
  "freq_in": 49.98,
  "kwhr_in": 1792.17
}

Status Variable Payload

{
  "status_var1":"LYNX rebooted. count=7700. reason=0"
}

JSON_FORMAT_11

  • This is a two level JSON format with variable names as main key.

  • plKey1 is not used. plKey2 is used. This is set as "value" in the example below.

Data payload format

// JSON_FORMAT_11
{

  "volt1_in": {
    "value": 244.4
  },
  "freq_in": {
    "value": 50
  },
  "kwhr_in": {
    "value": 1792.17
  }
}

JSON_FORMAT_12

  • This is a JSON array with data points for each variables.

  • plKey1 is used (set to field in example). plKey2 is used and set as value in the example below.

Data payload format

[
  {
    "field": "volt1_in",
    "value": 242.34
  },
  {
    "field": "freq_in",
    "value": 49.92
  },
  {
    "field": "kwhr_in",
    "value": 1792.17
  }
]

Status Variable Payload

[
  {
    "field": "status_var1",
    "value": "status: RSS: -60 db, wifi_name: ***, wifi_ip:***"
  }
]

JSON_FORMAT_13

  • This is a two level JSON structure.

  • plKey1 is used (set to data in example). plKey2 is not used.

Data Payload

{
  "data": {
    "volt1_in": 241.65,
    "freq_in": 49.99,
    "kwhr_in": 1792.17
  }
}

Status Variable Payload

{
  "data": {
    "status_var1": "status: RSS: -62 db, wifi_name: ***, wifi_ip:###"
  }
}

JSON_FORMAT_14 and JSON_FORMAT_15

  • These are proprietary JSON formats for Indian State Pollution control Board.

JSON_FORMAT_16

  • Proprietary JSON payload for Indian OEM customer.

JSON_FORMAT_17 and JSON_FORMAT_18

  • Generic two level JSON payloads with option of array (FORMAT_17) and json (FORMAT_18).

TimeStamp Formats

LYNX supports the following timestamp formats to send to cloud server when timestamp has been enabled.

The time displayed on YuDash LYNX is local time (based on time-zone provided). In most cases, it is advised to store/send UTC time stamps.

UTC Time Stamp Formats

Time Stamp FormatSample Time Stamp

TS_50 (UTC Seconds)

1675630526

TS_51 (UTC MilliSeconds)

1675630526000

TS_52 (UTC YYYY-MM-DDTHH:MM:SS)

2023-02-05T20:55:26Z

TS_53 (UTC YYYY-MM-DD HH:MM:SS)

2023-02-05 20:55:26

TS_54 (UTC YYYY_MM_DD_HH_MM_SS)

2023_02_05_20_55_26

TS_55 (UTC YYYY-MM-DDTHH:MM:00)

2023-02-05 20:55:00 (seconds taken as 00)

TS_56 (UTC DD-MM-YYYY HH:MM:SS)

05-02-2023 20:55:26

Local Time Stamp Formats

Time Stamp FormatSample Time Stamp

TS_60 (LocalTime Seconds)

TS_61 (LocalTime MilliSeconds)

TS_62 (LocalTime YYYY-MM-DDTHH:MM:SS)

TS_63 (LocalTime YYYY-MM-DD HH:MM:SS)

TS_64 (LocalTime YYYY_MM_DD_HH_MM_SS)

TS_65 (LocalTime YYYY-MM-DDTHH:MM:00)

TS_66 (LocalTime DD-MM-YYYY HH:MM:SS)

The time stamps are sent along with Time Stamp Key (tsKey). They are grouped in within json format depending on JSON_FORMAT_. The timestamp key is set as timestamp in all the examples. Typically, based on server requirement timestamp, ts or time keywords are used.

JSON_FORMAT_10, TS_50

{
  "volt1_in": 247.55,
  "freq_in": 49.94,
  "kwhr_in": 1792.17,
  "timestamp": "1675630887"
}

Last updated