返回顶部
o

openweather天气查询

Get current weather, hourly forecasts, and 8-day daily forecasts for any location worldwide using OpenWeather One Call API 3.0. Use when the user asks about weather, temperature, rain, snow, forecast, or conditions for any city or location.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
415
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

openweather

OpenWeather 技能

通过小型 Python CLI(仅使用标准库)调用 OpenWeather One Call API 3.0。

命令

如果设置了 OPENWEATHERDEFAULTLOCATION,城市参数为可选项。

python3 {skillDir}/scripts/weather.py current [城市]
python3 {skillDir}/scripts/weather.py forecast [城市] --days 5
python3 {skillDir}/scripts/weather.py hourly [城市] --hours 12

规则

  • - 如果未提及位置,当配置了 OPENWEATHERDEFAULTLOCATION 时使用该值;否则向用户询问位置。
  • 每次请求最多进行 2 次 API 调用(1 次地理编码 + 1 次 onecall)。
  • 如果 API 返回 401,告知用户密钥可能无效或该密钥未启用 One Call 3.0。
  • 不要声称使用 curl;本技能使用 Python urllib。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openweather-1776291446 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openweather-1776291446 技能

通过命令行安装

skillhub install openweather-1776291446

下载

⬇ 下载 openweather v1.0.2(免费)

文件大小: 6.64 KB | 发布时间: 2026-4-16 18:20

v1.0.2 最新 2026-4-16 18:20
# OpenWeather Skill for OpenClaw

## Overview

The **OpenWeather Skill** is a lightweight, security-conscious weather and forecast integration for OpenClaw agents.
It provides current conditions, short-term, and extended forecasts using the **OpenWeather One Call API 3.0**, optimized for conversational use rather than raw data delivery.

The skill is intentionally implemented as a **small Python CLI (stdlib only)** to keep behavior transparent, auditable, and easy to reason about in security reviews.

It is designed to be:
- Predictable
- Low-risk
- Easy to sandbox
- Suitable for public ClawHub distribution

---

## What This Skill Does

This skill enables an OpenClaw agent to answer weather-related questions such as:

- “What’s the weather right now?”
- “What’s the forecast for the next few days?”
- “Will it rain later today?”
- “How hot will it get tomorrow?”

It resolves human-readable locations to coordinates using OpenWeather Geocoding, then retrieves a **single unified forecast payload** from the One Call 3.0 API.

Each request uses:
- **1 geocoding call**
- **1 One Call API call**

No additional endpoints are accessed.

---

## Why OpenWeather One Call 3.0

OpenWeather One Call 3.0 provides a stable and comprehensive dataset in a single response, which is especially well suited for agent workflows.

Advantages:
- Current, hourly, and daily forecasts in one response
- Consistent field structure across time horizons
- Up to 8 days of forecast data
- Contextual signals such as UV index and moon phase
- Fewer API calls and fewer edge cases

This allows OpenClaw agents to produce clearer, more reliable answers with minimal glue logic.

---

## Changelog

### 1.0.2 — Packaging cleanup

- Removed duplicate top-level `weather.py` file.
- Skill now ships with a single executable CLI at `scripts/weather.py`.
- No behavioral or configuration changes.
- Improves clarity during security scans and code review.

### 1.0.1 — Documentation and behavior alignment

- Implemented true “default home location” behavior via `OPENWEATHER_DEFAULT_LOCATION`.
- CLI now uses the default location when no city is provided.
- Removed incorrect references to `curl`; implementation uses Python `urllib` only.
- Explicitly documented all configuration via environment variables.
- Ensured documented behavior matches runtime behavior exactly.

### 1.0.0 — Initial public release

- Initial OpenClaw-compatible weather skill.
- Supports current, hourly, and daily forecasts.
- Uses OpenWeather Geocoding + One Call API 3.0.
- Designed for low-risk, on-demand execution.

---

## Configuration

All configuration is done via environment variables.

Required:
- `OPENWEATHER_API_KEY`
OpenWeather API key with One Call 3.0 enabled.

Optional:
- `OPENWEATHER_UNITS`
Measurement units: `imperial`, `metric`, or `standard` (default: `imperial`)
- `OPENWEATHER_DEFAULT_LOCATION`
Default “home” location used when no city is provided (e.g. `Johnstown, PA, US`)

There are:
- No config files
- No hidden state
- No persistent storage

---

## Security Model

This skill is intentionally conservative.

- Uses Python standard library only
- No package installs
- No external downloads
- No file system access beyond execution
- No user data storage
- No background execution
- No elevated privileges

Network behavior:
- HTTPS only
- Requests restricted to OpenWeather domains
- Maximum of 2 API calls per request

Credentials:
- Reads only declared environment variables
- Does not transmit credentials outside OpenWeather endpoints

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部