温度传感器
以摄氏度报告温度
The integration de sensores de temperatura por MQTT使用以下结构:
{
"accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpointID": 1,
"temperatureCelsius": 25,
"timestamp": "2021-02-23T14:55:03",
"mqttMethod": "UpdateTemperatureSensorStatus",
"mqttRID": "RXmp123"
}参数
| 名称 | 说明 | 数据类型 |
|---|---|---|
| accessToken | 具有更新端点信息权限的访问令牌。更多信息请参见该页面。 | text |
| endpointID | 唯一端点标识符或设备地址与端点地址的组合(格式为 [deviceAddress]:endpointAddress,例如:[device-1234]:1)。这些值可以在端点管理页面找到。 | text |
| temperatureCelsius | Measured temperature, numeric value greater than or equal to -273.15, indicating the measured temperature in degrees Celsius (C). | numeric |
| timestamp | 可选值,表示与测量对应的 UTC 日期和时间。日期格式必须与日期格式部分指定的格式之一相匹配。如果省略该字段,平台将假定测量对应于当前日期和时间。 | text |
| mqttMethod | Método correspondiente del servicio, en este caso UpdateTemperature传感器Status | string |
| mqttRID | Identificador opcional para la petición, en caso de que se desee obtener una respuesta de confirmación. | string |
报告e de temperatura en formato "raw"
La temperatura puede ser reportada como un raw 值, 使用 表达式转换器. Esta opción es conveniente cuando el dispositivo no es capaz de realizar conversiones, y emite valores que necesitan ser transformados antes de inyectarse en la plataforma.
下面是 raw 格式请求的示例:
{
"accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"endpointID": 1,
"rawData": "45",
"timestamp": "2021-02-23T14:55:03",
"mqttMethod": "UpdateTemperatureSensorStatusRaw",
"mqttRID": "RXmp123"
}参数
| 名称 | 说明 | 数据类型 |
|---|---|---|
| accessToken | 具有更新端点信息权限的访问令牌。更多信息请参见该页面。 | text |
| endpointID | 唯一端点标识符,可以在端点管理页面找到。 | numeric |
| rawData | Valor reportado por el sensor, como texto. Debe indicarse una expresión en el 表达式转换器. La expresión debe devolver un valor numérico mayor o igual a -273.15, indicando la temperatura medida, en grados Celsius (ºC). | text |
| timestamp | 可选值,表示与测量对应的 UTC 日期和时间。日期格式必须与日期格式部分指定的格式之一相匹配。如果省略该字段,平台将假定测量对应于当前日期和时间。 | text |
| mqttMethod | Método correspondiente del servicio, en éste caso UpdateTemperature传感器StatusRaw | string |
| mqttRID | Identificador opcional para la petición, en caso de que se desee obtener una respuesta de confirmación. | string |
HTTP 桥接
简介 The HTTP bridge is a feature of the Gear Studio platform that allows device integration 使用 HTTP API through MQTT. This makes it possible to migrate devices that use the HTTP interface to use MQTT instead, with minimal changes.
湿度传感器
报告ing humidity as percentage The integration de sensores de humedad por MQTT使用以下结构: { "accessToken":...