Google Weather - Real-time Weather Data
Get accurate weather conditions using Google's Weather API. Requires a Google Cloud API key with Weather API enabled.
Quick Usage
CODEBLOCK0
Example Output
Metric (default):
CODEBLOCK1
Imperial (GOOGLE_WEATHER_UNITS=IMPERIAL):
CODEBLOCK2
Forecast:
CODEBLOCK3
Supported Locations
Any location worldwide - just type the city name:
- -
New York, London, Paris, Berlin, INLINECODE5 - INLINECODE6 ,
Berlin, Singapore, INLINECODE9 - Or any address, landmark, or coordinates
The skill automatically geocodes locations using Google Maps API.
Data Available
- - Temperature: Current + feels like
- Conditions: Clear, cloudy, rain, snow, etc. with emoji icons
- Forecast: Hourly data for temperature, wind, and conditions
- Humidity: Percentage
- Wind: Speed, direction, gusts
- UV Index: Sun exposure level
- Precipitation: Probability and type
- Cloud Cover: Percentage
- Visibility: Distance
Setup
- 1. Create a project in Google Cloud Console
- Enable the Weather API
- Enable the Geocoding API (for location name lookup)
- Create an API key and set it as
GOOGLE_API_KEY environment variable
Also supports GOOGLE_WEATHER_API_KEY or GOOGLE_MAPS_API_KEY if you already have one configured.
Configuration
Units System
By default, the skill uses metric units (°C, km/h). To switch to imperial (°F, mph), set the GOOGLE_WEATHER_UNITS environment variable:
CODEBLOCK4
| Setting | Temperature | Wind Speed | Precipitation | Visibility |
|---|
| INLINECODE14 (default) | °C | km/h | mm | km |
| INLINECODE15 |
°F | mph | inches | miles |
No code changes needed — just set the env var and restart.
Multi-language Support
Output adapts to location - supports English, Hebrew, and other languages based on the language parameter.
CODEBLOCK5
Google Weather - 实时天气数据
使用 Google 天气 API 获取准确的天气状况。需要启用天气 API 的 Google Cloud API 密钥。
快速使用
bash
当前天气(格式化输出)
python3 skills/google-weather/lib/weather_helper.py current New York
python3 skills/google-weather/lib/weather_helper.py current London
python3 skills/google-weather/lib/weather_helper.py current Sydney
24小时预报
python3 skills/google-weather/lib/weather_helper.py forecast Tel Aviv
原始 JSON 数据
python3 skills/google-weather/lib/weather_helper.py json Paris
示例输出
公制(默认):
New York
局部多云 ⛅
🌡️ 12°C(体感温度 10°C)
💨 风力:18 km/h 西北风
💧 湿度:55%
英制(GOOGLEWEATHERUNITS=IMPERIAL):
New York
局部多云 ⛅
🌡️ 53.6°F(体感温度 50°F)
💨 风力:11 mph 西北风
💧 湿度:55%
预报:
Tel Aviv 24小时预报
18:00:17.8°C,☀️ 5 km/h 北风
22:00:14.3°C,☀️ 6 km/h 东北偏东风
02:00:12.8°C,⛅ 8 km/h 东北风
06:00:10.8°C,☀️ 6 km/h 东北偏东风
10:00:16.1°C,☀️ 5 km/h 南风
14:00:20.4°C,🌤️ 8 km/h 西北偏西风
支持的地点
全球任何地点 - 只需输入城市名称:
- - New York、London、Paris、Berlin、Sydney
- San Francisco、Berlin、Singapore、Dubai
- 或任何地址、地标、坐标
该技能会自动使用 Google Maps API 对地点进行地理编码。
可用数据
- - 温度:当前温度 + 体感温度
- 天气状况:晴、多云、雨、雪等,带表情符号图标
- 预报:每小时温度、风力、天气状况数据
- 湿度:百分比
- 风力:速度、方向、阵风
- 紫外线指数:日照强度等级
- 降水量:概率和类型
- 云量:百分比
- 能见度:距离
设置
- 1. 在 Google Cloud Console 中创建项目
- 启用 天气 API
- 启用 地理编码 API(用于地点名称查询)
- 创建 API 密钥并将其设置为 GOOGLEAPI_KEY 环境变量
如果已配置,也支持 GOOGLEWEATHERAPIKEY 或 GOOGLEMAPSAPIKEY。
配置
单位制
默认情况下,该技能使用公制单位(°C、km/h)。要切换到英制(°F、mph),请设置 GOOGLEWEATHERUNITS 环境变量:
yaml
在您的 OpenClaw 配置中(env 部分):
GOOGLE
WEATHERUNITS: IMPERIAL
| 设置 | 温度 | 风速 | 降水量 | 能见度 |
|---|
| METRIC(默认) | °C | km/h | mm | km |
| IMPERIAL |
°F | mph | inches | miles |
无需修改代码 — 只需设置环境变量并重启即可。
多语言支持
输出会根据地点自适应 - 支持英语、希伯来语及其他语言,取决于 language 参数。
bash
希伯来语输出
python3 skills/google-weather/lib/weather_helper.py current Tel Aviv
输出:בהיר ☀️ 19°C...