From f77d71f2028c56547f05ea7320c16300ba59173d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B0=8F=E4=BA=91?= Date: Sat, 24 Jan 2026 09:32:20 +0800 Subject: [PATCH] push --- docker/thingsboard/dji.conf | 349 ++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+) create mode 100644 docker/thingsboard/dji.conf diff --git a/docker/thingsboard/dji.conf b/docker/thingsboard/dji.conf new file mode 100644 index 0000000..9419699 --- /dev/null +++ b/docker/thingsboard/dji.conf @@ -0,0 +1,349 @@ +{ + "broker": { + "host": "mqtt.t-aaron.com", + "port": 10883, + "version": 5, + "clientId": "ThingsBoard_gateway", + "security": { + "type": "basic", + "username": "admin", + "password": "admin" + }, + "maxNumberOfWorkers": 100, + "maxMessageNumberPerWorker": 10 + }, + "mapping": [ + { + "topicFilter": "thing/product/7C+/osd", + "subscriptionQos": 0, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "(?<=thing/product/)[^/]+(?=/osd)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "default" + }, + "attributes": [ + { + "key": "dock_sn", + "type": "string", + "value": "${gateway}" + }, + { + "key": "sub_device.device_sn", + "type": "string", + "value": "${data.sub_device.device_sn}" + }, + { + "key": "mode_code", + "type": "integer", + "value": "${data.mode_code}" + }, + { + "key": "firmware_version", + "type": "string", + "value": "${data.firmware_version}" + }, + { + "key": "latitude", + "type": "double", + "value": "${data.latitude}" + }, + { + "key": "longitude", + "type": "double", + "value": "${data.longitude}" + } + ], + "timeseries": [ + { + "key": "air_conditioner.air_conditioner_state", + "type": "string", + "value": "${data.air_conditioner.air_conditioner_state}" + }, + { + "key": "flighttask_step_code", + "type": "integer", + "value": "${data.flighttask_step_code}" + }, + { + "key": "drone_in_dock", + "type": "string", + "value": "${data.drone_in_dock}" + }, + { + "key": "sub_device.device_online_status", + "type": "integer", + "value": "${data.sub_device.device_online_status}" + }, + { + "key": "drone_charge_state.state", + "type": "integer", + "value": "${data.drone_charge_state.state}" + }, + { + "key": "air_conditioner.air_conditioner_state", + "type": "integer", + "value": "${data.air_conditioner.air_conditioner_state}" + }, + { + "key": "humidity", + "type": "double", + "value": "${data.humidity}" + }, + { + "key": "temperature", + "type": "double", + "value": "${data.temperature}" + }, + { + "key": "acc_time", + "type": "integer", + "value": "${data.acc_time}" + }, + { + "key": "network_state.type", + "type": "integer", + "value": "${data.network_state.type}" + }, + { + "key": "wind_speed", + "type": "double", + "value": "${data.wind_speed}" + }, + { + "key": "rainfall", + "type": "integer", + "value": "${data.rainfall}" + }, + { + "key": "position_state.rtk_number", + "type": "integer", + "value": "${data.position_state.rtk_number}" + }, + { + "key": "alternate_land_point.longitude", + "type": "double", + "value": "${data.alternate_land_point.longitude}" + }, + { + "key": "alternate_land_point.latitude", + "type": "double", + "value": "${data.alternate_land_point.latitude}" + }, + { + "key": "environment_temperature", + "type": "double", + "value": "${data.environment_temperature}" + }, + { + "key": "network_state.rate", + "type": "double", + "value": "${data.network_state.rate}" + }, + { + "key": "cover_state", + "type": "integer", + "value": "${data.cover_state}" + } + ] + } + }, + { + "topicFilter": "thing/product/158+/osd", + "subscriptionQos": 0, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "(?<=thing/product/)[^/]+(?=/osd)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "message", + "deviceProfileExpression": "default" + }, + "attributes": [ + { + "key": "mode_code", + "type": "integer", + "value": "${data.mode_code}" + }, + { + "key": "dock_sn", + "type": "string", + "value": "${gateway}" + } + ], + "timeseries": [ + { + "key": "total_flight_sorties", + "type": "string", + "value": "${data.total_flight_sorties}" + }, + { + "key": "height_limit", + "type": "integer", + "value": "${data.height_limit}" + }, + { + "key": "distance_limit_status.distance_limit", + "type": "integer", + "value": "${distance_limit_status.distance_limit}" + }, + { + "key": "battery", + "type": "string", + "value": "${data.battery}" + } + ] + } + }, + { + "topicFilter": "thing/product/7C+/state", + "subscriptionQos": 0, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "(?<=thing/product/)[^/]+(?=/state)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "default" + }, + "attributes": [ + { + "key": "firmware_version", + "type": "string", + "value": "${data.firmware_version}" + } + ], + "timeseries": [] + } + }, + { + "topicFilter": "thing/product/158+/state", + "subscriptionQos": 0, + "converter": { + "type": "json", + "deviceInfo": { + "deviceNameExpression": "(?<=thing/product/)[^/]+(?=/state)", + "deviceNameExpressionSource": "topic", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "default" + }, + "attributes": [ + { + "key": "firmware_version", + "type": "string", + "value": "${data.firmware_version}" + } + ], + "timeseries": [ + { + "key": "psdk_widget_values", + "type": "string", + "value": "${data.psdk_widget_values}" + }, + { + "key": "home_latitude", + "type": "double", + "value": "${data.home_latitude}" + }, + { + "key": "home_longitude", + "type": "double", + "value": "${data.home_longitude}" + }, + { + "key": "total_flight_time", + "type": "integer", + "value": "${data.total_flight_time}" + } + ] + } + } + ], + "requestsMapping": { + "connectRequests": [ + { + "topicFilter": "sensor/connect", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" + } + }, + { + "topicFilter": "sensor/+/connect", + "deviceInfo": { + "deviceNameExpressionSource": "topic", + "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)", + "deviceProfileExpressionSource": "constant", + "deviceProfileExpression": "Thermometer" + } + } + ], + "disconnectRequests": [ + { + "topicFilter": "sensor/disconnect", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}" + } + }, + { + "topicFilter": "sensor/+/disconnect", + "deviceInfo": { + "deviceNameExpressionSource": "topic", + "deviceNameExpression": "(?<=sensor/)(.*?)(?=/connect)" + } + } + ], + "attributeRequests": [ + { + "retain": false, + "topicFilter": "v1/devices/me/attributes/request", + "deviceInfo": { + "deviceNameExpressionSource": "message", + "deviceNameExpression": "${serialNumber}" + }, + "attributeNameExpressionSource": "message", + "attributeNameExpression": "${versionAttribute}, ${pduAttribute}", + "topicExpression": "devices/${deviceName}/attrs", + "valueExpression": "${attributeKey}: ${attributeValue}" + } + ], + "attributeUpdates": [ + { + "retain": true, + "deviceNameFilter": ".*", + "attributeFilter": "firmwareVersion", + "topicExpression": "sensor/${deviceName}/${attributeKey}", + "valueExpression": "{\"${attributeKey}\":\"${attributeValue}\"}" + } + ], + "serverSideRpc": [ + { + "type": "twoWay", + "deviceNameFilter": ".*", + "methodFilter": "echo", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "responseTopicExpression": "sensor/${deviceName}/response/${methodName}/${requestId}", + "responseTopicQoS": 1, + "responseTimeout": 10000, + "valueExpression": "${params}" + }, + { + "type": "oneWay", + "deviceNameFilter": ".*", + "methodFilter": "no-reply", + "requestTopicExpression": "sensor/${deviceName}/request/${methodName}/${requestId}", + "valueExpression": "${params}" + } + ] + }, + "name": "DOCK", + "id": "28239240-5e44-4fb8-9f66-c29c638903ae", + "logLevel": "INFO", + "enableRemoteLogging": false, + "configVersion": "3.7.8" +} \ No newline at end of file