Query Weather Code

Last Updated on : 2023-07-06 08:28:23download

Query weather codes supported by automation and tap-to-run only.

API address

GET: /v2.0/iot-03/automations/weathers/codes

Return parameter

Parameter nameTypeDescription
resultListThe returned result.

Description of result

Parameter nameTypeDescription
codeStringThe code of a specified weather.
nameStringThe name of a specified weather code.
typeStringThe type of the code value. Valid values:
  • Boolean: the Boolean type.
  • Integer: the integer type.
  • Enum: the enumeration type.
valuesStringThe value range.

Request example

GET: /v2.0/iot-03/automations/weathers/codes

Return example

{
  "result": [
    {
      "code": "temp",
      "name": "Temperature",
      "type": "Integer",
      "values": "{\"defaultValue\":1,\"max\":40,\"min\":-40,\"step\":1}"
    },
    {
      "code": "humidity",
      "name": "Humidity",
      "type": "Enum",
      "values": "[{\"code\":\"dry\",\"name\":\"dry\"},{\"code\":\"comfort\",\"name\" :\"comfortable\"},{\"code\":\"wet\",\"name\":\"wet\"}]"
    },
    {
      "code": "condition",
      "name": "Weather",
      "type": "Enum",
      "values": "[{\"code\":\"sunny\",\"name\":\"sunny\"},{\"code\":\"cloudy\",\"name\" :\"cloudy\"},{\"code\":\"rainy\",\"name\":\"rainy\"},{\"code\":\"snowy\",\" name\":\"snowy\"},{\"code\":\"polluted\",\"name\":\"hazy\"}]"
    },
    {
      "code": "pm25",
      "name": "PM2.5",
      "type": "Enum",
      "values": "[{\"code\":\"good\",\"name\":\"good\"},{\"code\":\"fine\",\"name\" :\"fine\"},{\"code\":\"polluted\",\"name\":\"polluted\"}]"
    },
    {
      "code": "aqi",
      "name": "Air quality",
      "type": "Enum",
      "values": "[{\"code\":\"good\",\"name\":\"good\"},{\"code\":\"fine\",\"name\" :\"fine\"},{\"code\":\"polluted\",\"name\":\"polluted\"}]"
    },
    {
      "code": "windSpeed",
      "name":"Wind speed",
      "type": "Integer",
      "values": "{\"defaultValue\":1,\"max\":62,\"min\":1,\"step\":1}"
    },
    {
      "code": "sunsetrise",
      "name": "Sunrise and sunset",
      "type": "Enum",
      "values": "[{\"code\":\"sunrise\",\"name\":\"sunrise\"},{\"code\":\"sunset\",\"name\ ":\"sunset\"}]"
    }
  ],
  "success": true,
  "t": 1635404212526
}

Error code

For more information, see error code.