home / skills / openclaw / skills / weather-openmeteo

weather-openmeteo skill

/skills/alexfeng75/weather-openmeteo

This skill provides current weather and 7-day forecasts from Open-Meteo in PowerShell, with Chinese support and city coverage.

npx playbooks add skill openclaw/skills --skill weather-openmeteo

Review the files below or copy the command above to add this skill to your agents.

Files (14)
SKILL.md
4.1 KB
---
name: weather-openmeteo
description: Get current weather and forecasts using Open-Meteo API (no API key required). Optimized for PowerShell environments with Chinese support.
homepage: https://open-meteo.com/en/docs
metadata: {"clawdbot":{"emoji":"🌤️","requires":{"bins":[]}}}
---

# Weather Open-Meteo Skill

A reliable weather skill using Open-Meteo API, specifically optimized for PowerShell environments with full Chinese support.

## Features

- ✅ **No API key required** - Completely free to use
- ✅ **PowerShell optimized** - Works well in PowerShell environments
- ✅ **Chinese support** - Designed for Chinese users
- ✅ **7-day forecast** - Complete weather predictions
- ✅ **Multi-city support** - Built-in Chinese major cities
- ✅ **Weather code translation** - Converts WMO codes to Chinese descriptions

## Quick Start

### Basic Usage

```powershell
# Navigate to skill directory
cd ~/.openclaw/workspace/skills/weather-openmeteo

# Get current weather (English version)
.\weather-en.ps1 -City Shanghai

# Get current weather (Chinese version)
.\weather-cn.ps1 -City Beijing
```

### Supported Cities

- Shanghai (上海)
- Beijing (北京)
- Guangzhou (广州)
- Shenzhen (深圳)
- Chengdu (成都)
- Hangzhou (杭州)
- Nanjing (南京)
- Wuhan (武汉)
- Xian (西安)
- Chongqing (重庆)

## Script Files

### weather-en.ps1 (English Version)
- Displays weather information in English
- Complete weather code descriptions
- Suitable for international users

### weather-cn.ps1 (Chinese Version)
- Displays weather information using Pinyin
- Avoids Chinese character encoding issues
- Suitable for Chinese users

### weather-simple.ps1 (Simplified Version)
- Basic functionality
- Good for learning and modification

## API Reference

### Current Weather API
```
https://api.open-meteo.com/v1/forecast?
  latitude=31.2304&
  longitude=121.4737&
  current_weather=true&
  timezone=Asia/Shanghai
```

### 7-Day Forecast API
```
https://api.open-meteo.com/v1/forecast?
  latitude=31.2304&
  longitude=121.4737&
  daily=weathercode,temperature_2m_max,temperature_2m_min,precipitation_sum&
  timezone=Asia/Shanghai
```

## Weather Code Reference

| Code | English | Chinese |
|------|---------|---------|
| 0 | Clear sky | 晴天 |
| 1 | Mainly clear | 主要晴朗 |
| 2 | Partly cloudy | 部分多云 |
| 3 | Overcast | 多云 |
| 45 | Fog | 雾 |
| 48 | Depositing rime fog | 雾凇 |
| 51-55 | Drizzle | 雨 |
| 61-65 | Rain | 雨 |
| 71-77 | Snow | 雪 |
| 80-86 | Rain showers | 雨 |
| 95-99 | Thunderstorm | 雷暴 |

## Example Output

### Current Weather
```
=== Current Weather - Shanghai ===
Time: 2026-03-03T17:45
Temperature: 8.7C
Wind speed: 12.0 km/h
Wind direction: 16 degrees
Weather: Overcast
```

## Troubleshooting

### 1. Script Execution Error
```powershell
# Set execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

### 2. Network Connection Issues
- Ensure you can access open-meteo.com
- Check firewall settings

### 3. City Not Supported
Edit the `$cityCoords` hash table to add new cities:
```powershell
"CityName" = @{ latitude = 纬度; longitude = 经度; timezone = "Asia/Shanghai" }
```

## Files Included

- `SKILL.md` - Skill description
- `README.md` - Usage instructions
- `USAGE.md` - Detailed usage guide
- `CREATION.md` - Creation process documentation
- `weather.ps1` - Complete script (Chinese)
- `weather-en.ps1` - English version
- `weather-cn.ps1` - Chinese version (Pinyin)
- `weather-simple.ps1` - Simplified version
- `example.ps1` - Usage examples

## Advantages

### vs Original Weather Skill
| Feature | Original | New Skill |
|---------|----------|-----------|
| API Key | Not needed | Not needed |
| PowerShell Support | Problematic | Optimized |
| Chinese Display | Limited | Full support |
| City Database | None | Built-in Chinese cities |
| Error Handling | Basic | Comprehensive |

### vs Other Weather Services
| Service | API Key | PowerShell | Chinese |
|---------|---------|------------|---------|
| Open-Meteo | ❌ | ✅ | ✅ |
| wttr.in | ❌ | ❌ | Limited |
| WeatherAPI | ✅ | ✅ | ✅ |

## License

MIT License - Free to use and modify

Overview

This skill provides current weather and 7-day forecasts using the Open-Meteo API without an API key. It is optimized for PowerShell environments and includes Chinese-targeted support (Pinyin output to avoid encoding issues) and a built-in list of major Chinese cities. The skill focuses on reliable, scriptable output suitable for automation and display in terminals.

How this skill works

The scripts call Open-Meteo endpoints for current weather and daily forecasts by latitude/longitude and timezone. Built-in city coordinates map city names to Open-Meteo queries. Weather codes from Open-Meteo (WMO) are translated to human-friendly descriptions; the Chinese version uses Pinyin to avoid encoding problems in PowerShell. No authentication is required; the scripts simply form the URL, request JSON, parse fields, and print formatted output.

When to use it

  • Quick weather checks from PowerShell on Windows or cross-platform shells
  • Automated scripts or scheduled tasks that need weather data without an API key
  • Environments where Chinese display must avoid character encoding issues
  • Multi-city monitoring for operations or travel planning
  • Testing or learning Open-Meteo integration in PowerShell

Best practices

  • Run the appropriate version: weather-en.ps1 for English, weather-cn.ps1 for Pinyin-based Chinese output
  • Set PowerShell execution policy if scripts are blocked (RemoteSigned recommended for local use)
  • Add or adjust city coordinates in the city map when you need cities not included
  • Cache responses if you call frequently to avoid unnecessary network requests
  • Validate timezone and coordinate entries to ensure correct local times in outputs

Example use cases

  • Quickly display current weather for Shanghai or Beijing from a PowerShell prompt
  • Schedule a daily job that emails or logs a 7-day forecast for a business location
  • Integrate into a deployment or maintenance script that needs weather-dependent logic (e.g., outdoor work)
  • Teach Open-Meteo API basics and JSON parsing using simplified PowerShell examples
  • Extend the city map to support regional operations and localized forecasts

FAQ

Do I need an API key to use this skill?

No. Open-Meteo does not require an API key, so the scripts work without authentication.

How do I add a city not in the built-in list?

Edit the city coordinates table in the script and add the city name with latitude, longitude, and timezone entries.