Query Weather Code

Last Updated on : 2023-06-15 05:05:47

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

API address

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

Return parameter

Parameter name Type Description
result List The returned result.

Description of result

Parameter name Type Description
code String The code of a specified weather.
name String The name of a specified weather code.
type String The type of the code value. Valid values:
  • Boolean: the Boolean type.
  • Integer: the integer type.
  • Enum: the enumeration type.
values String The 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.