|  Developer
Updated on April 19, 2023

mqtt.client.register

Request from an MQTT client to the MQTT gateway addon to register MQTT client name. This allows the MQTT gateway to forward request/response messages to/from the client. MQTT gateway will forward the request/response messages to the client on client’s name MQTT topic.

  • Client name must start with “mqtt.” prefix
  • Client name can contain up to 32 characters
request:
Field Type Required Description
name string + Name of the MQTT client. Client should be subscribed to the MQTT topic with this name to receive requests and responses
response:
Examples
request:
{
  “msg_group“:“addon.mqtt_gateway”,
  “msg_class“: “request”,
  “msg_subclass“:“mqtt.client.register”,
  “result“:{
    “requestBody“: {,
        “name“:“mqtt.test_client”,
          }    
  “sender“:“mqtt.test_client”
  “uuid“:“63e134860000000174696001”
    }
}
response:
{
  “msg_group“:”response“,
  “msg_class“: “mqtt.test_client“,
  “msg_subclass“: “ResponseResult“,
  “result“: {
        “requestBody“: {},
        “uuid“:  “63e134860000000174696003”
    }
}
Code Message Data
-32500 Invalid MQTT client name