Skip to main content

JSON

Json Data format for Visamic#

Table of Contents

  1. Format options
    1. Simplest format
    2. Multi-value input
    3. Map values

Visamic can accept single or multiple data values via one input payload.

Here are some examples:

Simplest format#

  • name (each data item requires an attribute name)
  • unit (unit to identify the value)
  • value

Example:
[{"Dist":[{"u":"km","v":60}]}] (60km)

[  {    "Dist": [      {        "u": "km",        "v": "60"      }    ]  }]

Multi-value input#

Includes variable with timestamp.

  • name
  • timestamp: unit, value
  • unit, value

Several values for different variables may be combined in one payload.

Example:
[{"A":[{"t":"2019-09-23T17:11:13.8470236+02:00","u":"km/h","v":0.05}]},{"B":[{"t":"2019-09-23T17:11:13.8470236+02:00","u":"ºC","v":11.90}]},{"C":[{"t":"2019-09-23T17:11:13.8470236+02:00","u":"lum","v":40.73}]},{"D":[{"u":"Hz","v":704.00}]}]

[  {    "A": [      {        "t": "2019-09-23T17:11:13.8470236+02:00",        "u": "km/h",        "v": 0.05      }    ]  },  {    "B": [      {        "t": "2019-09-23T17:11:13.8470236+02:00",        "u": "ºC",        "v": 11.9      }    ]  },  {    "C": [      {        "t": "2019-09-23T17:11:13.8470236+02:00",        "u": "lum",        "v": 40.73      }    ]  },  {    "D": [      {        "u": "Hz",        "v": 704      }    ]  }]

Note that there is no need for indentation in the format. Standard json brackets should be used to delimit the variables.

Map Values#

When sending location values for a map panel, you need to respect the LAT and LON naming convention for the attributes.

Example:
[{"d":{"LAT":[{"v":50.7,"u":"LAT"}],"LON":[{"v":9.05,"u":"LON"}]}}]

[  {    "d": {      "LAT": [        {          "v": 50.7,          "u": "LAT"        }      ],      "LON": [        {          "v": 9.05,          "u": "LON"        }      ]    }  }]