Google Home デベロッパー センターにようこそ。スマートホーム アクションの開発方法を学ぶことができます。注: アクションの作成は、引き続き Actions Console で行います。
コレクションでコンテンツを整理 必要に応じて、コンテンツの保存と分類を行います。

スマートホーム サーモスタット ガイド

action.devices.types.THERMOSTAT - サーモスタットは、設定ポイントとモードを備えた、温度管理デバイスです。暖房器具やエアコン ユニット(温度目標など)にのみモードと設定(高/低など)しかありません。

このタイプのデバイスは、サーモスタット アイコンとそれに関連する類義語とエイリアスを示します。

このタイプのデバイスは温度を制御しますが、一部の暖房/冷房ユニットはコントロールと高/低モードが異なりますが、温度制御はありません。

デバイスの機能

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

必要なトレイト

これらのトレイトとコマンドは、デバイスに応じて必要です。

多くの場合、サーモスタット コマンドは EXECUTE インテントでチェーンされます。ユーザーが「暖房を 22 度に設定して」と言うと、モード コマンドが生成され、その後に温度が設定されます。

品質要件

  • レイテンシ: 700 ミリ秒以下であること。
  • 信頼性: 97% 以上である必要があります。

デバイスの例: シンプルなサーモスタット

このセクションでは、上記のデバイスタイプとトレイトに基づく一般的な「サーモスタット」を表すインテント ペイロードの例を紹介します。実装でトレイトを追加または削除する場合は、その変更を反映するようにレスポンスを修正してください。

SYNC レスポンスの例

リクエスト
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
レスポンス
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.THERMOSTAT",
        "traits": [
          "action.devices.traits.TemperatureSetting"
        ],
        "name": {
          "name": "Simple thermostat"
        },
        "willReportState": true,
        "attributes": {
          "availableThermostatModes": [
            "off",
            "heat",
            "cool",
            "heatcool",
            "on"
          ],
          "thermostatTemperatureRange": {
            "minThresholdCelsius": 15,
            "maxThresholdCelsius": 30
          },
          "thermostatTemperatureUnit": "F"
        },
        "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,
        "thermostatMode": "cool",
        "thermostatTemperatureSetpoint": 23,
        "thermostatTemperatureAmbient": 25.1,
        "thermostatHumidityAmbient": 45.3
      }
    }
  }
}

EXECUTE コマンドの例

ThermostatTemperatureSetpoint

コマンド パラメータの詳細については、 action.devices.traits.TemperatureSetting リファレンスをご覧ください。

リクエスト
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatTemperatureSetpoint",
                "params": {
                  "thermostatTemperatureSetpoint": 22
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
レスポンス
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "cool",
          "thermostatTemperatureSetpoint": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

ThermostatTemperatureSetRange

コマンド パラメータの詳細については、 action.devices.traits.TemperatureSetting リファレンスをご覧ください。

リクエスト
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatTemperatureSetRange",
                "params": {
                  "thermostatTemperatureSetpointHigh": 26,
                  "thermostatTemperatureSetpointLow": 22
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
レスポンス
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "heatcool",
          "thermostatTemperatureSetpointHigh": 26,
          "thermostatTemperatureSetpointLow": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

ThermostatSetMode

コマンド パラメータの詳細については、 action.devices.traits.TemperatureSetting リファレンスをご覧ください。

リクエスト
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.ThermostatSetMode",
                "params": {
                  "thermostatMode": "heatcool"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
レスポンス
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "thermostatMode": "heatcool",
          "thermostatTemperatureSetpointHigh": 26,
          "thermostatTemperatureSetpointLow": 22,
          "thermostatTemperatureAmbient": 25.1
        }
      }
    ]
  }
}

デバイスエラー

エラーと例外のリストをご覧ください。
  • inHeatOrCool - デバイスが明示的な暖房または冷房状態にあるため、Heat / Cool / Range コマンドが失敗しました。
  • inHeatCool - デバイスが暖房または冷房状態にあるため、Heat または Cool コマンドが失敗しました。
  • lockedToRange - デバイスは特定の温度範囲またはモードにロックされているので、要求された変更を行うことができません。
  • rangeTooClose - 暖房 / 冷房範囲の温度ポイントが互いに近すぎます。