스마트 홈 공기 청정기 가이드

action.devices.types.AIRFRESHENER - 공기 청정기를 켜고 끌 수 있으며 다양한 모드를 조정할 수 있습니다.

이 유형은 기기가 공기 청정기 아이콘과 일부 관련 동의어 및 별칭을 가져옴을 나타냅니다.

기기 기능

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

필수 특성

이러한 특성과 명령어는 기기에 적용되는 경우 필요합니다. 기기에서 이러한 특성을 지원하지 않으면 쿼리 또는 실행 응답에 functionNotSupported 오류 코드를 입력합니다. 자세한 내용은 오류 및 예외를 참고하세요.

이러한 특성은 기기에 적용되는 경우 권장됩니다. 하지만 사용 가능한 모든 특성을 혼합하여 기존 제품 기능에 가장 적합하게 만들 수 있습니다.

기기 예: 간단한 방향제

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

샘플 SYNC 응답

요청
{
  "requestId": "6894439706274654512",
  "inputs": [
    {
      "intent": "action.devices.SYNC"
    }
  ]
}
대답
{
  "requestId": "6894439706274654512",
  "payload": {
    "agentUserId": "user123",
    "devices": [
      {
        "id": "123",
        "type": "action.devices.types.AIRFRESHENER",
        "traits": [
          "action.devices.traits.OnOff",
          "action.devices.traits.Toggles"
        ],
        "name": {
          "name": "Simple air freshener"
        },
        "willReportState": true,
        "attributes": {
          "availableToggles": [
            {
              "name": "intermittent_key",
              "name_values": [
                {
                  "name_synonym": [
                    "Intermittent Spray"
                  ],
                  "lang": "en"
                },
                {
                  "name_synonym": [
                    "Intermittierender Spray"
                  ],
                  "lang": "de"
                }
              ]
            }
          ]
        },
        "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,
        "on": true,
        "currentToggleSettings": {
          "intermittent_key": true
        }
      }
    }
  }
}

샘플 실행 명령어

OnOff

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

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

SetToggles

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

요청
{
  "requestId": "6894439706274654518",
  "inputs": [
    {
      "intent": "action.devices.EXECUTE",
      "payload": {
        "commands": [
          {
            "devices": [
              {
                "id": "123"
              }
            ],
            "execution": [
              {
                "command": "action.devices.commands.SetToggles",
                "params": {
                  "updateToggleSettings": {
                    "intermittent_key": false
                  }
                }
              }
            ]
          }
        ]
      }
    }
  ]
}
대답
{
  "requestId": "6894439706274654518",
  "payload": {
    "commands": [
      {
        "ids": [
          "123"
        ],
        "status": "SUCCESS",
        "states": {
          "online": true,
          "currentToggleSettings": {
            "intermittent_key": false
          }
        }
      }
    ]
  }
}

기기 오류

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