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

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

このタイプのデバイスにはサーモスタットのアイコンと、関連する類義語や別名が与えられます。

このタイプのデバイスは温度を制御しますが、一部の暖房/冷房ユニットにはさまざまな制御と高/低モードがありますが、温度制御は備えていません。

デバイスの機能

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

必要なトレイト

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

サーモスタットのコマンドは、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 - 暖房 / 冷房範囲の温度ポイントが互いに近すぎます。