คู่มือหลอดไฟอัจฉริยะสําหรับบ้าน
action.devices.types.LIGHT
- เปิดและปิดอุปกรณ์ Light ได้ ฟีเจอร์เหล่านี้อาจมีฟีเจอร์เพิ่มเติม เช่น การหรี่แสงและความสามารถในการเปลี่ยนสี
ประเภทนี้บ่งชี้ว่าอุปกรณ์จะได้รับไอคอนสว่าง รวมถึงคําพ้องความหมายและชื่อแทนที่เกี่ยวข้องบางส่วน
ความสามารถของอุปกรณ์
โปรดดูเอกสารประกอบที่เกี่ยวข้องสําหรับรายละเอียดการใช้งาน เช่น แอตทริบิวต์และสถานะที่บริการของคุณควรมี และวิธีการสร้างการตอบกลับและคําขอ EXECUTE
ลักษณะเฉพาะที่จําเป็น
ต้องมีคุณลักษณะและคําสั่งเหล่านี้ หากสามารถใช้กับอุปกรณ์ของคุณ หากอุปกรณ์ไม่รองรับลักษณะเฉพาะเหล่านี้ ให้ป้อนรหัสข้อผิดพลาดของ functionNotSupported
ในการตอบกลับ QUERY หรือ EXECUTE ดูข้อผิดพลาดและข้อยกเว้นสําหรับข้อมูลเพิ่มเติม
ลักษณะเฉพาะที่แนะนํา
เราขอแนะนําให้มีคุณสมบัติเหล่านี้ (หากใช้ร่วมกับอุปกรณ์ของคุณ) อย่างไรก็ตาม คุณสามารถผสมผสานคุณลักษณะที่มีอยู่ทั้งหมดได้เพื่อจับคู่กับฟังก์ชันการทํางานของผลิตภัณฑ์ที่มีอยู่
ข้อกำหนดด้านคุณภาพ
- เวลาในการตอบสนอง: ต้องน้อยกว่าหรือเท่ากับ 700 มิลลิวินาที
- ความเสถียร: ต้องมากกว่าหรือเท่ากับ 97%
ตัวอย่างอุปกรณ์: หลอดไฟแบบง่าย
ส่วนนี้ประกอบด้วยเปย์โหลด Intent ตัวอย่างที่แสดงถึง "แสง" ที่พบทั่วไปตามประเภทอุปกรณ์และลักษณะข้างต้น หากเพิ่มหรือนําลักษณะเฉพาะออกจากการใช้งาน ให้แก้ไขคําตอบให้สอดคล้องกับการเปลี่ยนแปลงเหล่านั้น
ตัวอย่างการตอบสนอง 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 } } ] } }