Reporting
The gateway will report from devices by publishing to the following generic topic structure:
mt/gateway/{g}/device/{d}/...
where {g}
is gateway MAC address and {d}
is device MAC address.
The format of MAC addresses is 12 lowercase hex digits.
The message payload is an UTF-8 encoded JSON object and always contains a property time. This is the time of the message in ISO-8601 format.
heartbeat
mt/gateway/{g}/device/{d}/heartbeat
Device heartbeat.
Payload
- time: time in ISO-8601 format.
- seq: sequence number 0-255
- status: a device status value. Non-zero values are used to indicate device error/warning.
- lastCount: number of heartbeat duplicates received for the previous seq. Introduced in version 1.3.0.
Example
mt/gateway/ef6d7dd1d9ed/device/cd10a7eff81f/heartbeat
{
"time": "2020-11-04T10:07:20.585Z",
"seq": 12,
"status": 0,
"lastCount:" 3
}
dfu
mt/gateway/{g}/device/{d}/dfu
Device is advertising in DFU mode. This can be looked upon as a DFU mode "heartbeat".
Payload
- time: time in ISO-8601 format.
- parent: Network node that picked up the DFU mode advertisement
- rssi: RSSI value.
Example
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/rssi
{
"time": "2020-12-03T11:31:39.788Z",
"parent": "ef6d7dd1d9ed",
"rssi": -58
}
rssi
mt/gateway/{g}/device/{d}/rssi
Signal strength between network node (parent) and a device. RSSI values from multiple parents can be used to estimate position of a device.
Payload
- time: time in ISO-8601 format.
- parent: Network node reporting the RSSI.
- channel: BLE advertising channel. Range: 37-39. (optional)
- rssi: RSSI value.
- seq: Sequence Number 0-255 (optional)
- unreachable: Boolean (optional, false by default when not present)
When unreachable is true the device cannot be reached through this parent.
Example
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/rssi
{
"time": "2020-10-19T12:32:47.485Z",
"parent": "e4ebc3f77f09",
"rssi": -58
}
property
mt/gateway/{g}/device/{d}/property/{identifer}
A device reported a property value.
This topic is used:
- In raw mode
- In decoded mode when the gateway is unable to decode
The identifier is a lowercase hex string identifier and value is a hex string.
Payload
- time: time in ISO-8601 format.
- value: the property value (hex string)
- seq: sequence number 0-255 (optional)
Example
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/property/8810
{
"time": "2020-10-19T11:19:20.610Z",
"value": "00"
}
property-decoded
mt/gateway/{g}/device/{d}/property-decoded/{identifer-name}
A device reported a property value.
This topic is used in decoded mode when the gateway is able to decode.
Note
If the gateway is unable to decode the identifier, it will publish as raw on the property topic.
Payload
- time: time in ISO-8601 format
- value: property value (JSON)
- ext: value extensions (JSON object, optional)
- seq: sequence number 0-255 (optional)
Example
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/property-decoded/motion
{
"time": "2020-10-19T11:19:20.610Z",
"value": 0
}
measurement
mt/gateway/{g}/device/{d}/measurement/{identifer}
A device reported a measurement.
This topic is used:
- In raw mode
- In decoded mode when the gateway is unable to decode
Payload
- time: time in ISO-8601 format.
- seq: measurement sequence number (0-255)
- value: value of measurement (hex string)
Example
mt/gateway/ef6d7dd1d9ed/device/cd10a7eff81f/measurement/8800
{
"time": "2020-11-04T10:09:42.662Z",
"seq": 128,
"value": "0A8B"
}
measurement-decoded
mt/gateway/{g}/device/{d}/measurement-decoded/{identifer-name}
A device reported a measurement.
This topic is used in decoded mode when the gateway is able to decode.
Note
If the gateway is unable to decode the identifier, it will publish as raw on the measurement topic.
Payload
- time: time in ISO-8601 format.
- seq: measurement sequence number (0-255)
- value: value of measurement (JSON)
- ext: value extensions (JSON object, optional)
Example
mt/gateway/ef6d7dd1d9ed/device/cd10a7eff81f/measurement-decoded/temperature
{
"time": "2020-11-04T10:09:42.662Z",
"seq": 128,
"value": 26.99
}
measurement-error
mt/gateway/{g}/device/{d}/measurement-error/{identifer}
A device reported a measurement error.
This topic is used:
- In raw mode
- In decoded mode when the gateway is unable to decode
Payload
- time: time in ISO-8601 format.
- seq: measurement sequence number (0-255)
- error: error code (integer). See Status Codes.
- errorExt: error code extension (integer) (optional)
Example
mt/gateway/ef6d7dd1d9ed/device/cd10a7eff81f/measurement-error/8800
{
"time": "2020-11-04T10:09:42.662Z",
"seq": 128,
"error": 35074
}
measurement-error-decoded
mt/gateway/{g}/device/{d}/measurement-error/{identifer-name}
A device reported a measurement error.
This topic is used in decoded mode when the gateway is able to decode.
Note
If the gateway is unable to decode the identifier, it will publish as raw on the measurement-error topic.
Payload
- time: time in ISO-8601 format.
- seq: measurement sequence number (0-255)
- error: error code (integer). See Status Codes.
- errorExt: error code extension (integer) (optional)
Example
mt/gateway/ef6d7dd1d9ed/device/cd10a7eff81f/measurement-error-decoded/temperature
{
"time": "2020-11-04T10:09:42.662Z",
"seq": 128,
"error": 8902
}
event
mt/gateway/{g}/device/{d}/event/{identifer}
A device fired an event.
This topic is used:
- In raw mode
- In decoded mode when the gateway is unable to decode
Payload
- time: time in ISO-8601 format.
- seq: sequence number (0-255)
- value: value associated with event (hex string) (optional)
Example
Button press:
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/event/998000
{
"time": "2020-10-19T12:35:38.479Z",
"seq": "1"
}
event-decoded
mt/gateway/{g}/device/{d}/event-decoded/{identifer-name}
A device fired an event.
This topic is used in decoded mode when the gateway is able to decode.
Note
If the gateway is unable to decode the identifier, it will publish as raw on the event topic.
Payload
- time: time in ISO-8601 format.
- seq: sequence number (0-255)
- value: value associated with event (JSON, optional)
- ext: value extensions (JSON object, optional)
Example
Button press:
mt/gateway/e4ebc3f77f09/device/da51bdeef18c/event-decoded/button-0
{
"time": "2020-10-19T12:35:38.479Z",
"seq": "1"
}