The Smart Weather Assistant not only retrieves weather information, but also provides clothing advice and commuting advice based on weather conditions.
Trigger Conditions
Use this skill when the user mentions the following:
- Weather in a certain place (e.g. "Beijing weather", "How is Shanghai today")
- Weather for a certain time period (e.g. "Tomorrow's weather", "Will it rain the day after tomorrow")
- Clothing-related (e.g. "What should I wear today", "Do I need to bring an umbrella tomorrow")
- Commuting-related (e.g. "Is it suitable to bike to work today", "Should I drive")
- Activity advice (e.g. "Is it suitable for outdoor activities", "Can I go to the park")
How to Use
1. Get weather data
Use the wttr.in API to get weather information:
# 当前天气(简略)
curl -s "wttr.in/{城市名}?lang=zh&format=3"
# 当前天气(详细)
curl -s "wttr.in/{城市名}?lang=zh"
# 明天预报
curl -s "wttr.in/{城市名}?lang=zh&1"
2. Parse weather data
Based on the returned weather information, extract the following key data:
- Temperature for the current/target time period
- Weather conditions (sunny/cloudy/rain/snow, etc.)
- Wind speed
- Rainfall
- Humidity
3. Provide clothing advice
Give clothing advice based on temperature and weather conditions:
Temperature range reference table:
- ≤ 5°C: Down jacket, thick cotton coat, sweater, thermal underwear, scarf, gloves, hat
- 5-10°C: Thick coat, down jacket, sweater, long pants, scarf
- 10-15°C: Light coat, trench coat, hoodie, long-sleeved T-shirt, long pants
- 15-20°C: Long-sleeved T-shirt, light coat, long pants/jeans
- 20-25°C: Short-sleeved T-shirt, light long pants
- 25-30°C: Short sleeves, shorts, light shirt
- ≥ 30°C: Lightweight breathable clothing, sun protection
Weather condition reference table:
- Sunny: Pay attention to sun protection, prepare sunglasses and sunscreen
- Cloudy/Overcast: You can appropriately add a light coat
- Light rain: Bring an umbrella, wear waterproof shoes or boots
- Moderate rain/Heavy rain: Wear a waterproof jacket, rain boots, and use an umbrella
- Snow: Wear a down jacket, non-slip shoes, gloves, and a hat
4. Provide commuting advice
Give commuting advice based on weather conditions:
- Sunny: Suitable for walking/cycling, pay attention to sun protection
- Cloudy: Suitable for all commuting methods
- Light rain:
- Cycling: Wear a raincoat, be careful of slippery roads
- Walking: Use an umbrella, wear waterproof shoes
- Driving: Slow down, pay attention to following distance
- Moderate rain/Heavy rain: Driving or public transportation is recommended; avoid walking/cycling
- Snow: Public transportation or driving is recommended; wear non-slip shoes
- Strong wind (wind speed > 15 km/h): Cycling is not recommended; beware of falling objects from above
5. Activity advice
- Sunny: Suitable for outdoor activities, sports, and outings
- Cloudy: Suitable for most outdoor activities
- Light rain: Not suitable for long outdoor activities; focus on indoor activities
- Moderate rain/Heavy rain: Outdoor activities are not recommended
- Snow: Snow activities can be carried out, but keep warm
- High temperature (≥ 30°C): Avoid outdoor activities at noon, and take precautions against heatstroke
Response format
Brief response (weather only)
🌤️ [城市]天气预报
【当前天气】
[天气图标] [天气状况],[温度]°C,风速 [风速] km/h
【明日预报】
☀️ [天气状况],[最低温度]-[最高温度]°C
Full response (including suggestions)
🌤️ [城市]天气预报
【当前天气】
[天气图标] [天气状况],[温度]°C
风速:[风速] km/h | 降雨量:[降雨量]mm
【[时间段]预报】
[天气图标] [天气状况],[最低温度]-[最高温度]°C
👕 穿衣建议
[根据天气给出的具体穿衣建议]
🚗 通勤建议
[根据天气给出的通勤建议]
🏃 活动建议
[根据天气给出的活动建议]
Example conversation
User: "What's the weather like in Beijing tomorrow, and what should I wear?"
AI response:
🌤️ 北京天气预报
【明日预报】
☀️ 晴天,12-20°C
👕 穿衣建议
- 早上较凉(12°C):穿长袖T恤 + 薄外套
- 中午回暖(20°C):可脱掉外套
- 建议:薄外套、长袖T恤、牛仔裤
🚗 通勤建议
- 晴天适合骑行或步行上班
- 注意防晒,建议戴墨镜
🏃 活动建议
- 天气晴朗,适合户外活动
- 可以安排午休散步或下班后运动
User: "It's raining today. Is it suitable to cycle to work?"
AI response:
🌧️ 成都天气预报
【当前天气】
🌧 中雨,15°C
风速:9 km/h | 降雨量:3.2mm
🚗 通勤建议
- 中雨天气,不建议骑行
- 建议乘坐公共交通或开车
- 如必须骑行,请穿雨衣并注意安全
- 路面湿滑,减速慢行
👕 穿衣建议
- 穿防水外套或带伞
- 穿防水鞋或靴子
- 长袖T恤 + 薄外套
Notes
- City names support Chinese and are URL-encoded as UTF-8
- wttr.in has rate limits, avoid repeated requests within a short time
- Forecast data is for reference only; refer to the official meteorological observatory for specifics
- Clothing and commuting suggestions are based on general experience and need to be adjusted according to individual constitution
Supported location formats
- City name:
成都、北京、上海 - International city:
Tokyo、New+York、London - Airport code:
CTU、PEK、PVG