名称: sensibo
描述: 通过 Sensibo REST API 控制智能空调设备。当用户要求开关空调、调节温度、设置模式、查询室内温湿度或管理气候计划时使用。触发短语示例:"打开空调"、"把卧室调到22度"、"现在有多热"、"关空调"、"制冷模式"。
通过 Sensibo REST API 控制智能空调设备。
bash
curl --compressed "https://home.sensibo.com/api/v2/users/me/pods?fields=id,room&apiKey={API_KEY}"将信息存储在 TOOLS.md 文件中:
``markdown
## Sensibo
API 密钥:`
| 房间 | 设备 ID |
|---|---|
| 客厅 | abc123 |
| 卧室 | xyz789 |
| ``` |
基础 URL: https://home.sensibo.com/api/v2
认证: 使用查询参数 ?apiKey={key}
始终使用: --compressed 标志以获得更好的速率限制。
curl --compressed -X POST "https://home.sensibo.com/api/v2/pods/{device_id}/acStates?apiKey={key}" \
-H "Content-Type: application/json" -d '{"acState":{"on":true}}'
curl --compressed -X PATCH "https://home.sensibo.com/api/v2/pods/{device_id}/acStates/targetTemperature?apiKey={key}" \
-H "Content-Type: application/json" -d '{"newValue":23}'
可选值:cool(制冷), heat(制热), fan(送风), auto(自动), dry(除湿)
curl --compressed -X PATCH "https://home.sensibo.com/api/v2/pods/{device_id}/acStates/mode?apiKey={key}" \
-H "Content-Type: application/json" -d '{"newValue":"cool"}'
可选值:low(低), medium(中), high(高), auto(自动)
curl --compressed -X PATCH "https://home.sensibo.com/api/v2/pods/{device_id}/acStates/fanLevel?apiKey={key}" \
-H "Content-Type: application/json" -d '{"newValue":"auto"}'
curl --compressed -X POST "https://home.sensibo.com/api/v2/pods/{device_id}/acStates?apiKey={key}" \
-H "Content-Type: application/json" \
-d '{"acState":{"on":true,"mode":"cool","targetTemperature":22,"fanLevel":"auto","temperatureUnit":"C"}}'
| 属性 | 类型 | 可选值 |
|---|---|---|
| on | 布尔值 | true, false |
| mode | 字符串 | cool, heat, fan, auto, dry |
| targetTemperature | 整数 | 取决于空调型号 |
| temperatureUnit | 字符串 | C, F |
| fanLevel | 字符串 | low, medium, high, auto |
| swing | 字符串 | stopped, rangeful |
在 fields 参数中包含 measurements:
curl --compressed "https://home.sensibo.com/api/v2/pods/{device_id}?fields=measurements&apiKey={key}"
响应示例:
{"measurements": {"temperature": 24.5, "humidity": 55, "time": "2024-01-15T12:00:00Z"}}
curl --compressed "https://home.sensibo.com/api/v2/pods/{device_id}/historicalMeasurements?days=1&apiKey={key}"
curl --compressed -X PUT "https://home.sensibo.com/api/v2/pods/{device_id}/smartmode?apiKey={key}" \
-H "Content-Type: application/json" -d '{"enabled":true}'
curl --compressed -X POST "https://home.sensibo.com/api/v2/pods/{device_id}/smartmode?apiKey={key}" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"lowTemperatureThreshold": 20,
"lowTemperatureState": {"on": true, "mode": "heat"},
"highTemperatureThreshold": 26,
"highTemperatureState": {"on": true, "mode": "cool"}
}'
注意: 计划任务使用 API v1 基础 URL:https://home.sensibo.com/api/v1
curl --compressed "https://home.sensibo.com/api/v1/pods/{device_id}/schedules/?apiKey={key}"
curl --compressed -X POST "https://home.sensibo.com/api/v1/pods/{device_id}/schedules/?apiKey={key}" \
-H "Content-Type: application/json" \
-d '{
"targetTimeLocal": "22:00",
"timezone": "Europe/London",
"acState": {"on": false},
"recurOnDaysOfWeek": ["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]
}'
curl --compressed -X DELETE "https://home.sensibo.com/api/v1/pods/{device_id}/schedules/{schedule_id}/?apiKey={key}"
设置一次性延迟操作:
curl --compressed -X PUT "https://home.sensibo.com/api/v1/pods/{device_id}/timer/?apiKey={key}" \
-H "Content-Type: application/json" \
-d '{"minutesFromNow": 30, "acState": {"on": false}}'
TOOLS.md 中查找对应的设备 ID。"status": "success"。--compressed 标志以获得更高的 API 调用速率限制。