スマートホーム煙探知器ガイド

action.devices.types.SMOKE_DETECTOR - 煙探知機は、煙が現在検出されているかどうか、煙の濃度が高いかどうか、現在の煙レベル(ppm)を報告できます。

このタイプのデバイスには煙探知機のアイコンが設定され、関連する類義語と別名が与えられます。

デバイスの機能

サービスがサポートする必要がある属性や状態、EXECUTE および QUERY レスポンスの作成方法など、実装の詳細については、対応するトレイトのドキュメントをご覧ください。

必要なトレイト

デバイスに適用可能な場合は、これらのトレイトとコマンドが必要です。デバイスがこれらのトレイトをサポートしていない場合は、QUERY または EXECUTE レスポンスに functionNotSupported のエラーコードを入力します。詳細については、エラーと例外をご覧ください。

品質要件

  • レイテンシ: 1000 ミリ秒以下。
  • 信頼性: 97% 以上

デバイス例: シンプルな煙探知器

このセクションでは、上記のデバイスタイプとトレイトに基づく一般的な「煙探知器」を表すインテント ペイロードの例を示します。実装でトレイトを追加または削除した場合は、それに合わせてレスポンスを変更し、変更を反映します。

SYNC レスポンスの例

リクエスト
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
レスポンス
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.SMOKE_DETECTOR",
        "traits": [
          "action.devices.traits.SensorState"
        ],
        "name": {
          "name": "Simple smoke detector"
        },
        "willReportState": true,
        "attributes": {
          "sensorStatesSupported": [
            {
              "name": "SmokeLevel",
              "descriptiveCapabilities": {
                "availableStates": [
                  "smoke detected",
                  "high",
                  "no smoke detected"
                ]
              },
              "numericCapabilities": {
                "rawValueUnit": "PARTS_PER_MILLION"
              }
            }
          ]
        },
        "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,
        "currentSensorStateData": [
          {
            "name": "SmokeLevel",
            "currentSensorState": "high",
            "rawValue": 200
          }
        ]
      }
    }
  }
}

デバイスエラー

エラーと例外の全リストをご覧ください。