关于 Weather Automation
Weather Automation 用于根据当前天气、预报和预警构建自动化工作流与通知。示例包括定时天气简报,以及针对日历中户外活动的天气查询。
主要功能
- 01查询当前天气
- 02获取多日预报
- 03按阈值触发天气预警
- 04定时发送预报通知
- 05根据活动查询天气
适用场景
- 01发送早间天气简报
- 02预报可能降雨时通知
- 03查询户外活动天气状况
- 04自动发送基于预报的提醒
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ claude-office-skills/ skills --skill weather-automation安装后在 Claude Code 中输入/weather-automation确认已加载。
详细介绍
天气自动化
自动化天气相关的工作流和通知。
核心功能
当前天气
current_weather:
location: "San Francisco, CA"
# or coordinates
lat: 37.7749
lon: -122.4194
response:
temperature: 65°F
feels_like: 63°F
humidity: 72%
wind_speed: 12 mph
conditions: "Partly Cloudy"
uv_index: 5
天气预报
forecast:
location: "New York, NY"
days: 7
daily:
- date: "2024-01-20"
high: 45°F
low: 32°F
conditions: "Snow"
precipitation_chance: 80%
hourly:
interval: 3 # hours
periods: 24
天气预警
alert_rules:
- name: "Rain Alert"
condition:
precipitation_chance: "> 70%"
within_hours: 6
action:
notify: slack
message: "☔ Rain expected in next 6 hours"
- name: "Freeze Warning"
condition:
temperature: "< 32°F"
action:
- notify: sms
- trigger: home_assistant
action: protect_pipes
工作流示例
晨间简报
morning_weather:
trigger: daily at 6:30 AM
actions:
- get_forecast:
location: home
days: 1
- send_notification:
channel: slack_dm
message: |
🌤️ Good morning! Today's weather:
High: {{high}}°F | Low: {{low}}°F
{{conditions}}
{{#if rain}}☔ Bring an umbrella!{{/if}}
活动规划
event_weather:
trigger: calendar_event_tomorrow
condition:
event_type: outdoor
actions:
- get_forecast:
location: "{{event.location}}"
date: "{{event.date}}"
- if:
precipitation_chance: "> 50%"
then:
- notify: organizer
message: "Consider backup venue - rain likely"
最佳实践
- 缓存:缓存频繁的请求
- 单位:同时支持公制和英制单位
- 准确性:使用可靠的数据源
- 预警:设置合理的阈值
- 位置:支持多种格式
评论
支持 Markdown