Panduan Pemotong Rumput Smart Home

action.devices.types.MOWER - Interaksi dengan mesin pemotong rumput dapat mencakup memulai, menghentikan, dan menjeda pemotongan, dok, memeriksa siklus saat ini, menemukan lokasi mesin pemotong rumput, dan menyesuaikan berbagai mode.

Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Pemotong rumput serta beberapa sinonim dan alias yang terkait.

Kemampuan perangkat

Lihat dokumentasi fitur yang sesuai untuk detail penerapan, seperti atribut dan status yang harus didukung layanan Anda, serta cara membuat respons EXECUTE dan QUERY.

Trait yang diperlukan

Sifat dan perintah ini diperlukan, jika berlaku untuk perangkat Anda. Jika perangkat tidak mendukung fitur ini, masukkan kode error functionNotSupported dalam respons QUERY atau EXECUTE. Lihat Error dan pengecualian untuk info selengkapnya.

Trait ini direkomendasikan, jika sesuai untuk perangkat Anda. Namun, Anda bebas memadupadankan semua karakteristik yang tersedia agar cocok dengan fungsi produk yang ada.

Persyaratan kualitas

  • Latensi: harus kurang dari atau sama dengan 3000 md.
  • Keandalan: harus lebih dari atau sama dengan 97%.

Contoh perangkat: Mesin pemotong rumput sederhana

Bagian ini berisi contoh payload intent yang merepresentasikan "Mower" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus trait dalam implementasi Anda, ubah respons tersebut agar mencerminkan perubahan tersebut.

Contoh respons SYNC

Permintaan
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
Respons
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.MOWER",
        "traits": [
          "action.devices.traits.Dock",
          "action.devices.traits.EnergyStorage",
          "action.devices.traits.StartStop"
        ],
        "name": {
          "name": "Simple mower"
        },
        "willReportState": true,
        "attributes": {
          "queryOnlyEnergyStorage": true,
          "pausable": true,
          "availableZones": [
            "left driveway",
            "right driveway",
            "around the hedges"
          ]
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

Contoh respons QUERY

Permintaan
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "isRunning": true,
        "isPaused": false,
        "isDocked": false,
        "activeZones": [
          "left driveway"
        ],
        "descriptiveCapacityRemaining": "HIGH",
        "capacityRemaining": [
          {
            "unit": "SECONDS",
            "rawValue": 36000
          },
          {
            "unit": "PERCENTAGE",
            "rawValue": 90
          }
        ]
      }
    }
  }
}

Contoh perintah EXECUTE

Pasang ke dok

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.Dock.

Permintaan
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.Dock"
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "isDocked": true
        }
      }
    ]
  }
}

StartStop

Untuk detail tambahan tentang parameter perintah, lihat referensi action.devices.traits.StartStop.

Permintaan
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.StartStop",
                "params": {
                  "start": true,
                  "zone": "right driveway"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "isRunning": true,
          "isPaused": false,
          "activeZones": [
            "right driveway"
          ]
        }
      }
    ]
  }
}

KESALAHAN Perangkat

Lihat daftar lengkap error dan pengecualian.