weather-integration

Configure and troubleshoot weather-based irrigation skip rules using the Open-Meteo API. Use when asked to set up rain forecast skips, configure rain threshold values, debug why zones are or are not being skipped, check weather cache status, understand skip preview results, or tune skip rule sensitivity for your local climate. Triggers include "skip when rain", "weather threshold", "Open-Meteo", "skip preview", "rain forecast rule", "freeze protection", or any task involving weather-driven irrigation decisions.

7 stars

Best use case

weather-integration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Configure and troubleshoot weather-based irrigation skip rules using the Open-Meteo API. Use when asked to set up rain forecast skips, configure rain threshold values, debug why zones are or are not being skipped, check weather cache status, understand skip preview results, or tune skip rule sensitivity for your local climate. Triggers include "skip when rain", "weather threshold", "Open-Meteo", "skip preview", "rain forecast rule", "freeze protection", or any task involving weather-driven irrigation decisions.

Teams using weather-integration should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/weather-integration/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/agriculture-farming/irrigation-scheduler/skills/weather-integration/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/weather-integration/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How weather-integration Compares

Feature / Agentweather-integrationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Configure and troubleshoot weather-based irrigation skip rules using the Open-Meteo API. Use when asked to set up rain forecast skips, configure rain threshold values, debug why zones are or are not being skipped, check weather cache status, understand skip preview results, or tune skip rule sensitivity for your local climate. Triggers include "skip when rain", "weather threshold", "Open-Meteo", "skip preview", "rain forecast rule", "freeze protection", or any task involving weather-driven irrigation decisions.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# weather-integration

Connect irrigation-scheduler to live weather data from Open-Meteo for automatic rain and freeze skip rules.

## When to Use

- Setting up your first weather-based skip rule
- Tuning rain forecast thresholds for your local climate
- Diagnosing why a zone ran despite rain
- Diagnosing why a zone was skipped unexpectedly
- Understanding the weather cache and refresh cycle
- Previewing which zones will skip today before schedules fire

## How It Works

irrigation-scheduler fetches hourly forecast data from the Open-Meteo API every 30 minutes. The raw response is stored in `weather_cache` in SQLite. When the cron scheduler evaluates a zone before each run, it reads the cached weather data and evaluates every active skip rule for that zone in order. If any rule matches, the run is recorded as `skipped` with the rule name and reason.

Manual runs bypass all skip rule evaluation.

## Prerequisites

1. Latitude and longitude set in Settings (`PUT /api/settings` with `latitude` and `longitude`)
2. At least one skip rule attached to a zone
3. Server has outbound HTTPS access to `api.open-meteo.com`

## Open-Meteo Fields Used

| Field | Used For |
|---|---|
| `precipitation_sum` (daily) | `rain_yesterday` rule: yesterday total in mm |
| `precipitation_probability_max` + `precipitation` (hourly) | `rain_forecast` rule: sum over next H hours |
| `temperature_2m_min` (daily) | `temperature_below` rule: freeze protection |

All values are in metric units (mm for precipitation, Celsius for temperature).

## Skip Rule Reference

### rain_forecast

Skips if the sum of forecast precipitation over the next N hours exceeds a threshold.

```json
{
  "rule_type": "rain_forecast",
  "threshold_mm": 5.0,
  "window_hours": 24
}
```

**Tuning guide:**
- Dry climates: lower threshold (2-3mm) to skip on any meaningful rain
- Humid climates: higher threshold (8-12mm) to avoid over-skipping
- Drip irrigation: lower threshold since plants need less supplemental water
- Lawn irrigation: higher threshold since lawns need more volume

### rain_yesterday

Skips if measured precipitation from the previous calendar day exceeded a threshold.

```json
{
  "rule_type": "rain_yesterday",
  "threshold_mm": 10.0
}
```

**Tuning guide:**
- Sandy soil drains fast: lower threshold (6-8mm)
- Clay soil retains moisture: higher threshold (15-20mm)
- Raised beds: lower threshold (5-8mm)
- In-ground lawn: higher threshold (12-18mm)

### temperature_below

Skips if the forecasted minimum temperature is below a threshold. Used for freeze protection.

```json
{
  "rule_type": "temperature_below",
  "threshold_celsius": 2.0
}
```

Set to 2C (35F) for a safety margin above 0C (32F) to account for sensor variation.

## API Quick Reference

```bash
# Check current weather cache
curl http://localhost:3001/api/weather

# Get skip preview for today (which zones will skip and why)
curl http://localhost:3001/api/weather/skip-preview

# Force a weather cache refresh
curl -X POST http://localhost:3001/api/weather/refresh

# List skip rules for a zone
curl http://localhost:3001/api/zones/{zone-id}/skip-rules

# Add a skip rule to a zone
curl -X POST http://localhost:3001/api/zones/{zone-id}/skip-rules \
  -H "Content-Type: application/json" \
  -d '{"rule_type":"rain_forecast","threshold_mm":5,"window_hours":24}'

# Update a skip rule
curl -X PUT http://localhost:3001/api/zones/{zone-id}/skip-rules/{rule-id} \
  -H "Content-Type: application/json" \
  -d '{"threshold_mm":8}'

# Delete a skip rule
curl -X DELETE http://localhost:3001/api/zones/{zone-id}/skip-rules/{rule-id}
```

## Skip Preview Response

The skip preview endpoint returns per-zone evaluation before any runs fire:

```json
{
  "evaluated_at": "2025-04-14T06:00:00Z",
  "weather_source": "cache",
  "weather_age_minutes": 12,
  "zones": [
    {
      "zone_id": "...",
      "zone_name": "Garden Beds",
      "scheduled_today": true,
      "will_skip": true,
      "skip_reason": "Rain forecast 12.4mm in next 24h exceeds threshold 5.0mm",
      "rule_type": "rain_forecast"
    },
    {
      "zone_id": "...",
      "zone_name": "Front Lawn",
      "scheduled_today": true,
      "will_skip": false,
      "skip_reason": null
    }
  ]
}
```

## Environment Variables

| Variable | Description | Default |
|---|---|---|
| DEFAULT_LATITUDE | Initial latitude loaded into settings | 0 |
| DEFAULT_LONGITUDE | Initial longitude loaded into settings | 0 |
| WEATHER_CACHE_TTL_MIN | Minutes before weather cache is considered stale | 30 |

Set `DEFAULT_LATITUDE` and `DEFAULT_LONGITUDE` at first launch to avoid needing to manually configure Settings before skip rules can evaluate.

## Troubleshooting

### Weather data shows zeros or empty

1. Confirm coordinates are set: `GET /api/settings` - check `latitude` and `longitude` are non-zero
2. Test Open-Meteo directly: `curl "https://api.open-meteo.com/v1/forecast?latitude=YOUR_LAT&longitude=YOUR_LON&daily=precipitation_sum&timezone=auto"`
3. Check server logs for HTTP errors on the weather fetch

### Zone ran despite rain forecast

1. Check skip preview before the scheduled run time: `GET /api/weather/skip-preview`
2. Confirm the skip rule is attached to the zone: `GET /api/zones/:id/skip-rules`
3. Confirm `enabled` is `1` on both the zone and the skip rule
4. Check that `window_hours` covers the time of rain: if rain is forecast at hour 30 but your window is 24, it will not trigger
5. Verify the weather cache was fresh at run time: check `GET /api/weather` for `fetched_at`

### Zone skipped when it should not have

1. Check the `skip_reason` in run history: `GET /api/runs?status=skipped`
2. Adjust the skip rule threshold upward and re-evaluate
3. If the threshold seems correct, verify units: Open-Meteo returns mm, not inches

### Weather fetch fails silently

When Open-Meteo is unreachable, the scheduler falls back to running as scheduled (safe-to-water default). Check server logs for `WEATHER_FETCH_ERROR` entries. No zones will be skipped if weather data cannot be refreshed within the cache TTL.

Related Skills

ci-integration

7
from heldernoid/agentic-build-templates

Integrate deployment-tracker into CI/CD pipelines. GitHub Actions and GitLab CI workflow examples for automatic deployment logging.

shell-integration

7
from heldernoid/agentic-build-templates

Set up terminal-bookmarks shell integration for interactive bookmark search with a keyboard shortcut. Use when configuring the Ctrl+B keybind widget in zsh, bash, or fish, or when troubleshooting shell integration issues. Triggers include "set up shell widget", "Ctrl+B bookmark", "shell integration", "interactive search keybind", "tbm shell-init".

source-integrations

7
from heldernoid/agentic-build-templates

Set up and maintain GitHub OAuth2 and Slack Bot Token integrations for notification-hub.

weather-station-dashboard

7
from heldernoid/agentic-build-templates

Query live and historical weather sensor data, manage stations and alert thresholds, and retrieve daily summaries. Use when asked to check current temperature, view recent readings for a station, find the highest temperature recorded this week, dismiss an active alert, list which stations are online, or retrieve today's daily summary. Triggers include "current temperature", "sensor readings", "station status", "alert history", "daily summary", "wind speed", "humidity", "rainfall total", or any query about live or historical weather data.

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".

poll-builder

7
from heldernoid/agentic-build-templates

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.