คู่มือระบบรดน้ำต้นไม้อัจฉริยะในบ้าน

action.devices.types.SPRINKLER - เครื่องรดน้ำต้นไม้สามารถเริ่มและหยุด (หรือเปิดหรือปิด) นอกจากนี้ยังรองรับตัวจับเวลาและ/หรือกำหนดเวลาด้วย

ประเภทนี้บ่งชี้ว่าอุปกรณ์จะมีไอคอนเครื่องรดน้ำต้นไม้ รวมถึงคำพ้องและชื่อแทนที่เกี่ยวข้องบางอย่าง

ความสามารถของอุปกรณ์

โปรดดูเอกสารลักษณะที่เกี่ยวข้องสำหรับรายละเอียดการติดตั้งใช้งาน เช่น แอตทริบิวต์และระบุว่าบริการควรรองรับ และวิธีสร้างการตอบกลับ EXECUTE และ QUERY

ลักษณะที่จำเป็น

คุณลักษณะและคำสั่งเหล่านี้จำเป็น (หากเกี่ยวข้องกับอุปกรณ์ของคุณ) หากอุปกรณ์ไม่รองรับลักษณะเหล่านี้ ให้ป้อนรหัสข้อผิดพลาดของ functionNotSupported ในการตอบกลับ QUERY หรือ EXECUTE โปรดดูข้อมูลเพิ่มเติมที่ข้อผิดพลาดและข้อยกเว้น

เราขอแนะนำให้ใช้ลักษณะเหล่านี้ หากเกี่ยวข้องกับอุปกรณ์ของคุณ อย่างไรก็ตาม คุณสามารถผสมผสานลักษณะเฉพาะที่มีอยู่ทั้งหมดให้ตรงกับฟังก์ชันการทำงานของผลิตภัณฑ์ที่มีอยู่มากที่สุดได้อย่างตรงจุด

ข้อกำหนดด้านคุณภาพ

  • เวลาในการตอบสนอง: ต้องน้อยกว่าหรือเท่ากับ 800 มิลลิวินาที
  • ความเสถียร: ต้องมากกว่าหรือเท่ากับ 97%

อุปกรณ์ตัวอย่าง: เครื่องรดน้ำต้นไม้ธรรมดา

ส่วนนี้มีตัวอย่างเพย์โหลด Intent ที่แสดงถึง "สปริงเคลอร์" ทั่วไปโดยอิงจากประเภทอุปกรณ์และลักษณะข้างต้น หากคุณเพิ่มหรือนำลักษณะในการใช้งานออก ให้แก้ไขคำตอบให้สอดคล้องกับการเปลี่ยนแปลงเหล่านั้น

ตัวอย่างการตอบสนองการซิงค์

คำขอ
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.SPRINKLER",
        "traits": [
          "action.devices.traits.Timer",
          "action.devices.traits.StartStop"
        ],
        "name": {
          "name": "Simple sprinkler"
        },
        "willReportState": true,
        "attributes": {
          "availableZones": [
            "front",
            "back"
          ],
          "maxTimerLimitSec": 3600
        },
        "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,
        "isRunning": true,
        "activeZones": [
          "front"
        ],
        "timerRemainingSec": 300
      }
    }
  }
}

ตัวอย่างคำสั่ง EXECUTE

เริ่มจับเวลา

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.Timer

คำขอ
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerStart",
                "params": {
                  "timerTimeSec": 300
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300
        }
      }
    ]
  }
}

ปรับตัวจับเวลา

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.Timer

คำขอ
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerAdjust",
                "params": {
                  "timerTimeSec": -10
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 290
        }
      }
    ]
  }
}

หยุดจับเวลาชั่วคราว

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.Timer

คำขอ
{
  "requestId": "6894439706274654522",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerPause"
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654522",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300,
          "timerPaused": true
        }
      }
    ]
  }
}

จับเวลาต่อ

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.Timer

คำขอ
{
  "requestId": "6894439706274654524",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerResume"
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654524",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": 300,
          "timerPaused": false
        }
      }
    ]
  }
}

ยกเลิกตัวจับเวลา

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.Timer

คำขอ
{
  "requestId": "6894439706274654526",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.TimerCancel"
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654526",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "timerRemainingSec": -1
        }
      }
    ]
  }
}

เริ่มหยุด

ดูรายละเอียดเพิ่มเติมเกี่ยวกับพารามิเตอร์คำสั่งได้ที่ข้อมูลอ้างอิง action.devices.traits.StartStop

คำขอ
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.StartStop",
                "params": {
                  "start": true,
                  "zone": "back"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
คำตอบ
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "isRunning": true,
          "activeZones": [
            "back"
          ]
        }
      }
    ]
  }
}

ข้อผิดพลาดเกี่ยวกับอุปกรณ์

ดูรายการข้อผิดพลาดและข้อยกเว้นทั้งหมด