闲社服务运行正常AI智能体自动化平台
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
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

天气查询

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
返回顶部