스마트 홈 욕조 가이드

action.devices.types.BATHTUB - 욕조가 지지되는 경우 욕조를 특정 수준으로 채우고 배수할 수 있습니다.

이 유형은 기기가 욕조 아이콘과 일부 관련 동의어 및 별칭을 가져오고 있음을 나타냅니다.

기기 기능

서비스에서 지원해야 하는 속성 및 상태, EXECUTE 및 QUERY 응답을 빌드하는 방법과 같은 구현 세부정보는 해당하는 trait 문서를 참고하세요.

기기에 적용되는 경우 이러한 특성이 권장됩니다. 하지만 사용 가능한 모든 특성 중에서 기존 제품 기능에 가장 잘 맞는 특성을 자유롭게 조합해도 됩니다.

품질 요구사항

  • 지연 시간: 800ms 이하여야 합니다.
  • 신뢰성: 97% 이상이어야 합니다.

기기 예시: 간단한 욕조

이 섹션에는 위의 기기 유형과 특성을 기반으로 일반적인 '욕조'를 나타내는 인텐트 페이로드 예시가 포함되어 있습니다. 구현에 특성을 추가하거나 삭제하는 경우 이러한 변경사항을 반영하도록 응답을 적절하게 수정하세요.

샘플 SYNC 응답

요청
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
응답
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.BATHTUB",
        "traits": [
          "action.devices.traits.Fill",
          "action.devices.traits.TemperatureControl",
          "action.devices.traits.OnOff"
        ],
        "name": {
          "name": "Simple bathtub"
        },
        "willReportState": true,
        "attributes": {
          "availableFillLevels": {
            "levels": [
              {
                "level_name": "half_key",
                "level_values": [
                  {
                    "level_synonym": [
                      "Half",
                      "Halfway",
                      "One half"
                    ],
                    "lang": "en"
                  }
                ]
              }
            ],
            "ordered": false
          },
          "temperatureRange": {
            "minThresholdCelsius": 25,
            "maxThresholdCelsius": 100
          },
          "temperatureUnitForUX": "F"
        },
        "deviceInfo": {
          "manufacturer": "smart-home-inc",
          "model": "hs1234",
          "hwVersion": "3.2",
          "swVersion": "11.4"
        }
      }
    ]
  }
}

샘플 쿼리 응답

요청
{
  "requestId": "6894439706274654514",
  "inputs": [
    {
      "intent": "action.devices.QUERY",
      "payload": {
        "devices": [
          {
            "id": "123"
          }
        ]
      }
    }
  ]
}
응답
{
  "requestId": "6894439706274654514",
  "payload": {
    "devices": {
      "123": {
        "status": "SUCCESS",
        "online": true,
        "on": false,
        "currentFillLevel": "half_key",
        "isFilled": true,
        "temperatureSetpointCelsius": 30
      }
    }
  }
}

샘플 EXECUTE 명령어

채우기

명령어 매개변수에 관한 자세한 내용은 action.devices.traits.Fill 참조를 확인하세요.

요청
{
  "requestId": "6894439706274654516",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.Fill",
                "params": {
                  "fill": true,
                  "fillLevel": "half_key"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
응답
{
  "requestId": "6894439706274654516",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true,
          "currentFillLevel": "half_key"
        }
      }
    ]
  }
}

SetTemperature

명령어 매개변수에 관한 자세한 내용은 action.devices.traits.TemperatureControl 참조를 확인하세요.

요청
{
  "requestId": "6894439706274654520",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetTemperature",
                "params": {
                  "temperature": 40
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
응답
{
  "requestId": "6894439706274654520",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "temperatureSetpointCelsius": 40
        }
      }
    ]
  }
}

OnOff

명령어 매개변수에 관한 자세한 내용은 action.devices.traits.OnOff 참조를 확인하세요.

요청
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.OnOff",
                "params": {
                  "on": true
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
응답
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "on": true
        }
      }
    ]
  }
}

기기 오류

오류 및 예외의 전체 목록을 참조하세요.