Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:mervis-scada:80-mqtt [2020/08/27 09:29]
l.osladil [Weintek compatible format]
en:mervis-scada:80-mqtt [2024/05/08 10:42] (current)
Line 121: Line 121:
 </code> </code>
 ==== Weintek compatible format ==== ==== Weintek compatible format ====
-=== Registration of available variables === +  We assume that all datetime values are in **UTC** 
- +  Print screens are from EasyBuilder Pro SW
-  Informs the subscribers of available variables +
-  * Publish message with “At least once delivery” +
-  * Topic: deviceId/TagConfiguration +
-  * Combination of the collection ID and Tag must be unique for every device! +
-  * Payload: UTF-8 JSON document +
-    * /FormatId: (string), message ID +
-    * /ApiVersion(int), version of API +
-    * /Complete (bool), must be true now +
-    * /Collections (Array of collection elements) +
-      * /Id (int), ID of the collection +
-      * /CollectionName (string) +
-      * /SampleRate (int), collection sample rate in ms +
-      /PublishInterval (int), collection publish interval in ms +
-      /TagData (Array of variable descriptions) +
-        /Tag (string), ID of the variable +
-        /Unit (string), unit of the variable +
-        /ValueType (string), ST type; only simple types are supported +
- +
-**Example** +
- +
-<code json> +
-+
- "FormatId": "TagConfiguration", +
- "ApiVersion": 1, +
- "Complete": true, +
- "Collections": [{ +
- "Id": 1, +
- "CollectionName": "Building 1", +
- "SampleRate": 60000, +
- "PublishInterval": 60000, +
- "TagData": [{ +
- "Tag": "Temperature1", +
- "Unit": "ºC", +
- "ValueType": "real" +
- }, +
-+
- "Tag": "Humidity", +
- "Unit": "%", +
- "ValueType": "word" +
- }] +
- }, +
-+
- "Id": 2, +
- "CollectionName": "Building 2", +
- "SampleRate": 120000, +
- "PublishInterval": 240000, +
- "TagData": [{ +
- "Tag": "Water flow", +
- "Unit": "m3/h", +
- "ValueType": "byte" +
- }, +
-+
- "Tag": "Current phase L1", +
- "Unit": "A", +
- "ValueType": "lreal" +
- }] +
- }] +
-+
-</code> +
 === Variable values === === Variable values ===
   * Publishes values of variables   * Publishes values of variables
   * Publish message with “At least once delivery”   * Publish message with “At least once delivery”
-  * Topic: deviceId/TagValues+  * Topic: $deviceId/mervis/values or $deviceId/mervis/values/*
   * Payload: UTF-8 JSON document   * Payload: UTF-8 JSON document
-    * /FormatId(string), message ID +    * /droot element 
-    /ApiVersion(int), version of API +      "property_name": value - property name, can contain metada(not required). Always use array [...] for value of property 
-    /CollectionId (int), identification of the collection +        metadata format: 
-    /TagData (Array of value items) +          "name" name of property 
-      * /Time (datetime), timestamp in ISO format (YYYY-MM-DDTHH:MM:SSZ), ideal is a UTC form +          "type" property type(we supported only [[https://kb.mervis.info/doku.php/en:mervis-scada:80-mqtt#our_supported_types|our list of types]]
-      /Values (Collection of Tag and value tuples)+          "unit" information about unit of value
  
 **Example** **Example**
Line 209: Line 149:
  
 </code> </code>
 +{{ :en:mervis-scada:annotation_2020-08-27_120101.png?600 |}}
 === Command registration === === Command registration ===
 +  * Topic: $deviceId/mervis/cmd_reg or $deviceId/mervis/cmd_reg/*
 +  * Format:
 +    * /d root element
 +      * "propertyName" must include some informations(separate by ","). Value is ignored.
 +        * "id" what is command id and define subscribe topic ($deviceId/mervis/command/change_temperature)
 +        * "name" just for customer info
 +        * "params" parameters with informations to command (**must include all parameters of supscribe topic**)
 +          * "name" parameter name in json
 +          * "type" type of parameter (we supported only [[https://kb.mervis.info/doku.php/en:mervis-scada:80-mqtt#our_supported_types|our list of types]])
 +          * "unit" information about unit of parameter
 +        * "ts" time span 
 <code> <code>
 { {
Line 218: Line 170:
 } }
 </code> </code>
 +choose/create $deviceId/mervis/cmd_reg/
 +{{ :en:mervis-scada:annotation_2020-08-27_110112.png?400 |}}
 +set general tab by screenshot
 +{{ :en:mervis-scada:annotation_2020-08-27_121338.png?400 |}}
 +add commands
 +{{ :en:mervis-scada:annotation_2020-08-27_115716.png?400 |}}
 +===Our supported types===
 +              * "generic_bool"
 +              * "generic_sint8"
 +              * "generic_uint8"
 +              * "generic_sint16"
 +              * "generic_uint16"
 +              * "generic_sint32"
 +              * "generic_uint32"
 +              * "generic_sint64"
 +              * "generic_uint64"
 +              * "generic_float32"
 +              * "generic_float64"
 +              * "generic_string"
 +              * "generic_datetime"
 +===Create a subcribe topic for executing command===
 +  * for previous command example
 +  * create topic $deviceId/mervis/command/change_temperature
 +  * with two addresses:
 +    * temperature(32-bit float)
 +    * date(string)
 +{{ :en:mervis-scada:annotation_2020-08-27_110134.png?600 |}}
  • © Energocentrum Plus, s.r.o. 2017 - 2025