Panduan Bel Pintu Smart Home

action.devices.types.DOORBELL - Bel pintu dapat memberi tahu orang lain bahwa ada seseorang di pintu. Perangkat ini dapat mengirim notifikasi dan melakukan streaming video jika memiliki kemampuan yang sesuai.

Jenis ini menunjukkan bahwa perangkat mendapatkan ikon Bel pintu serta beberapa sinonim dan alias terkait.

Kemampuan perangkat

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

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

Persyaratan kualitas

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

Contoh perangkat: Bel pintu sederhana

Bagian ini berisi contoh payload intent yang merepresentasikan "Bel pintu" umum berdasarkan jenis dan karakteristik perangkat di atas. Jika Anda menambahkan atau menghapus karakteristik dalam implementasi, ubah respons yang sesuai untuk 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.DOORBELL",
        "traits": [
          "action.devices.traits.CameraStream",
          "action.devices.traits.ObjectDetection"
        ],
        "name": {
          "name": "Simple doorbell"
        },
        "willReportState": true,
        "notificationSupportedByAgent": true,
        "attributes": {
          "cameraStreamSupportedProtocols": [
            "hls"
          ],
          "cameraStreamNeedAuthToken": true
        },
        "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
      }
    }
  }
}

Contoh perintah EXECUTE

GetCameraStream

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

Permintaan
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.GetCameraStream",
                "params": {
                  "StreamToChromecast": true,
                  "SupportedStreamProtocols": [
                    "hls"
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
Respons
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "cameraStreamAccessUrl": "https://example.com/stream.mp4",
          "cameraStreamProtocol": "hls"
        }
      }
    ]
  }
}

Contoh laporan NOTIFIKASI

ObjectDetection

Untuk detail tambahan tentang properti notifikasi, lihat referensi action.devices.traits.ObjectDetection.

Permintaan
{
  "requestId": "6894439706274654518",
  "payload": {
    "devices": {
      "notifications": {
        "123": {
          "ObjectDetection": {
            "objects": {
              "named": [
                "Alice"
              ]
            },
            "priority": 0,
            "detectionTimestamp": 946684800000
          }
        }
      }
    }
  }
}
Respons
{
  "requestId": "6894439706274654518"
}

Perangkat ERRORS

Lihat daftar lengkap error dan pengecualian.