Latest API Version: 2.0.0
MQTT Version: 3.1.1
A gateway will publish/subscribe to topics under
is the gateway MAC address, for example
All gateways will also subscribe to the topics starting with
incoming broadcast requests.
MT2 can be configured to operate in two modes:
- raw (default)
The mode only determines the format of reporting topics. All request/response topics are available in both modes.
In raw mode (default) the gateway will use raw hex strings for values and identifiers when reporting. No translation is required by the gateway.
In decoded mode the gateway will try to decode identifiers to human-readable identifier names and JSON values when reporting. If it fails to decode, it will fall back to raw. In decoded mode, topics ending with -decoded will be used when reporting.
In versions prior to 2.0.0, the default mode was called legacy and the topics were slightly different.
The following configuration parameters are used to configure the MT2 API connection for a gateway.
|host||Hostname of MQTT broker|
|port||Port number of MQTT broker|
|useTls||Set to true to use TLS|
|rootCertificates||Root CA certificates. Typically, not needed.|
|mode||"decoded" or "raw". When not set, mode is "raw". Added in version 1.1.1.|
|topicPrefix||Optional. When set, this topic will be added before /mt/.. Added in version 1.2.0.|
|disableSubscribe||Optional. When set to true, gateway will not subscribe to any topics and the gateway will not be able to handle requests. Default: false. Added in version 1.2.0.|
The gateway will connect with a client ID equal to the Bluetooth MAC address, 12 lowercase hex digits. Example: ef6d7dd1d9ed.
If there are breaking changes to the API, the mt/ prefix will normally be changed to distinguish between different breaking API versions. Major version is increased when doing breaking changes.
- Adding support for mode
- When migrating from 1.0.0, mode will be "legacy".
- New implementations should use "raw" or "decoded" mode.
- New raw-topics for (hex)
- Adding configuration options: topicPrefix, disableSubscribe
- Adding lastCount to device heartbeat payload.
- BREAKING CHANGE:
- Topics using decoded identifiers are now named ending with -decoded
- -raw ending has been removed and they are now the default/raw topics
- Former "legacy" mode is no longer used
- Added support for identifier value extensions. Optional ext property added to -decoded variants of request/response and reporting payloads
- Added read/write response metadata:
- responseTime, origin
- route, extenderId, extenderRoute (optional)