OpenMeteo天气技能:AI驱动的实时预报 - Openclaw Skills

作者:互联网

2026-03-26

AI教程

什么是 OpenMeteo天气技能?

OpenMeteo天气技能是一个强大的集成工具,专为AI智能体即时访问全球气象数据而设计。通过利用免费的OpenMeteo API,该技能允许智能体提供准确的温度、降水和风力信息,而无需API密钥的管理开销。它是开发者在Openclaw Skills生态系统中构建响应式智能体的核心组件,提供了一种将智能体响应建立在真实环境数据基础上的无缝方式。

该技能针对LLM交互进行了优化,确保返回的数据简洁且与用户的特定查询相关。无论用户是询问简单的温度检查,还是周末旅行的复杂16天展望,OpenMeteo天气技能都能提供必要的精度和灵活性来处理各种与天气相关的提示。

下载入口:https://github.com/openclaw/skills/tree/main/skills/lstpsche/openmeteo-sh-weather-simple

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install openmeteo-sh-weather-simple

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 openmeteo-sh-weather-simple。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

OpenMeteo天气技能 应用场景

  • 查看任何城市的当前天气状况,如温度、风速和云量。
  • 通过分析每小时降水概率来确定是否需要带伞。
  • 利用包括最高/最低温度和日出时间在内的16天延长预报来计划多日旅行。
  • 获取偏远地区或精确导航的特定基于坐标的天气数据。
  • 通过在后续查询中保持参数上下文来比较多个城市的天气。
OpenMeteo天气技能 工作原理
  1. AI智能体检测到与天气相关的意图并识别目标位置(城市名称或坐标)。
  2. 智能体执行带有适当标志(如 --current 或 --forecast-days)的 openmeteo CLI 命令。
  3. 该技能向 OpenMeteo API 发送请求,如果未提供坐标,则自动对城市名称进行地理编码。
  4. 根据请求的参数(如 hourly_params 或 daily_params)检索并筛选气象数据。
  5. 工具使用 --llm 标志处理数据,以确保输出针对令牌效率进行了优化。
  6. AI智能体接收结构化输出并为用户生成自然语言摘要。

OpenMeteo天气技能 配置指南

要使用此技能,请确保已安装 openmeteo 二进制文件并在系统路径中可访问。在您的智能体配置中,注册该技能以启用 Openclaw Skills 功能。您可以使用简单的 CLI 命令测试安装:

openmeteo weather --current --city="London" --llm

开始获取天气数据不需要 API 密钥或身份验证。

OpenMeteo天气技能 数据架构与分类体系

该技能根据请求的时间范围返回结构化天气数据。数据分为当前、每小时和每日指标:

数据类型 示例参数 描述
当前 temperature_2m, weather_code 实时气温和状况文本。
每小时 precipitation_probability, uv_index 一天中特定时间的细粒度数据。
每日 sunrise, sunset, temperature_2m_max 汇总的每日摘要和天文数据。
地理位置 --lat, --lon, --country 用于精确数据定位的位置标识符。
name: openmeteo-sh-weather-simple
description: "Get current weather and forecasts for any city or coordinates using free OpenMeteo API. Use when the user asks about weather, temperature, rain, snow, wind, or wants to know if they need an umbrella."
metadata: {"openclaw":{"emoji":"??","requires":{"bins":["openmeteo"]}}}
homepage: https://github.com/lstpsche/openmeteo-sh
user-invocable: true

OpenMeteo Weather (openmeteo-sh)

Current weather and forecasts (up to 16 days) via openmeteo CLI. No API key required.

Quick reference

openmeteo weather --current --city=Berlin --llm
openmeteo weather --current --forecast-days=2 --city=London --llm
openmeteo weather --forecast-days=7 --forecast-since=5 --city=Rome --llm
openmeteo weather --current --lat=48.85 --lon=2.35 --llm

Location (pick one)

  • --city=NAME — city name (auto-geocoded)
  • --city=NAME --country=CODE — disambiguate (e.g. Portland --country=US)
  • --lat=NUM --lon=NUM — direct coordinates

Options

  • --current — current conditions
  • --forecast-days=N — forecast length, 1–16 (default 7)
  • --forecast-since=N — start from day N (1=today, 2=tomorrow). Must be <= forecast-days.
  • --hourly-params=LIST — override hourly variables (comma-separated)
  • --daily-params=LIST — override daily variables (comma-separated)
  • --current-params=LIST — override current variables (comma-separated)
  • --temperature-unit=UNIT — celsius (default) / fahrenheit
  • --llm — always pass this

Variables

Defaults are sensible for general weather. Override only when needed.

Current & hourly:

  • temperature_2m — air temp, C
  • apparent_temperature — feels-like, C
  • precipitation — rain+showers+snow, mm
  • precipitation_probability (hourly only) — chance of precipitation, %
  • weather_code — condition, auto-resolved to text
  • wind_speed_10m — wind, km/h
  • wind_gusts_10m — gusts, km/h
  • cloud_cover — cloud cover, %
  • snowfall — snowfall, cm
  • uv_index (hourly only) — UV index

Daily:

  • temperature_2m_max / temperature_2m_min — max/min temp, C
  • precipitation_sum — total precipitation, mm
  • precipitation_probability_max — max precipitation chance, %
  • weather_code — dominant condition
  • wind_speed_10m_max — max wind, km/h
  • sunrise / sunset — times
  • snowfall_sum — total snowfall, cm

Rules

  1. Always pass --llm.
  2. Quote all user-provided values in shell commands: --city="New York", --city="St. Petersburg". Only known-safe tokens (numbers, single ASCII words) may be unquoted.
  3. Never use help subcommand or --raw — work only with what's described here.
  4. No location specified -> use the user's default city/country if known from session context.
  5. Summarize results naturally — never paste raw output.
  6. Use --forecast-days=1 for today, =2 for tomorrow — minimize token waste.
  7. Use --forecast-since=N to skip to a specific future day.
  8. For targeted questions, override params to fetch only what's needed.
  9. When the user switches cities ("and what about London?"), carry over all params used in prior weather queries this conversation — including any added in follow-ups. The new city gets the union of all previously requested params.

Examples

"What's the weather like?" -> openmeteo weather --current --city=Berlin --llm Summarize: "Clear, -12C (feels -17C), wind 9 km/h."

"When will the rain stop?" -> openmeteo weather --forecast-days=2 --city=Berlin --hourly-params=precipitation,precipitation_probability,weather_code --llm Find when precipitation hits ~0. Answer: "Should stop around 14:00."

"Do I need an umbrella?" -> openmeteo weather --forecast-days=1 --city=Berlin --hourly-params=precipitation,precipitation_probability,weather_code --llm "Yes — 70% chance between 11:00-15:00, up to 2mm."

"Weather this weekend in Rome?" -> openmeteo weather --forecast-days=7 --forecast-since=5 --city=Rome --daily-params=temperature_2m_max,temperature_2m_min,weather_code,precipitation_sum --llm Present only Sat/Sun: "Saturday: 14/8C, partly cloudy. Sunday: 16/9C, clear."

"Temperature outside?" -> openmeteo weather --current --city=Berlin --current-params=temperature_2m,apparent_temperature --llm "-5C, feels like -9C."