Weather Api Waldron

Task Details
← Task Board

Task Description

# TASK: Wire Up Live Weather for Waldron Creek Bar Display

**Priority:** LOW
**Agent:** engineer
**Filed:** 2026-02-16
**Filed by:** Doug (via Claude Code session)

---

## Goal

The Waldron Creek Saloon beer display (TV on wall, Raspberry Pi kiosk) has weather animations built in (snow, rain, sun, clouds, blizzard). Currently it defaults to "light snow". Wire up the Open-Meteo API to show REAL current weather conditions.

## Current State
- **Display:** `farmiq.ai/tetonpass_beer/display.php` — STANDALONE file on 1920x1080 TV
- **Weather animations:** Already built. Test with `?weather=blizzard`, `?weather=rain`, etc.
- **Default:** Light snow animation
- **Location:** Choteau, Montana (47.8120, -110.4050)

## What Needs to Happen

### 1. Add Open-Meteo API call to display.php
Open-Meteo is FREE, no API key needed:
```
https://api.open-meteo.com/v1/forecast?latitude=47.812&longitude=-110.405&current_weather=true
```

Returns:
```json
{
  "current_weather": {
    "temperature": -5.2,
    "windspeed": 15.3,
    "weathercode": 71
  }
}
```

WMO Weather codes:
- 0-3: Clear/cloudy → "sun" or "clouds"
- 45-48: Fog → "clouds"
- 51-67: Rain/drizzle → "rain"
- 71-77: Snow → "snow"
- 80-82: Rain showers → "rain"
- 85-86: Snow showers → "snow"
- 95-99: Thunderstorm → "rain"

### 2. Map weather code to animation
Add a PHP or JS function that:
1. Fetches Open-Meteo on page load (or every 15 minutes via JS)
2. Maps the WMO weather code to the existing animation names
3. Also factor in wind speed (>40 km/h + snow = "blizzard")
4. Sets the weather animation accordingly

### 3. CRITICAL RULES
- **display.php is STANDALONE** — it does NOT include config.php
- Do NOT add `require_once 'config.php'` or any include that isn't already there
- If you need functions, define them INSIDE display.php
- Test by adding `?weather=auto` parameter that triggers the API lookup
- Keep `?weather=snow` etc. as manual overrides
- If the API call fails, fall back to "snow" (safe default for Montana)

### 4. Deploy
```bash
python /data/Sandbox/farmiq.ai/deploy.py --upload
```

### 5. Verify
The display URL is: https://farmiq.ai/tetonpass_beer/display.php
Test: https://farmiq.ai/tetonpass_beer/display.php?weather=auto

## DO NOT
- Do NOT touch the layout, fonts, or CSS of display.php — only add weather API logic
- Do NOT include config.php — display.php is standalone
- Do NOT use any paid weather APIs — Open-Meteo is free
- Do NOT break the existing manual weather overrides (?weather=snow still works)

Job Queue (0)

No job queue entries for this task yet