คู่มือระบบรักษาความปลอดภัยในบ้านอัจฉริยะ
action.devices.types.SECURITYSYSTEM
- สามารถเปิดและปิดระบบรักษาความปลอดภัยได้ ระบบป้องกันความปลอดภัยสามารถล็อกได้หลายระดับ (เช่น อยู่บ้านและไม่อยู่บ้าน) รวมทั้งสามารถรายงานข้อมูลเกี่ยวกับเซ็นเซอร์บางอย่าง เช่น เซ็นเซอร์ที่ตรวจจับการเคลื่อนไหวหรือหน้าต่างที่เปิดอยู่
ประเภทนี้เป็นการระบุว่าอุปกรณ์จะมีไอคอนระบบรักษาความปลอดภัย รวมถึงคําพ้องความหมายและชื่อแทนที่เกี่ยวข้องบางรายการ
ความสามารถของอุปกรณ์
อ่านรายละเอียดเกี่ยวกับลักษณะการใช้งาน เช่น แอตทริบิวต์และรัฐที่บริการควรรองรับ ตลอดจนวิธีสร้างการตอบกลับ "EXECUTE" และ "QUERY"
ลักษณะเฉพาะที่จําเป็น
ต้องมีลักษณะเฉพาะและคําสั่งเหล่านี้ หากเกี่ยวข้องกับอุปกรณ์ของคุณ
ลักษณะเฉพาะที่แนะนํา
ขอแนะนําให้ใช้รูปแบบเหล่านี้หากเกี่ยวข้องกับอุปกรณ์ของคุณ อย่างไรก็ตาม คุณสามารถผสมและจับคู่จากลักษณะทั้งหมดที่มีอยู่เพื่อให้ตรงกับฟังก์ชันการทํางานของผลิตภัณฑ์ที่มีอยู่ได้ดีที่สุด
ข้อกำหนดด้านคุณภาพ
- เวลาในการตอบสนอง: ต้องน้อยกว่าหรือเท่ากับ 2,000 มิลลิวินาที
- ความเสถียร: ต้องมากกว่าหรือเท่ากับ 97%
ตัวอย่างอุปกรณ์: ระบบรักษาความปลอดภัยที่เรียบง่าย
ส่วนนี้ประกอบด้วยเพย์โหลดตัวอย่างของตัวอย่างที่สื่อถึง "ระบบรักษาความปลอดภัย" ทั่วไป ซึ่งอิงตามประเภทอุปกรณ์และลักษณะข้างต้น หากคุณเพิ่มหรือนําลักษณะเฉพาะออกจากการใช้งาน ให้แก้ไขคําตอบให้สอดคล้องกับการเปลี่ยนแปลงเหล่านั้น
ตัวอย่างการตอบกลับ SYNC
{ "requestId": "6894439706274654512", "inputs": [ { "intent": "action.devices.SYNC" } ] }
{ "requestId": "6894439706274654512", "payload": { "agentUserId": "user123", "devices": [ { "id": "123", "type": "action.devices.types.SECURITYSYSTEM", "traits": [ "action.devices.traits.StatusReport", "action.devices.traits.ArmDisarm" ], "name": { "name": "Simple security system" }, "willReportState": true, "attributes": { "availableArmLevels": { "levels": [ { "level_name": "home_key", "level_values": [ { "level_synonym": [ "Home and Guarding", "level 1", "home", "SL1" ], "lang": "en" } ] }, { "level_name": "away_key", "level_values": [ { "level_synonym": [ "Away and Guarding", "level 2", "away", "SL2" ], "lang": "en" } ] } ], "ordered": true } }, "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, "isArmed": true, "currentArmLevel": "home_key", "currentStatusReport": [ { "blocking": false, "deviceTarget": "123", "priority": 0, "statusCode": "lowBattery" } ] } } } }
ตัวอย่างคําสั่ง EXECUTE
ปิดระบบป้องกัน
โปรดดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คําสั่งในข้อมูลอ้างอิง action.devices.traits.ArmDisarm
{ "requestId": "6894439706274654516", "inputs": [ { "intent": "action.devices.EXECUTE", "payload": { "commands": [ { "devices": [ { "id": "123" } ], "execution": [ { "command": "action.devices.commands.ArmDisarm", "params": { "arm": true, "armLevel": "away_key" } } ] } ] } } ] }
{ "requestId": "6894439706274654516", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isArmed": true, "currentArmLevel": "away_key" } } ] } }
อุปกรณ์ ERRORS
ดูรายการข้อผิดพลาดและข้อยกเว้นทั้งหมดรายงานข้อยกเว้นการเปิดเครื่อง
เมื่อพยายามเปิดหรือปิดระบบ คุณอาจให้บริบทเพิ่มเติมผ่านรหัสข้อยกเว้นที่คุณรายงานผ่านลักษณะเฉพาะของ StatusReport ข้อยกเว้นอาจมีการรายงานว่าการบล็อกหรือไม่ได้บล็อก
- ข้อยกเว้นที่ถูกบล็อกไม่ได้ที่รายงานโดยมีสถานะ "สําเร็จ" บ่งชี้ว่าข้อยกเว้นดังกล่าวไม่ได้ป้องกันการเปิดระบบหรือการปิดระบบ
- ข้อยกเว้นในการบล็อกที่รายงานโดยมีสถานะ "ข้อยกเว้น" บ่งบอกว่ามีการเปิดและปิดระบบป้องกันเนื่องจากข้อยกเว้นเหล่านี้
ข้อยกเว้นที่มักเกี่ยวข้องกับระบบความปลอดภัยมีดังนี้
doorOpen
: ประตูเปิดอยู่windowOpen
: หน้าต่างเปิดอยู่isOpen
: เซ็นเซอร์ตรวจจับสิ่งที่เปิดอยู่ (แต่ไม่ทราบว่าเป็นประตูหรือหน้าต่าง)
ตัวอย่าง: ข้อยกเว้นที่ไม่ถูกบล็อก
ตัวอย่างนี้แสดงข้อยกเว้นที่ไม่ใช่การบล็อกซึ่งระบบรักษาความปลอดภัยเปิดอยู่แม้ว่าจะมีการรายงานว่าหน้าต่างเปิดอยู่
ผู้ใช้ | ตั้งค่าระบบรักษาความปลอดภัยเป็นระดับสูง |
Google Assistant | โอเค หน้าต่างหน้าเปิดอยู่ เปิดใช้งานระบบรักษาความปลอดภัยที่รัดกุม |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true, "armLevel": "L2" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isArmed": true, "currentArmLevel": "L2", "currentStatusReport": [ { "blocking": false, "priority": 0, "statusCode": "windowOpen", "deviceTarget": "sensor_id1" } ] } } ] } }
ตัวอย่าง: ข้อยกเว้นการบล็อก
ผู้ใช้ | ตั้งค่าระบบรักษาความปลอดภัยเป็นระดับสูง |
Google Assistant | เกิดข้อผิดพลาดในการควบคุมระบบรักษาความปลอดภัย หน้าต่างด้านหน้าเปิดอยู่ |
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true, "armLevel": "L2" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "online": true, "isArmed": false, "currentArmLevel": "L2", "currentStatusReport": [ { "blocking": true, "priority": 0, "statusCode": "windowOpen", "deviceTarget": "sensor_id1" } ] } } ] } }
เปิดใช้งานการตรวจสอบสิทธิ์แบบ 2 ปัจจัย
หากกระบวนการเปิดใช้งานของคุณกําหนดให้ผู้ใช้ป้อน PIN ผ่านกล่องโต้ตอบการตรวจสอบสิทธิ์แบบ 2 ปัจจัย คุณต้องรับทราบว่าต้องการเปิดใช้งานระบบต่อไปหรือไม่เมื่อมีข้อยกเว้นที่ใช้งานอยู่ (เช่น เมื่อหน้าต่างหรือประตูเปิดอยู่)
สถานการณ์นี้อาจต้องป้อนทั้ง PIN หรือรหัสผ่าน ตามด้วยการรับทราบ
ตัวอย่าง: ภารกิจรับทราบ
ตัวอย่างนี้แสดงผู้ใช้ที่พยายามเปิดระบบรักษาความปลอดภัย แต่ตรวจพบว่าประตูหน้าเปิดอยู่ ผู้ใช้รับทราบว่าระบบรักษาความปลอดภัยควรเปิดอยู่แม้ว่าประตูหน้าจะเปิดอยู่
ผู้ใช้ | เปิดระบบรักษาความปลอดภัย |
Google Assistant | ประตูหน้าเปิดอยู่ค่ะ คุณแน่ใจไหมว่าต้องการเปิดระบบรักษาความปลอดภัย |
ผู้ใช้ | ได้ |
Google Assistant | โอเค กําลังเปิดระบบรักษาความปลอดภัยให้ |
ในการทดสอบครั้งแรก คุณควรตอบคําถามด้วยคําถาม ackNeeded
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [ { "ids": [ "123" ], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "ackNeeded" }, "states": { "isArmed": true, "currentArmLevel": "L2", "currentStatusReport": [ { "blocking": false, "priority": 0, "statusCode": "doorOpen", "deviceTarget": "456" } ] } } ] } }
คําขอที่ตามมาจาก Google ที่ส่งถึงคุณจะมีผลลัพธ์ ack
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true }, "challenge": { "ack": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "isArmed": true } } ] } }
ตัวอย่าง: PIN และการรับทราบปัญหา
ตัวอย่างนี้แสดงผู้ใช้ที่พยายามเปิดระบบรักษาความปลอดภัยที่ต้องใช้ PIN ระบบจะตรวจพบว่าหน้าต่างด้านหน้าและด้านหลังเปิดอยู่และขอให้ผู้ใช้รับทราบว่าควรเปิดระบบป้องกัน
ผู้ใช้ | เปิดระบบอยู่ห่างออกไป |
Google Assistant | PIN ของคุณคืออะไร |
ผู้ใช้ | 1234 |
Google Assistant | ดูเหมือนว่าหน้าต่างหน้าและหน้าต่างหลังจะเปิดอยู่ คุณแน่ใจไหมว่าต้องการเปิดระบบรักษาความปลอดภัยให้อยู่ต่อไป |
ผู้ใช้ | ได้ |
Google Assistant | โอเค เปิดระบบรักษาความปลอดภัยให้ไม่อยู่บ้าน |
ในด่านแรก คุณควรตอบคําถามด้วยคําถามมาตรฐาน pinNeeded
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [{ "id": "123" }], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["456"], "status": "ERROR", "errorCode": "challengeNeeded", "challengeNeeded": { "type": "pinNeeded" } }] } }
จากนั้น Google จะติดตามผลคําขอที่มี PIN นั้น เพื่อรองรับคําขอที่ 2 คุณควรตอบคําถามด้วย ackNeeded
โดยระบุข้อมูลเพิ่มเติม รวมถึงระดับกลุ่มเป้าหมายและรายงานสถานะปัจจุบันพร้อมข้อยกเว้นของการบล็อก
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [...], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true, "armLevel": "away" }, "challenge": { "pin": "1234" } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [{ "ids": ["456"], "status": "ERROR", "states": { "targetArmLevel": "away", "currentStatusReport": [{ "blocking": true, "priority": 1, "deviceTarget": "front_window_id", "statusCode": "deviceOpen" }, { "blocking": true, "priority": 1, "deviceTarget": "back_window_id", "statusCode": "deviceOpen" } ] }, "errorCode": "challengeNeeded", "challengeNeeded": { "type": "ackNeeded" } }] } }
คําขอที่ตามมาจาก Google ที่ส่งถึงคุณจะมีเฉพาะผลลัพธ์ ack
ไม่ใช่ PIN ที่ให้ไว้ในขั้นแรก
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "inputs": [{ "intent": "action.devices.EXECUTE", "payload": { "commands": [{ "devices": [...], "execution": [{ "command": "action.devices.commands.ArmDisarm", "params": { "arm": true, "armLevel": "away" }, "challenge": { "ack": true } }] }] } }] }
{ "requestId": "ff36a3cc-ec34-11e6-b1a0-64510650abcf", "payload": { "commands": [ { "ids": [ "123" ], "status": "SUCCESS", "states": { "isArmed": true } } ] } }