Hướng dẫn sử dụng máy làm mát không khí cho nhà thông minh
action.devices.types.AIRCOOLER
– Máy làm mát không khí là thiết bị giúp làm mát nhiệt độ và kiểm soát độ ẩm. Những thiết bị này thường nhẹ và dễ di chuyển hơn máy điều hoà không khí, đồng thời có bình chứa nước. Máy làm mát không khí có thể không hỗ trợ chế độ sưởi hoặc đặt nhiệt độ chính xác. Các hoạt động tương tác với máy làm mát không khí có thể bao gồm việc thay đổi tốc độ quạt và chế độ cài đặt độ ẩm.
Loại này cho biết thiết bị sẽ nhận được biểu tượng Máy làm mát không khí và một số từ đồng nghĩa và bí danh liên quan.
Khả năng của thiết bị
Hãy tham khảo tài liệu về đặc điểm tương ứng để biết thông tin chi tiết về cách triển khai, chẳng hạn như các thuộc tính và trạng thái mà dịch vụ của bạn cần hỗ trợ, cũng như cách tạo phản hồi EXECUTE và QUERY.
Các đặc điểm bắt buộc
Bạn bắt buộc phải có các đặc điểm và lệnh này (nếu có trên thiết bị của bạn). Nếu thiết bị của bạn không hỗ trợ các đặc điểm này, hãy nhập mã lỗi functionNotSupported
trong phản hồi QUERY hoặc EXECUTE. Hãy xem phần Lỗi và ngoại lệ để biết thêm thông tin.
-
action.devices.traits.FanSpeed
-
action.devices.traits.HumiditySetting
-
action.devices.traits.OnOff
-
action.devices.traits.TemperatureSetting
Yêu cầu về chất lượng
- Độ trễ: phải nhỏ hơn hoặc bằng 1000 mili giây.
- Độ tin cậy: phải lớn hơn hoặc bằng 97%.
Thiết bị mẫu: Máy làm mát không khí đơn giản
Phần này chứa các tải trọng ý định mẫu đại diện cho một "Máy làm mát không khí" phổ biến dựa trên loại thiết bị và các đặc điểm ở trên. Nếu bạn thêm hoặc xoá các đặc điểm trong quá trình triển khai, hãy sửa đổi các phản hồi cho phù hợp để phản ánh những thay đổi đó.
Phản hồi SYNC mẫu
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.AIRCOOLER", "traits": [ "action.devices.traits.FanSpeed", "action.devices.traits.HumiditySetting", "action.devices.traits.OnOff", "action.devices.traits.TemperatureSetting" ], "name": { "name": "Simple air cooler" }, "willReportState": true, "attributes": { "humiditySetpointRange": { "minPercent": 0, "maxPercent": 50 }, "availableFanSpeeds": { "speeds": [ { "speed_name": "off_key", "speed_values": [ { "speed_synonym": [ "Off", "0" ], "lang": "en" } ] }, { "speed_name": "low_key", "speed_values": [ { "speed_synonym": [ "Low", "1" ], "lang": "en" } ] }, { "speed_name": "medium_key", "speed_values": [ { "speed_synonym": [ "Medium", "2" ], "lang": "en" } ] }, { "speed_name": "high_key", "speed_values": [ { "speed_synonym": [ "High", "3" ], "lang": "en" } ] } ], "ordered": true }, "availableThermostatModes": [ "off", "cool", "on", "fan-only", "eco" ], "thermostatTemperatureUnit": "C" }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
Phản hồi QUERY mẫu
{ "requestId": "6894439706274654514", "inputs": [ { "intent": "action.devices.QUERY", "payload": { "devices": [ { "id": "123" } ] } } ] }
{ "requestId": "6894439706274654514", "payload": { "devices": { "123": { "status": "SUCCESS", "online": true, "on": true, "currentFanSpeedSetting": "low_key", "thermostatMode": "cool", "thermostatTemperatureAmbient": 25, "thermostatTemperatureSetpoint": 20, "humiditySetpointPercent": 15, "humidityAmbientPercent": 10 } } } }
Lệnh EXECUTE mẫu
SetFanSpeed
Để biết thêm thông tin chi tiết về các tham số lệnh, hãy xem tài liệu tham khảo về
action.devices.traits.FanSpeed
.
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetFanSpeed", "params": { "fanSpeed": "high_key" } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "currentFanSpeedSetting": "high_key" } } ] } }
SetHumidity
Để biết thêm thông tin chi tiết về các tham số lệnh, hãy xem tài liệu tham khảo về
action.devices.traits.HumiditySetting
.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.SetHumidity", "params": { "humidity": 20 } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "humiditySetpointPercent": 20, "humidityAmbientPercent": 10 } } ] } }
OnOff
Để biết thêm thông tin chi tiết về các tham số lệnh, hãy xem tài liệu tham khảo về
action.devices.traits.OnOff
.
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.OnOff", "params": { "on": true } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "on": true } } ] } }
ThermostatTemperatureSetpoint
Để biết thêm thông tin chi tiết về các tham số lệnh, hãy xem tài liệu tham khảo về
action.devices.traits.TemperatureSetting
.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ThermostatTemperatureSetpoint", "params": { "thermostatTemperatureSetpoint": 22 } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "thermostatMode": "cool", "thermostatTemperatureSetpoint": 22, "thermostatTemperatureAmbient": 25.1 } } ] } }
ThermostatSetMode
Để biết thêm thông tin chi tiết về các tham số lệnh, hãy xem tài liệu tham khảo về
action.devices.traits.TemperatureSetting
.
{ "requestId": "6894439706274654524", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ThermostatSetMode", "params": { "thermostatMode": "cool" } } ] } ] } } ] }
{ "requestId": "6894439706274654524", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "thermostatMode": "cool", "thermostatTemperatureSetpoint": 22, "thermostatTemperatureAmbient": 25.1 } } ] } }