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 08:53]
l.osladil
en:mervis-scada:80-mqtt [2024/05/08 10:42] (current)
Line 121: Line 121:
 </code> </code>
 ==== Weintek compatible format ==== ==== Weintek compatible format ====
 +  * We assume that all datetime values are in **UTC**
 +  * Print screens are from EasyBuilder Pro SW
 +=== Variable values ===
 +  * Publishes values of variables
 +  * Publish message with “At least once delivery”
 +  * Topic: $deviceId/mervis/values or $deviceId/mervis/values/*
 +  * Payload: UTF-8 JSON document
 +    * /d: root element
 +      * "property_name": value - property name, can contain metada(not required). Always use array [...] for value of property
 +        * metadata format:
 +          * "name" name of property
 +          * "type" property type(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 value
 +
 +**Example**
 +
 +<code json>
 +{
 +    "d" : {
 +        "name:MyHomeTemperature, type:generic_sint64, unit:°C" : [ 0 ],
 +        "number C" : [ 0 ],
 +        "Bit" : [ false ],
 +        "My array" : [ 0, 10, 20 ]
 +    },
 +    "ts" : "2020-08-27T07:10:24.360316"
 +}
 +
 +</code>
 +{{ :en:mervis-scada:annotation_2020-08-27_120101.png?600 |}}
 +=== 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>
 +{
 +    "d" : {
 +        "id:change_temperature, name:change temperature in house ,params:[{name: temperature, type:generic_float64, unit:°C}, {name: date, type:generic_datetime, unit:UTC}]" : false
 +    },
 +    "ts" : "2020-08-27T07:10:11.356013"
 +}
 +</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