מדריך ליחידה של מיזוג אוויר חכם
action.devices.types.AC_UNIT
– יחידות מיזוג אוויר דומות לתרמוסטטים, אבל הן לא תומכות בחימום ויכול להיות שלא תומכות בהגדרת יעדי הטמפרטורה.
הסוג הזה מציין שהמכשיר מופיע עם הסמל של יחידת מיזוג האוויר, וגם כמה מילים נרדפות וכינויים קשורים.
יכולות המכשיר
עיינו בתיעוד של ה-trait כדי לקבל את פרטי ההטמעה, כמו מאפיינים ומצבים שהשירות צריך לתמוך בהם, ואיך ליצור תשובות EXECUTE ו-QUERY.
ה-traits הנדרשות
התכונות והפקודות האלה נדרשות, אם זה רלוונטי למכשיר שלכם. אם המכשיר שלך לא תומך בתכונות האלה, יש להזין את קוד השגיאה functionNotSupported
בתגובה מסוג QUERY או EXECUTE. מידע נוסף זמין בקטע שגיאות וחריגים.
דרישות איכות
- זמן אחזור: חייב להיות קצר מ-1000 אלפיות שנייה או שווה לו.
- אמינות: צריכה להיות 97% ומעלה.
מכשיר לדוגמה: יחידת AC פשוטה
בקטע הזה יש דוגמאות למטענים ייעודיים (payloads) של Intent שמייצגים 'יחידת מיזוג אוויר' נפוצה על סמך סוג המכשיר והתכונות שצוינו למעלה. אם מוסיפים או מסירים traits בהטמעה, צריך לשנות את התגובות בהתאם כדי לשקף את השינויים.
תגובת SYNC לדוגמה
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.AC_UNIT", "traits": [ "action.devices.traits.FanSpeed", "action.devices.traits.OnOff", "action.devices.traits.TemperatureSetting" ], "name": { "name": "Simple AC unit" }, "willReportState": true, "attributes": { "availableFanSpeeds": { "speeds": [ { "speed_name": "low_key", "speed_values": [ { "speed_synonym": [ "Low", "Slow" ], "lang": "en" } ] }, { "speed_name": "high_key", "speed_values": [ { "speed_synonym": [ "High", "Speed 2" ], "lang": "en" } ] } ], "ordered": true }, "availableThermostatModes": [ "off", "cool", "fan-only", "on" ], "thermostatTemperatureUnit": "C" }, "deviceInfo": { "manufacturer": "smart-home-inc", "model": "hs1234", "hwVersion": "3.2", "swVersion": "11.4" } } ] } }
דוגמה לתשובה מסוג QUERY
{ "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 } } } }
פקודות EXECUTE לדוגמה
SetFanSpeed
פרטים נוספים על הפרמטרים של הפקודות זמינים בחומר העזר בנושא
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" } } ] } }
OnOff
פרטים נוספים על הפרמטרים של הפקודות זמינים בחומר העזר בנושא
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
פרטים נוספים על הפרמטרים של הפקודות זמינים בחומר העזר בנושא
action.devices.traits.TemperatureSetting
.
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ThermostatTemperatureSetpoint", "params": { "thermostatTemperatureSetpoint": 22 } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "thermostatMode": "cool", "thermostatTemperatureSetpoint": 22, "thermostatTemperatureAmbient": 25.1 } } ] } }
ThermostatSetMode
פרטים נוספים על הפרמטרים של הפקודות זמינים בחומר העזר בנושא
action.devices.traits.TemperatureSetting
.
{ "requestId": "6894439706274654522", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ThermostatSetMode", "params": { "thermostatMode": "cool" } } ] } ] } } ] }
{ "requestId": "6894439706274654522", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "thermostatMode": "cool", "thermostatTemperatureSetpoint": 22, "thermostatTemperatureAmbient": 25.1 } } ] } }