Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:mervis-scada:82-iot-api [2019/04/16 13:22] m.kulvejt created |
en:mervis-scada:82-iot-api [2021/04/08 13:04] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== IoT API ====== | ====== IoT API ====== | ||
- | < | + | You can send measured data to Mervis via several APIs. The IoT API is the most flexible one - you can define custom Levels and Tags to be used for later data processing and Mervis SCADA project generation. |
+ | |||
+ | ===== Simple Example ===== | ||
+ | |||
+ | < | ||
{ | { | ||
- | " | + | " |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | "levels": [{ | + | |
- | " | + | |
- | " | + | |
- | }, | + | |
- | { | + | |
- | "id": | + | |
- | "name": " | + | |
- | }, | + | } |
- | { | + | ], |
- | "id": | + | |
- | "name": "Area 52" | + | |
- | }], | + | |
- | "variable": [{ | + | |
- | "id": | + | |
- | "name": "Outside temperature", | + | }, { |
- | "dataType": "float64", | + | |
- | "unit": "°C", | + | |
- | "values": | + | |
- | "timestamp": | + | |
- | "period": "PT10M", | + | |
- | " | + | |
- | }, | + | } |
- | { | + | ], |
- | "timestamp": "2019-04-18T15: | + | |
- | "value": | + | |
- | }], | + | |
- | "level1_idx": 3, | + | |
- | "level2_idx": | + | |
- | "levelX_idx": 2, | + | } |
- | "level1_txt": "Area 52", | + | |
- | "level2_txt": | + | } |
- | "levelX_txt": | + | ] |
- | " | + | |
- | " | + | |
- | "value": "VZT1", | + | |
- | "type": "string" | + | |
- | }, | + | |
- | { | + | |
- | "name": "area", | + | |
- | "value": "256", | + | |
- | "type": "number" | + | |
- | }] | + | |
- | }] | + | |
- | }] | + | |
} | } | ||
</ | </ | ||
+ | |||
+ | * Use always UTC form of the timestamp. Otherwise a default conversion will occurr. Default conversion can depend on many factors and is not reliable. Even if it works right now for your time zone it can change in the future as we upgrade/ | ||
+ | * Available data types: | ||
+ | * float64 | ||
+ | * string | ||
+ | * int64 | ||
+ | * uint64 | ||
+ | * bool | ||
+ | * datetime | ||
+ | |||
+ | |||
+ | ===== Full Example ===== | ||
+ | |||
+ | |||
+ | <code javascript> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ], | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | ] | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||