MQTT - Unterstützte Operationen

Die folgenden Operationen werden von der Schnittstelle unterstützt und können vom Broker verwendet werden. In den meisten Szenarien sollten die Operationen 5.3, 5.4 und 5.14 ausreichend sein. Die Variablen selbst sind im Dimplex Wiki dokumentiert.

PluginManager Request-Reboot

Method

PUBLISH gateway/plugin_manager/set_value/request_reboot

Method

PUBLISH gateway/plugin_manager/set_value/request_reboot

Description

Restart system or only gateway plugin.

Request body

Same as modbus-write. Name is "request_reboot" instead of a modbus index and value is an embedded JSON in the format:

{ "system_reboot": <True for system reboot, false for gateway plugin restart (bool)>, "force": <True if restart should be forced, e.g. despite running update (bool)> }

Response body

Same as modbus-write.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/plugin_manager/set_value/request_reboot -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/request_reboot -m '{"name":"request_reboot","value":"{\"system_reboot\": true,\"force\": \"false\"}"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/set_value_reply/request_reboot

Modbus read

Method

PUBLISH gateway/modbus/get_value/{modbus_index_range}

Method

PUBLISH gateway/modbus/get_value/{modbus_index_range}

Description

Request a range of modbus values. The response will be published on given response-topic with given correlation-data. The response-topic has to be conform with internal and external ACL patterns. Response-topic needs read access on external ACL and write access on internal ACL.

Request MQTTv5 properties

• correlation-data: <int>
• response-topic: <string>
Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value has to be added to the request body:

"mqtt_msg_properties": {"correlation_data": <int>, "response_topic": <string>}

Request body

{ "name": <Modbus index range (string)> } Example: { "name": "150-151i" }

Response MQTTv5 properties

• correlation-data: <int>
Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value is included in the response body:

Response body

If status 0:

If status not 0:

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/get_value/496-497i -D publish correlation-data 0 -D publish response-topic extern/desktop/get_value_reply/496-497i -m '{"name":"496-497i"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/get_value_reply/496-497i

Modbus write

Method

PUBLISH gateway/modbus/set_value/{modbus_index_range}

Method

PUBLISH gateway/modbus/set_value/{modbus_index_range}

Description

Write a range of modbus values. The response will be published on given response-topic with given correlation-data. The response-topic has to be conform with internal and external ACL patterns. Response-topic needs read access on external ACL and write access on internal ACL.

Request MQTTv5 properties

  • correlation-data: <int>

  • response-topic: <string>

Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value has to be added to the request body:

Request body

Response MQTTv5 properties

  • correlation-data: <int>

Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value is included in the response body:

Response body

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/set_value/496-497i -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/496-497i -m '{"name":"496-497i","value":["1","3"]}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/set_value_reply/496-497i

Modbus change

Method

SUBSCRIBE gateway/broadcast/changed_on/modbus/#

Method

SUBSCRIBE gateway/broadcast/changed_on/modbus/#

Description

Receive notifications of modbus variables that changed or rather need to be sent according to the current telemetry configuration.

Request MQTTv5 properties

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/broadcast/changed_on/modbus/#

Modbus clear previous value cache

Method

PUBLISH gateway/modbus/clear_prev_val_cache

Method

PUBLISH gateway/modbus/clear_prev_val_cache

Description

Clear internal cache of last sent register values. This causes the values to be sent again on next internal query regardless of the current telemetry configuration. Useful to immediately get all values when subscribing to the Modbus-Change topic. The response-topic has to be conform with internal and external ACL patterns. Response-topic needs read access on external ACL and write access on internal ACL.

Request MQTTv5 properties

  • correlation-data: <int>

  • response-topic: <string>

Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value has to be added to the request body:

Request body

Response MQTTv5 properties

  • correlation-data: <int>

Alternatively, for pre MQTTv5 clients without property support, the following JSON-Value is included in the response body:

Response body

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/clear_prev_val_cache -m '{"mqtt_msg_properties":{"correlation_data":0,"response_topic":"extern/desktop/clear_prev_val_cache_reply"},"twin":true,"telemetry":false}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/clear_prev_val_cache_reply

Appliance Error-History-State

Method

SUBSCRIBE extern/broadcast/error_history_state

Method

SUBSCRIBE extern/broadcast/error_history_state

Description

Receive notifications when the error history stored in the appliance changes. On every change the complete error history is published. The entries are sorted by time descending.

Response body

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/broadcast/error_history_state

Appliance Lock-History-State

Method

SUBSCRIBE extern/broadcast/error_history_state

Method

SUBSCRIBE extern/broadcast/error_history_state

Description

Receive notifications when the lock history stored in the appliance changes. On every change the complete lock history is published. The entries are sorted by time descending.

Response body

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/broadcast/lock_history_state

Appliance Time-State

Method

SUBSCRIBE extern/broadcast/appliance_time_state

Method

SUBSCRIBE extern/broadcast/appliance_time_state

Description

Receive notifications when the appliance time configuration is changed.

Response body

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/broadcast/appliance_time_state

Appliance Time-Get

Method

PUBLISH gateway/modbus/get_value/appliance_time_get

Method

PUBLISH gateway/modbus/get_value/appliance_time_get

Description

Retrieve the current appliance_time.

Request body

Same as modbus-read. Name is "appliance_time_get" instead of a modbus index.

Response body

Same as modbus-read. Result value is an ISO 8601 date string instead of a number string.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/get_value/appliance_time_get -D publish correlation-data 0 -D publish response-topic extern/desktop/get_value_reply/appliance_time_get -m '{"name":"appliance_time_get"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/get_value_reply/appliance_time_get

Appliance Time-Set

Method

PUBLISH gateway/modbus/set_value/appliance_time_set

Method

PUBLISH gateway/modbus/set_value/appliance_time_set

Description

Set the current appliance_time.

Request body

Same as modbus-write. Name is "appliance_time_set" instead of a modbus index and value is an ISO 8601 date string instead of a number string.

Response body

Same as modbus-write.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/set_value/appliance_time_set -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/appliance_time_set -m '{"name":"appliance_time_set","value":"2023-01-23T21:26:31"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/set_value_reply/appliance_time_set

Appliance UTC-Offset-Set

Method

PUBLISH gateway/modbus/set_value/appliance_utc_offset_set

Method

PUBLISH gateway/modbus/set_value/appliance_utc_offset_set

Description

Set the UTC offset and the corresponding timezone name of the appliance. A potential resulting time change only happens immediately if the gateway has internet connection, otherwise it is delayed until there is connection.

Request body

Same as modbus-write. Name is "appliance_utc_offset_set" instead of a modbus index and value is an embedded JSON in the format:

Response body

Same as modbus-write.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/modbus/set_value/appliance_utc_offset_set -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/appliance_utc_offset_set -m '{"name":"appliance_utc_offset_set","value":"{\"utc_offset_minutes\": 660, \"timezone_name\": \"Antarctica/Casey\"}"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/set_value_reply/appliance_utc_offset_set

IoTHub Cloud-Communication-Disabled

Method

PUBLISH gateway/iothub/get_value/cloud_communication_disabled

Method

PUBLISH gateway/iothub/get_value/cloud_communication_disabled

Description

Check if cloud communication is disabled.

Request body

Same as modbus-read. Name is "cloud_communication_disabled" instead of a modbus index.

Response body

Same as modbus-read. Result value is "1" for disabled and "0" for enabled.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/iothub/get_value/cloud_communication_disabled -D publish correlation-data 0 -D publish response-topic extern/desktop/get_value_reply/cloud_communication_disabled -m '{"name":"cloud_communication_disabled"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/get_value_reply/cloud_communication_disabled

IoTHub Disable-Cloud-Communication

Method

PUBLISH gateway/iothub/set_value/disable_cloud_communication

Method

PUBLISH gateway/iothub/set_value/disable_cloud_communication

Description

Disable or enable cloud communication.

Request body

Same as modbus-write. Name is "disable_cloud_communication" instead of a modbus index and value is "1" for disable and "0" for enable.

Response body

Same as modbus-write.

Example publish

mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t gateway/iothub/set_value/disable_cloud_communication -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/disable_cloud_communication -m '{"name":"disable_cloud_communication","value":"1"}'

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/desktop/set_value_reply/disable_cloud_communication

IoTHub Twin-Reported-State

Method

SUBSCRIBE extern/broadcast/twin_reported_state

Method

SUBSCRIBE extern/broadcast/twin_reported_state

Description

Receive notifications when the reported properties section of the device twin changes. On every change the complete reported properties section is published. This state is independant from cloud connection.

Request body

Example subscribe

mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 80B56598 -t extern/broadcast/twin_reported_state