382 lines
10 KiB
Plaintext
382 lines
10 KiB
Plaintext
|
|
{
|
||
|
|
"broker": {
|
||
|
|
"host": "mqtt.t-aaron.com",
|
||
|
|
"port": 10883,
|
||
|
|
"version": 5,
|
||
|
|
"clientId": "ThingsBoard_gateway_tuoheng",
|
||
|
|
"security": {
|
||
|
|
"type": "basic",
|
||
|
|
"username": "admin",
|
||
|
|
"password": "admin"
|
||
|
|
},
|
||
|
|
"maxNumberOfWorkers": 100,
|
||
|
|
"maxMessageNumberPerWorker": 10
|
||
|
|
},
|
||
|
|
"mapping": [
|
||
|
|
{
|
||
|
|
"topicFilter": "/topic/v1/airportNest/+/realTime/basic",
|
||
|
|
"subscriptionQos": 1,
|
||
|
|
"converter": {
|
||
|
|
"type": "json",
|
||
|
|
"deviceInfo": {
|
||
|
|
"deviceNameExpression": "(?<=airportNest/)[^/]+(?=/realTime)",
|
||
|
|
"deviceNameExpressionSource": "topic",
|
||
|
|
"deviceProfileExpressionSource": "constant",
|
||
|
|
"deviceProfileExpression": "default"
|
||
|
|
},
|
||
|
|
"attributes": [
|
||
|
|
{
|
||
|
|
"key": "airportID",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.airportID}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "mac",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.mac}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "software_version",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.version.software}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "hardware_version",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.version.hardware}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "sender",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${sender}"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"timeseries": [
|
||
|
|
{
|
||
|
|
"key": "status",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.status}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "send_timestamp",
|
||
|
|
"type": "long",
|
||
|
|
"value": "${send_timestamp}"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"topicFilter": "/topic/v1/airportNest/+/realTime/data",
|
||
|
|
"subscriptionQos": 0,
|
||
|
|
"converter": {
|
||
|
|
"type": "json",
|
||
|
|
"deviceInfo": {
|
||
|
|
"deviceNameExpression": "(?<=airportNest/)[^/]+(?=/realTime)",
|
||
|
|
"deviceNameExpressionSource": "topic",
|
||
|
|
"deviceProfileExpressionSource": "constant",
|
||
|
|
"deviceProfileExpression": "default"
|
||
|
|
},
|
||
|
|
"attributes": [],
|
||
|
|
"timeseries": [
|
||
|
|
{
|
||
|
|
"key": "weather_rainfall",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestWeather.data.rainfall}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "weather_windLevel",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestWeather.data.windLevel}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "weather_windDir",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestWeather.data.windDir}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "weather_windSpeed",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestWeather.data.windSpeed}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "weather_rainFlag",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${nestWeather.data.rainFlag}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "weather_windAngle",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestWeather.data.windAngle}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_level",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${droneBattery.data.Battery_level}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_health",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${droneBattery.data.Battery_health}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_totalVoltage",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${droneBattery.data.totalVoltage}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_cellTemp",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${droneBattery.data.cellTemp}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_mosTemp",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${droneBattery.data.mosTemp}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_num_cycles",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${droneBattery.data.num_cycles}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_discharge_current",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${droneBattery.data.Discharge_current}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_bCharging",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${droneBattery.data.bCharging}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "nest_innerHum",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestInnerSensor.data.innerHum}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "nest_innerTemp",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestInnerSensor.data.innerTemp}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "charger_current",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestCharger.data.current}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "charger_voltage",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestCharger.data.voltage}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "charger_capacity",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${nestCharger.data.capacity}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "charger_bCharging",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${nestCharger.data.bCharging}"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"topicFilter": "/topic/v1/airportDrone/+/realTime/data",
|
||
|
|
"subscriptionQos": 1,
|
||
|
|
"converter": {
|
||
|
|
"type": "json",
|
||
|
|
"deviceInfo": {
|
||
|
|
"deviceNameExpression": "(?<=airportDrone/)[^/]+(?=/realTime)",
|
||
|
|
"deviceNameExpressionSource": "topic",
|
||
|
|
"deviceProfileExpressionSource": "constant",
|
||
|
|
"deviceProfileExpression": "default"
|
||
|
|
},
|
||
|
|
"attributes": [
|
||
|
|
{
|
||
|
|
"key": "deviceid",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.deviceid}"
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"timeseries": [
|
||
|
|
{
|
||
|
|
"key": "latitude",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.lat}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "longitude",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.lon}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "altitude",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.alt}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "altitude_asl",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.altasl}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "roll",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.roll}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "pitch",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.pitch}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "yaw",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.yaw}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "horizontal_speed",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.hspeed}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "vertical_speed",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.vspeed}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "battery_remain",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${data.battery_remain}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "voltage",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.voltage}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "gps_signal",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${data.gpssingal}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "sat_count",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${data.satcount}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "mode",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.mode}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "armed",
|
||
|
|
"type": "string",
|
||
|
|
"value": "${data.armed}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "flight_time",
|
||
|
|
"type": "integer",
|
||
|
|
"value": "${data.flytime}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "mileage",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.mileage}"
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"key": "distance_to_home",
|
||
|
|
"type": "double",
|
||
|
|
"value": "${data.distToHome}"
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
],
|
||
|
|
"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": "tuoheng",
|
||
|
|
"id": "tuoheng-gateway-001",
|
||
|
|
"logLevel": "INFO",
|
||
|
|
"enableRemoteLogging": false,
|
||
|
|
"configVersion": "3.7.8"
|
||
|
|
}
|