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 2.1, 2.2 und 3.3 ausreichend sein. Die Variablen selbst sind im Dimplex Wiki dokumentiert: https://dimplex.atlassian.net/wiki/x/AQDwzQ .
1 PluginManager
1.1 PluginManager 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 3830423536353938 -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 3830423536353938 -t extern/desktop/set_value_reply/request_reboot |
1.2 PluginManager Report-Update-State
Method | SUBSCRIBE extern/broadcast/report_update_state |
Description | Receive notifications about each step of a gateway, appliance or image update. |
Response body | {
"type": "<Update type which is running. Currently, that is '<gateway type>', 'ImageUpdate' or 'ApplianceFirmwareUpdate' (String)>",
"versionFrom": "<Version to update from (String)>",
"versionTo": "<Version to update to (String)>",
"updateFile": "<Update filename the gateway uses (String)>"
"started": "<Timestamp when this update process was started - used to identify the update process (Date ISO 8601)>",
"event": "<Event ID which happened. See below for possible values (String)>",
"message": "<Optional additional info for the event (String)>",
"isFinal": <true if this is the last event of this update process, i.e. the update either failed or was successful (boolean)>
}
Values for "event" can be:
* "started": Update process was started
* "start_fail": Update failed to start (e.g. blacklisted)
* "receive_download_url_success": Received the download URL for the container
* "receive_download_url_fail": Failed to fetch the download URL
* "download_success": Downloaded the update container
* "download_fail": Failed to download the update container
* "extract_success": Extracted the container
* "extract_fail": Failed to extract the container
* "verify_success": All verifications succeeded
* "verify_fail": Verification failed (details in the message)
* "install_success": Installation of update succeeded
* "install_fail": Installation failed, rollback was performed
Example:
{
"type": "nwpm2_plugin",
"versionFrom": "1.0.0",
"versionTo": "1.1.0",
"updateFile": "update_nwpm2_plugin_1.1.0.zip"
"started": "2012-04-23T18:25:43.511Z",
"event": "started",
"message": "an update message",
"isFinal": false
} |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t extern/broadcast/report_update_state |
1.3 PluginManager Change-Local-Password
Method | PUBLISH gateway/plugin_manager/set_value/change_local_password |
Description | Change the local password used by MQTT and the websites. The password needs to be between 8 and 64 characters long with no whitespace and special characters and is required to have at least one lower case letter, one upper case letter and one number. |
Request body | Same as modbus-write. Name is "change_local_password" instead of a modbus index and value is an embedded JSON in the format: {
"oldPw": "<Current local password (string)>",
"newPw": "<New local password to use (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 3830423536353938 -t gateway/plugin_manager/set_value/change_local_password -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/change_local_password -m '{"name":"change_local_password","value":"{\"oldPw\":\"80B56598 \",\"newPw\":\"2x8D2jzZARrscc8AuTAy\"}"}' |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t extern/desktop/set_value_reply/change_local_password |
1.4 PluginManager Reset-Local-Password
Method | PUBLISH gateway/plugin_manager/set_value/reset_local_password |
Description | Reset the local password to the default one. This is only possible within the first 10 minutes after system reboot. Note that the special reset passwort ports which are not password protected need to be used. |
Request body | Same as modbus-write. Name is "reset_local_password" instead of a modbus index and value is an empty string. |
Response body | Same as modbus-write. |
Example publish | mosquitto_pub -h 192.168.178.38 -p 61890 -t gateway/plugin_manager/set_value/reset_local_password -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/reset_local_password -m '{"name":"reset_local_password","value":""}' |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61890 -i desktop -t extern/desktop/set_value_reply/reset_local_password |
1.5 PluginManager Extern-Services-Blocked
Method | PUBLISH gateway/plugin_manager/get_value/extern_services_blocked |
Description | Check if extern services like SSH and Modbus TCP are blocked. |
Request body | Same as modbus-read. Name is "extern_services_blocked" instead of a modbus index. |
Response body | Same as modbus-read. Result value is "1" for blocked and "0" for unblocked. |
Example publish | mosquitto_pub -h 192.168.178.38 -p 61895 -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t gateway/plugin_manager/get_value/extern_services_blocked -D publish correlation-data 0 -D publish response-topic extern/desktop/get_value_reply/extern_services_blocked -m '{"name":"extern_services_blocked"}' |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t extern/desktop/get_value_reply/extern_services_blocked |
1.6 PluginManager Block-Extern-Services
Method | PUBLISH gateway/plugin_manager/set_value/block_extern_services |
Description | Block or unblock extern services like SSH and Modbus TCP. |
Request body | Same as modbus-write. Name is "block_extern_services" instead of a modbus index and value is "1" for block and "0" for unblock. |
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 3830423536353938 -t gateway/plugin_manager/set_value/block_extern_services -D publish correlation-data 0 -D publish response-topic extern/desktop/set_value_reply/block_extern_services -m '{"name":"block_extern_services","value":"0"}' |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t extern/desktop/set_value_reply/block_extern_services |
2 Modbus
2.1 Modbus read
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. |
Request MQTTv5 properties |
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 |
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 3830423536353938 -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 3830423536353938 -t extern/desktop/get_value_reply/496-497i |
2.2 Modbus write
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. |
Request MQTTv5 properties |
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 |
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 3830423536353938 -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 3830423536353938 -t extern/desktop/set_value_reply/496-497i |
2.3 Modbus change
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. |
Response body | |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t gateway/broadcast/changed_on/modbus/# |
2.4 Modbus clear previous value 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. |
Request MQTTv5 properties |
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 |
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 3830423536353938 -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 3830423536353938 -t extern/desktop/clear_prev_val_cache_reply |
2.5 Appliance 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 3830423536353938 -t extern/broadcast/error_history_state |
2.6 Appliance Lock-History-State
Method | SUBSCRIBE extern/broadcast/lock_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 3830423536353938 -t extern/broadcast/lock_history_state |
2.7 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 3830423536353938 -t extern/broadcast/appliance_time_state |
2.8 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 3830423536353938 -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 3830423536353938 -t extern/desktop/get_value_reply/appliance_time_get |
2.9 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 3830423536353938 -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 3830423536353938 -t extern/desktop/set_value_reply/appliance_time_set |
2.10 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 3830423536353938 -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 3830423536353938 -t extern/desktop/set_value_reply/appliance_utc_offset_set |
3 IoTHub
3.1 IoTHub 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 3830423536353938 -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 3830423536353938 -t extern/desktop/get_value_reply/cloud_communication_disabled |
3.2 IoTHub 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 3830423536353938 -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 3830423536353938 -t extern/desktop/set_value_reply/disable_cloud_communication |
3.3 IoTHub 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. |
Response body | |
Example subscribe | mosquitto_sub -h 192.168.178.38 -p 61895 -i desktop -u mqtt -P 80B56598 --psk-identity mqtt --psk 3830423536353938 -t extern/broadcast/twin_reported_state |