คู่มือไฟอัจฉริยะในบ้าน
action.devices.types.LIGHT
- คุณเปิดและปิดอุปกรณ์สว่างได้อาจมีฟีเจอร์เพิ่มเติม เช่น หรี่แสงและความสามารถในการเปลี่ยนสี
ประเภทนี้เป็นการระบุว่าอุปกรณ์จะมีไอคอนสว่าง รวมถึงคําพ้องความหมายและชื่อแทนที่เกี่ยวข้องบางรายการ
ความสามารถของอุปกรณ์
อ่านรายละเอียดเกี่ยวกับลักษณะการใช้งาน เช่น แอตทริบิวต์และรัฐที่บริการควรรองรับ ตลอดจนวิธีสร้างการตอบกลับ "EXECUTE" และ "QUERY"
ลักษณะเฉพาะที่จําเป็น
ต้องมีลักษณะเฉพาะและคําสั่งเหล่านี้ หากเกี่ยวข้องกับอุปกรณ์ของคุณ
ลักษณะเฉพาะที่แนะนํา
ขอแนะนําให้ใช้รูปแบบเหล่านี้หากเกี่ยวข้องกับอุปกรณ์ของคุณ อย่างไรก็ตาม คุณสามารถผสมและจับคู่จากลักษณะทั้งหมดที่มีอยู่เพื่อให้ตรงกับฟังก์ชันการทํางานของผลิตภัณฑ์ที่มีอยู่ได้ดีที่สุด
ข้อกำหนดด้านคุณภาพ
- เวลาในการตอบสนอง: ต้องน้อยกว่าหรือเท่ากับ 700 มิลลิวินาที
- ความเสถียร: ต้องมากกว่าหรือเท่ากับ 97%
ตัวอย่างอุปกรณ์: แสงสว่างธรรมดา
ส่วนนี้ประกอบด้วยเพย์โหลดตัวอย่างของตัวอย่างที่สื่อถึง "แสง" ทั่วไปซึ่งอิงตามประเภทอุปกรณ์และลักษณะข้างต้น หากคุณเพิ่มหรือนําลักษณะเฉพาะออกจากการใช้งาน ให้แก้ไขคําตอบให้สอดคล้องกับการเปลี่ยนแปลงเหล่านั้น
ตัวอย่างการตอบกลับ SYNC
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.LIGHT", "traits": [ "action.devices.traits.ColorSetting", "action.devices.traits.Brightness", "action.devices.traits.OnOff" ], "name": { "name": "Simple light" }, "willReportState": true, "attributes": { "colorTemperatureRange": { "temperatureMinK": 2000, "temperatureMaxK": 6500 } }, "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, "brightness": 65, "color": { "temperatureK": 4000 } } } } }
ตัวอย่างคําสั่ง EXECUTE
ค่าสี
โปรดดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คําสั่งในข้อมูลอ้างอิง action.devices.traits.ColorSetting
{ "requestId": "6894439706274654520", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ColorAbsolute", "params": { "color": { "name": "Warm White", "temperature": 3000 } } } ] } ] } } ] }
{ "requestId": "6894439706274654520", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "color": { "temperatureK": 3000 } } } ] } }
ความสว่างสัมบูรณ์
โปรดดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คําสั่งในข้อมูลอ้างอิง action.devices.traits.Brightness
{ "requestId": "6894439706274654518", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.BrightnessAbsolute", "params": { "brightness": 65 } } ] } ] } } ] }
{ "requestId": "6894439706274654518", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "brightness": 65 } } ] } }
ปิด
โปรดดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คําสั่งในข้อมูลอ้างอิง 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 } } ] } }