MQTT Device Integrated
Beaver IoT supports working as an MQTT broker to connect with Milesight devices or third-party devices, to get the device information and data.
Compatibility
- Any MQTT device: the report content is in JSON format, and supports configuring the uplink topic.
Device Template Management
Beaver IoT supports parsing data formats from devices with different reporting formats into entities using device templates, facilitating subsequent data visualization or management.
Add Template
-
Go to Integration page of Beaver IoT platform to select MQTT Device Integrated integration, then go to Device template management tab and click +Add to add a new template.
-
Fill in a unique template name and a uplink topic for device to report, then click the copy icon to save this topic.
-
Configure the device entity definition and remark, click Confirm to save this template.
Parameter Description Device template name This name must be unique and may only contain these characters: A-Z, a-z, 0-9, “_”, “@”, “#”, “$”, “-”, “/”, “[”, “]” Device topic When filling in this topic, it must begin with “/”. The preceding part of this topic is fixed content and cannot be modified, please copy it in its entirety. Device entity definition Parse the reported data into distinct entities. Remark Optional field. Report example:
{
"device_id": "24E124710E338704",
"device_name": "Device 1",
"temperature": 26.8,
"humidity": 15.2,
"status": 1,
"time": "2025-07-02 15:19:35"
}Corresponding device template:
definition:
input:
type: object
properties:
- key: device_id # json key
type: string # data type
required: true
is_device_id: true
entity_mapping: 'device_id' # entity identifier
- key: device_name # json key
type: string # data type
is_device_name: true
- key: temperature # json key
type: double # data type
entity_mapping: 'temperature' # entity identifier
- key: humidity # json key
type: double # data type
entity_mapping: 'humidity' # entity identifier
- key: status # json key
type: long # data type
entity_mapping: 'status' # entity identifier
- key: time # json key
type: string # data type
entity_mapping: 'time' # entity identifier
output:
type: object
properties:
- key: device_id # json key
type: string # data type
entity_mapping: 'device_id' # entity identifier
- key: temperature # json key
type: double # data type
entity_mapping: 'temperature' # entity identifier
- key: humidity # json key
type: double # data type
entity_mapping: 'humidity' # entity identifier
- key: status # json key
type: long # data type
entity_mapping: 'status' # entity identifier
- key: time # json key
type: string # data type
entity_mapping: 'time' # entity identifier
initial_entities:
- identifier: 'device_id' # entity identifier
name: 'device_id' # entity name
value_type: string # entity value type
type: property # entity type
access_mod: R
- identifier: 'temperature' # entity identifier
name: 'temperature' # entity name
value_type: double # entity value type
type: property # entity type
access_mod: R
attributes:
unit: '℃'
- identifier: 'humidity' # entity identifier
name: 'humidity' # entity name
value_type: double # entity value type
type: property # entity type
access_mod: R
attributes:
unit: '%'
- identifier: 'status' # entity identifier
name: 'status' # entity name
value_type: long # entity value type
type: property # entity type
access_mod: R
attributes:
enum:
0: 'Offline'
1: 'Online'
- identifier: 'time' # entity identifier
name: 'time' # entity name
value_type: string # entity value type
type: property # entity type
access_mod: RTemplate parameter:
Parameter Required Description definition Yes input Yes Define the JSON format of the uplink content type Yes The value is fixed as object properties Yes key Yes JSON data item name type Yes JSON data type,Options: object, long, double, boolean, string required No Whether is key definitely be reported,Options: true, false entity_mapping No The identifier value mapped to the entity is_device_id No Whether this key value is device id, Options::true, false is_device_name No Whether this key value is device name Options: true, false properties No When the key type is object, the define the next level parameters output No Define the JSON format of the downlink content type Yes The value is fixed as object properties Yes key Yes JSON data item name type Yes JSON data type,Options: object, long, double, boolean, string entity_mapping No The identifier value mapped to the entity value No The fixed value of this key properties No When the key type is object, the define the next level parameters initial_entities Yes Define the format of device entities identifier Yes Entity unique identifier name Yes Entity name value_type Yes Entity data type,Options: object, long, double, boolean, string type Yes Entity type,Options: property, service, event access_mod Yes Type of access,Options: R,W,RW attributes No Entity attributes unit No Unit fraction_digits No Decimal places, double type use only max No Maximum value, long or double type use only min No Minimum value, long or double type use only max_length No Maximum length, string type use only min_length No Minimum length, string type use only enum No Enumeration values,the value is a list which the format is key: value
format No When the value is HEX
, the content is HEX characters; when the value isIMAGE: BASE64
orIMAGE: URL
, the content is picturedefault_value No default value optional No Options: true, false children No Children entity list
Test Template
- Select the desired template, click Test Data icon.
- Enter the JSON format report data example on the left, or click Generate simulated data.
- Click Simulation report, the test result will display on the right.
Edit Template
Select the desired template, click Edit icon to edit the template.
After adding the template, it is not suggested to modify the entity definition content, as this may cause the Beaver IoT to fail to parse it correctly and result in anomalies in existing entities.
Delete Template
When deleting templates, the associated device and all its data will be deleted simultaneously.
Delete a template:Click Delete icon of desired template to delete this template.
Delete template in bulk: Check the boxes of desired templates, click Delete button at the top to delete these templates.
Integration Steps
-
Go to Integration page of Beaver IoT platform and select MQTT Device Integrated integration to get MQTT broker information.
-
Go to configuration page of the MQTT device to configure the MQTT broker information, and paste the device uplink topic from device template (refer to step 2 of Add Template) .
noteBefore configuration, ensure the MQTT device is able access the MQTT broker address of the Beaver IoT platform.
-
Save the settings and ensure the device is connected to Beaver IoT. After connected, Beaver IoT will create the device and corresponding entities automatically, which can be found on the relevant pages.