Commit Graph
45 Commits
Author SHA1 Message Date
Nate EmmertandClaude Sonnet 5.5 2efc945192 Radar: switch to RainViewer (IEM blocks heavy tile use), cleaner Map tab
Publish Container / publish (push) Successful in 2m40s
- /api/radar/times serves RainViewer frames (cached 2 min), IEM NEXRAD only as fallback;
  sources honour maxNativeZoom so tiles overzoom instead of going blank
- Map tab opens with radar + location dot only; wind/AQI/alerts/temp/sun/lightning are opt-in,
  readout chips follow their toggles
- Bolder location dot
- Satellite (GIBS) layer: new storage key, never persisted by storm taps, radar always draws above it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 16:38:00 -04:00
Nate EmmertandClaude Sonnet 5.5 0cbebfef2a Cache-proof asset URLs and inline iOS touch icon
Publish Container / publish (push) Successful in 2m42s
A reverse proxy in front of the app serves stale copies of static files for hours (live app.js and
sw.js were old next to new HTML). iOS also showed a letter tile (N / S) because its separate
icon download failed.

- HTML pages are served through a versioner: every local script/stylesheet/icon/manifest gets a
  content-hash query (app.js?v=…), so any change is a URL no proxy or phone has cached
- Service worker URL versioned too; SW offline lookups tolerate the query string; cache v15
- The 180px apple-touch-icon is embedded in each page as a data: URI, so the Home Screen icon
  no longer depends on a second network request

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 14:33:40 -04:00
Nate EmmertandClaude Sonnet 5.5 f21c91527c Serve PWA icons from fresh /icons/v2/ URLs with every iOS size
Publish Container / publish (push) Successful in 2m43s
iOS showed a letter tile ('N') when adding to the Home Screen. The live files were fine, but a
reverse proxy in front of the app serves static files with a long cache lifetime (live icon.svg
and sw.js were stale) and iOS remembers a failed icon per URL.

- New versioned URLs no proxy/phone has cached; old paths kept for existing installs
- apple-touch-icon declared at 180/167/152/120 (opaque 8-bit RGB PNGs) for app and dashboard
- 180px icon also listed in both manifests; notification icons and root fallbacks use v2
- Service worker cache bumped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 14:22:05 -04:00
Nate EmmertandClaude Sonnet 5.5 19479daece Dashboard pages: iOS icon + Home Screen title everywhere; root icon fallbacks
Publish Container / publish (push) Successful in 2m11s
- setup/recover/settings pages now declare the dashboard touch icon and 'Station' title
- /apple-touch-icon.png, /apple-touch-icon-precomposed.png and /favicon.ico serve real icons
  (iOS falls back to these when a page declares none; they used to 404/204)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 14:15:19 -04:00
Nate EmmertandClaude Sonnet 5.5 72a4a3fe38 Alerts tab: fix hurricane/tropical storm bugs; rich alert cards matching the dashboard
Publish Container / publish (push) Successful in 2m44s
Hurricane / tropical storm fixes
- NHC intensity is in knots: show real mph (80 kt = 92 mph) instead of mislabelled 'mph'
- Real Saffir-Simpson category from wind (was always cat 1); subtropical, post-tropical and
  potential-cyclone types no longer shown as 'depression'; each storm shows movement
  (direction + mph, previously a non-existent field), distance from you, update time, advisory link
- Forecast track points coloured by their own forecast strength (not the current class)
- Map click handlers registered once (popups stacked on every refresh); overlays wait for the
  map to settle instead of silently not drawing while tiles load; stale renders superseded
- Subtropical/tropical advice added to alert guidance; escaped storm names

Alert cards (active alerts only)
- What it's for, area, window, time remaining, plain-language meaning, what to do, and a
  Full details expander (headline, text, instructions, severity/urgency/certainty, issuer)
- No longer drops alerts beyond 6 per severity group; expired alerts are filtered out
- Shared plain-language alert glossary (alert-info.js, 64 products incl. tropical and surge)
  now used by both the app and the dashboard history

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 14:00:41 -04:00
Nate EmmertandClaude Sonnet 5.5 acdcd6a2c5 Log official NWS observations for a reference ZIP and overlay them on the dashboard
Publish Container / publish (push) Successful in 2m33s
- Resolves ZIP (default 24550) to the nearest NWS observation station; logs every observation
  (normalised imperial values + raw METAR), back-fills ~7 days, snapshots the hourly forecast
  every 3h, and logs alerts for that point
- Chart overlay (temp, humidity/dew point, wind, pressure) with an NWS toggle in the History bar
- 'Official NWS observation' card on the Now tab comparing against your station
- Settings: change the reference ZIP and see logging status
- Exact-unit conversions for NWS values (verified against known conversions)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 13:41:02 -04:00
Nate EmmertandClaude Sonnet 5.5 114386a1b2 Alert history: say what each alert is for, where, and when
Publish Container / publish (push) Successful in 3m33s
- Plain-language meaning for common NWS products, shown in the row and expanded view
- Details column: reason, area, severity, effective window; click for full text/instructions
- New alerts log area, severity, urgency, certainty and sender
- Older entries are filled in from NWS by alert id (cached in data/alert-details.json);
  alerts NWS no longer serves fall back to the built-in meaning

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 13:28:28 -04:00
Nate EmmertandClaude Sonnet 5.5 72d813bd61 Records: month and year records with the period as the headline
Publish Container / publish (push) Successful in 3m55s
- Wettest/driest/hottest/coldest/windiest month and wettest/hottest/coldest/windiest year,
  each naming the period (e.g. 'September 2026') and flagging partial periods
- Average-based records prefer complete periods; counterparts say what they're waiting for
- 'Records by calendar month (any year)' table with the date/year of each record

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 13:21:55 -04:00
Nate EmmertandClaude Sonnet 5.5 00336c6ce1 Add 'All' history range to the dashboard and pressure tendency chart
Publish Container / publish (push) Successful in 2m45s
- /api/station/history?range=all returns everything on disk, bucketed (cached 60s)
- Year-aware axis labels for 1y/2y/3y/All
- Pressure tendency widens its change window to the bucket size on long ranges and says so

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 13:17:33 -04:00
Nate EmmertandClaude Sonnet 5.5 2fb467d2e5 Weather proxy: fall back to the classic request if 15-minute data is rejected
Publish Container / publish (push) Successful in 3m19s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:56:31 -04:00
Nate EmmertandClaude Sonnet 5.5 fd61e35b56 Redesign main app: slim top bar, dynamic sky hero, nowcast, scrub chart, unified palette
- One slate/blue palette across the app, dashboard, account/login pages (data colours
  stay orange = warm, blue = cool on the dashboard)
- Slim sticky top bar with location chip, gear (settings) and ? (learn); 4-tab nav
  (Now, Station, Map, Alerts) with a thumb-reach bottom bar on phones
- Hero sky gradient by condition/time with rain, storm, snow and star effects
  (respects reduced motion); keeps the searched city and badges when temps come from your station
- One-line summary, 'Next 2 hours' bars and rain countdown from 15-minute precipitation,
  rain/cold-aware 'Bring' chips; yesterday + 'vs usual' context from the station
- Scrubbable hourly chart (temp, rain chance, wind), 7-day range bars, AQI gauge,
  details tiles instead of drawers, taller radar with location marker + alert polygons
- Skeleton loading instead of a full-screen spinner, sticky section headers, safe areas
- Server: minutely_15 precipitation, public /api/station/summary

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:56:18 -04:00
Nate EmmertandClaude Sonnet 5.5 1830fb2e2b Merge /conditions into the app as a Station tab
- New Station tab (top tabs, bottom nav, swipe order) carrying the old /conditions look:
  radar-ring hero, condition pill, wind compass, atmosphere/precip/solar cards, indoor
- Scoped sl-* styles and station-live.js; units follow the app's metric/imperial setting
- Empty/error states when no station is connected
- /conditions now 301-redirects to /?tab=station; removed conditions.html,
  /api/conditions/public and the old My Station drawer
- /api/ambient-config also returns the station name
- Dashboard and settings links updated; SW cache v8; manifest shortcut for Station
- Drops an indoor-temp block in applyStationOverlay that referenced an out-of-scope helper

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:45:47 -04:00
Nate EmmertandClaude Sonnet 5.5 7dea2734ea Sessions: 180-day lifetime with sliding renewal
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:40:15 -04:00
Nate EmmertandClaude Sonnet 5.5 1566ac2897 Add user management with admin and viewer roles
- data/users.json store; existing single account migrates to first admin
- Roles: admin (settings, import, users) and viewer (read-only, own password)
- Live role/disabled lookup; per-user session epoch so password changes,
  resets and disabling sign that user out everywhere
- Login brute-force lockout (5 fails -> 5 min), constant-time unknown-user check
- /api/users CRUD with last-admin and self-lockout safeguards
- Account page (own password + admin user management); role-aware header
- Min password length 8; recovery token resets the primary admin and clears lockouts

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:34:13 -04:00
Nate EmmertandClaude Sonnet 5.5 1ad2dbb860 Redesign dashboard: tabs, insights, rain, sun/moon, zoomable charts
- Tab bar (bottom nav on phones) splitting Now / Charts / Rain / Records / Insights
- Unified tiles with vs-yesterday deltas, hero 24h trace, wind compass, today hi/lo
- Highlights chips, sun & moon card, station health card
- Charts: min/max envelope for long ranges (server-side bucketing), pinch/wheel zoom,
  pressure tendency, indoor vs outdoor, clear-sky solar overlay
- Rain tab: daily + cumulative, monthly totals; calendar heatmaps (temp/rain/gust)
- Insights: period trends, station normals, diurnal range, coverage, seasonal wind roses
- Server: /api/station/daily, history ?points= bucketing, 2d range, daily avg + wind
  histogram aggregates; fix dry days never recording rain=0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:25:08 -04:00
Nate EmmertandClaude Sonnet 5.5 a97d104d14 Persistent station records, backups, and iPhone-friendly dashboard
- Keep per-day extremes in data/records.json (merge-only) and derive all-time,
  notable-day, monthly and yearly records from it; rebuild from raw files at startup
- Use station maxdailygust for true gust extremes
- Add /api/station/backup.jsonl, records-backup.json and records/rebuild
- Dashboard: safe-area insets, 44px touch targets, scrollable nav/range bars,
  chart touch-action, standalone PWA manifest + apple meta tags

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:14:25 -04:00
Nate EmmertandClaude Sonnet 5.5 4c2c619fb6 Dedupe station readings and group rain stats by local day
- Share a disk-backed per-day dateutc set between live recorder and backfill
- Validate timestamps before saving; dedupe existing files at startup and on read
- Use station-local day (not UTC) for rain totals, streaks, degree days and
  monthly summary so dailyrainin resets line up (Sept rain was 4.37in vs 2.24in)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 12:10:11 -04:00
Nate EmmertandClaude Sonnet 5.5 528dec753d Make dashboard alerts short with click-to-expand full details
Publish Container / publish (push) Successful in 2m50s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-30 11:45:50 -04:00
Nate EmmertandClaude Sonnet 4.6 3af4c1df4b Add NHC forecast track to hurricane click-to-map
Publish Container / publish (push) Successful in 2m6s
- Parse NHC forecast advisory text (FORECAST VALID / OUTLOOK VALID lines)
  to extract real forecast positions at 9–117h intervals with wind speeds
- Render forecast track as dashed line + clickable dots (wind on click)
- Auto-fit map bounds to show the full 5-day track after loading
- Fix buildStyle to use OpenFreeMap vector tile URLs without API key

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 10:11:22 -04:00
Nate EmmertandClaude Sonnet 4.6 8b9d3639af Fix map basemap tiles and add hurricane click-to-map feature
Publish Container / publish (push) Successful in 2m18s
- Replace CARTO basemap tiles (now require API key) with OpenFreeMap
  vector tiles (positron for light, liberty for dark) — no key needed
- Add click handlers on hurricane panel cards to fly to storm on map
- Add flyToHurricane(): switches to map tab, enables hurricane overlay,
  flies to storm coords, shows popup with storm details
- Add /api/hurricanes/track proxy to fetch NHC GIS 5-day forecast track
  line and render it as a dashed overlay on the map

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 09:52:35 -04:00
Nate EmmertandClaude Sonnet 4.6 de9cb41d8b Log NWS alerts to history regardless of push subscribers
Publish Container / publish (push) Successful in 2m55s
The alert history log was only populated inside the subscriber loop,
so it stayed empty when no push subscriptions existed. Now the cron
always checks and logs active NWS alerts for the dashboard location
before the subscriber early-return.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 08:37:14 -04:00
Nate EmmertandClaude Sonnet 4.6 5f7e490a6e Fix NWS alerts not showing when no location is configured
Publish Container / publish (push) Successful in 1m55s
- Show a prompt linking to Settings instead of silently hiding the
  alerts section when no lat/lon is saved
- Clear the alert cache when location is saved so alerts appear
  immediately without waiting for the 5-minute cache to expire

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 08:20:31 -04:00
Nate EmmertandClaude Sonnet 4.6 47f60e72f7 Move all settings to dedicated /dashboard/settings page
Publish Container / publish (push) Successful in 2m22s
Extracts API keys, alert thresholds, station name/location, data
export/import, and password change into a standalone settings page.
Dashboard gains a Settings nav link; the accordion at the bottom
is removed along with its now-orphaned JS and CSS.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 08:08:16 -04:00
Nate EmmertandClaude Sonnet 4.6 97dfae86ab Add alert history dashboard endpoint and UI panel
Publish Container / publish (push) Successful in 2m33s
GET /api/dashboard/alert-history?days=N reads daily .jsonl files from
data/alerts/ and returns entries newest-first. Dashboard gets a lazy-loaded
collapsible panel with a table showing time, type (NWS/threshold badge),
event name, and details, with 7d/30d/90d range selector.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 08:01:41 -04:00
Nate EmmertandClaude Sonnet 4.6 926f280a28 Add persistent alert history log to data/alerts/
Publish Container / publish (push) Successful in 2m55s
NWS alerts and all threshold firings are now appended to daily .jsonl
files in data/alerts/ (same pattern as data/station/). NWS alerts are
deduplicated by alert ID across subscribers to avoid duplicate log lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-02 07:59:58 -04:00
Nate EmmertandClaude Sonnet 4.6 e133781760 Remove thermostat/indoor sensor integration
Ecobee API is closed to new developer registrations and iOS sub-daily
automations are no longer available, making the HomeKit push approach
unworkable. Removes all related code:

- server.js: HomeKit push endpoints, token management, data files
- dashboard.html: thermostat section card, indoor stat tiles, indoor
  charts, HomeKit settings panel, HVAC badge CSS, all related JS
- index.html: Indoor Temp stat card
- app.js: indoor sensor display logic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-24 09:19:21 -04:00
nmemmertandClaude 5eae872773 Accept GET query params on HomeKit push endpoint (#6)
* Add Ecobee thermostat integration to dashboard

- Server: PIN-based OAuth flow to authorize Ecobee access without
  exposing redirect URIs; tokens stored server-side and auto-refreshed
- Server: /api/ecobee/config, /api/ecobee/auth/pin,
  /api/ecobee/auth/complete, /api/ecobee/data, /api/ecobee/runtime
  endpoints behind dashboard auth
- Dashboard: Ecobee section card showing indoor temp, humidity,
  heat/cool setpoints, HVAC mode, equipment status badge, and
  per-sensor temperature readings from remote sensors
- Dashboard: stacked bar chart of daily heating/cooling runtime hours
  for the past 7 days
- Dashboard: Ecobee setup panel with API key entry and step-by-step
  PIN authorization flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMhuFaecxraQzUPN4h9nsB

* Replace ecobee API integration with HomeKit push endpoint

Ecobee removed public developer API access, so pivot to HomeKit:
- Add POST /api/homekit/push accepting thermostat data from iOS Shortcuts
- Add GET /api/homekit/data returning latest reading to dashboard
- Add GET /api/homekit/config and POST /api/homekit/config/regenerate for token management
- Auto-generate auth token on first run, persist to data/homekit-config.json
- Auto-convert Celsius→Fahrenheit if temp < 50 (HomeKit always returns Celsius)
- Update dashboard section card to show temp, setpoints, humidity, mode, HVAC state
- Replace ecobee settings panel with push URL, token copy, and Shortcut setup instructions
- Remove runtime chart (not available without API access)

* Support GET query params on homekit push endpoint for iOS Shortcuts compatibility

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-23 12:40:52 -04:00
nmemmertandClaude e8bb117568 Add thermostat integration via HomeKit push (iOS Shortcuts) (#5)
* Add Ecobee thermostat integration to dashboard

- Server: PIN-based OAuth flow to authorize Ecobee access without
  exposing redirect URIs; tokens stored server-side and auto-refreshed
- Server: /api/ecobee/config, /api/ecobee/auth/pin,
  /api/ecobee/auth/complete, /api/ecobee/data, /api/ecobee/runtime
  endpoints behind dashboard auth
- Dashboard: Ecobee section card showing indoor temp, humidity,
  heat/cool setpoints, HVAC mode, equipment status badge, and
  per-sensor temperature readings from remote sensors
- Dashboard: stacked bar chart of daily heating/cooling runtime hours
  for the past 7 days
- Dashboard: Ecobee setup panel with API key entry and step-by-step
  PIN authorization flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMhuFaecxraQzUPN4h9nsB

* Replace ecobee API integration with HomeKit push endpoint

Ecobee removed public developer API access, so pivot to HomeKit:
- Add POST /api/homekit/push accepting thermostat data from iOS Shortcuts
- Add GET /api/homekit/data returning latest reading to dashboard
- Add GET /api/homekit/config and POST /api/homekit/config/regenerate for token management
- Auto-generate auth token on first run, persist to data/homekit-config.json
- Auto-convert Celsius→Fahrenheit if temp < 50 (HomeKit always returns Celsius)
- Update dashboard section card to show temp, setpoints, humidity, mode, HVAC state
- Replace ecobee settings panel with push URL, token copy, and Shortcut setup instructions
- Remove runtime chart (not available without API access)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-23 08:24:14 -04:00
Nate EmmertandClaude Sonnet 4.6 a535721bf8 Add NWS alerts, dry/wet streak, and indoor sensor support to dashboard
- NWS active alerts shown as color-coded cards at top of dashboard (5-min cache), auto-refresh every 5 min
- Station location (lat/lon) configurable in settings; falls back to push subscription coordinates
- Consecutive dry/wet streak tile in extended stats (60-day lookback, 0.01" rain threshold)
- Indoor sensor tiles (Temp In, Humidity In, Dew Point In) auto-show when station reports tempinf/humidityin
- Indoor temperature and humidity history charts when indoor data is present in selected range

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-20 08:42:33 -04:00
Nate EmmertandClaude Sonnet 4.6 e851fd1ca0 Add station alerts, dashboard analytics, and settings improvements
Alerts (server):
- Station temp high/low threshold alerts via push + ntfy
- Freeze warning at ≤34°F (station reading)
- Station wind gust threshold alert from real readings
- Station offline alert when no data for >20 min (auto-clears on reconnect)

Dashboard:
- Trend arrows (▲/▼/–) on temp, humidity, dew, wind, pressure, UV, solar tiles
  comparing current vs 1h ago via new /api/station/trend endpoint
- Offline banner when station last reported >15 min ago
- Monthly summary table (avg temp, high temp, max gust, total rain, readings)
- Temperature calendar heatmap — GitHub-style year grid, blue→orange scale
- Alert threshold settings UI: temp high/low, wind gust, rain rate
  saved to all push subscriptions via new /api/subscriptions/thresholds
- Station name setting — persisted in auth file, served on conditions page
- Change password form in settings (no recovery flow needed)

Server:
- GET/POST /api/dashboard/station-name
- POST /api/dashboard/change-password
- GET /api/station/monthly-summary
- GET /api/station/trend
- GET /api/subscriptions, POST /api/subscriptions/thresholds
- /api/conditions/public includes stationName field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 15:14:35 -04:00
Nate EmmertandClaude Sonnet 4.6 beb627830f Add dashboard password recovery via daily server-log token
- getDailyRecoveryToken(): HMAC of SESSION_SECRET + current day — changes
  every 24h, requires no extra storage
- Logs token to console on startup (visible in CasaOS container logs)
- GET/POST /dashboard/recover: validates token, sets new password
- dashboard-recover.html: enter token + new password, with instructions
- dashboard-login.html: 'Forgot password?' link + success message after recovery

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 15:05:44 -04:00
Nate EmmertandClaude Sonnet 4.6 7665146b44 Add dashboard analytics, public conditions page, and station data features
- Dashboard: account-protected station data recorder with PBKDF2 auth and
  HMAC-signed sessions; Chart.js time-series charts with 1h–3y range selectors;
  wind rose canvas; auto-refresh every 2 min; 1-min polling cron
- Analytics endpoints: all-time records, rain totals (7d/30d/YTD), heating/cooling
  degree days, CSV export, year-over-year overlay, hourly anomaly detection
- Dashboard UI: pressure trend arrow, rain tile row, HDD/CDD tiles, anomaly tile,
  YoY toggle, collapsible records panel, CSV export, backfill progress bar
- Public conditions page at /conditions (no auth) with auto-refresh every 2 min
- Rain rate push alert via web-push and ntfy when threshold exceeded
- Station data stored as per-day JSONL files; backfill imports up to 1yr from Ambient

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 14:26:51 -04:00
Nate EmmertandClaude Sonnet 4.6 46e927370a Add Ambient historical data backfill to dashboard
- POST /api/station/backfill: pages backward through Ambient's historical API
  at 1 req/sec, deduplicates against existing JSONL records, writes to daily files
- GET /api/station/backfill/status: polls live progress (days done, readings inserted)
- Dashboard settings panel: day-range selector (7d/30d/90d/180d/1y), Import button,
  progress bar with live count; auto-reloads charts when complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 14:02:27 -04:00
Nate EmmertandClaude Sonnet 4.6 4aca8df808 Add API key settings panel to dashboard
- Station API Keys section at bottom of dashboard (auto-opens if unconfigured)
- Shows configured/missing status on load
- Fields for Ambient API Key and Application Key; saves via existing endpoint
- POST /api/ambient-config now requires dashboard auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 13:39:27 -04:00
Nate EmmertandClaude Sonnet 4.6 fa4895a741 Add station dashboard with auth and historical data recording
- Protected /dashboard route with PBKDF2 password + HMAC-signed cookies
- First-run setup flow at /dashboard/setup
- Records Ambient station readings to daily JSONL files in app/data/station/
- Deduplicates on dateutc so 1-min polling never writes duplicate rows
- Dashboard charts: temp, humidity/dew, wind+gusts, wind rose, pressure,
  rain rate, rain accumulation, UV, solar radiation
- History range selector: 1h / 6h / 24h / 7d / 30d / 90d / 1y / 2y / 3y
- Auto-downsamples to 720 points for long ranges
- Cron interval changed from 10 min to 1 min (with dedup guard)
- app/data/ added to .gitignore (contains keys and session secret)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 13:32:18 -04:00
Nate EmmertandClaude Sonnet 4.6 fdc374b8bd Use Ambient station readings for wind/temp threshold alerts in cron
When station keys are configured and the last reading is < 15 min old,
the alert cron uses windgustmph and tempf from the station instead of
Open-Meteo model values. AQI still comes from Open-Meteo (no station
equivalent). Alert bodies now include "(station)" or "(forecast model)"
so the source is visible in the notification.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-19 12:19:29 -04:00
Claude 0005698264 Use station data for current conditions; persist keys server-side
Station overlay:
- When Ambient Weather station data is present and fresh (<15 min),
  its readings replace the model's current conditions: temp, feels-like,
  humidity, dewpoint, wind speed/direction, gusts, pressure (inHg→hPa),
  UV index, rain today, wind peek summary, and data-panel readouts
- A small "📡 My Station" badge appears in the hero when active
- applyStationOverlay() is called at the end of renderWeather (instant
  if station data already loaded) and again whenever station data
  refreshes (so the display stays live every 60 s)
- Hourly/daily forecasts continue to use Open-Meteo

Server-side key persistence:
- POST /api/ambient-config saves keys to data/ambient-config.json
  (same persistent volume as VAPID and subscriptions)
- GET /api/ambient-config returns {configured: bool} without exposing keys
- /api/ambient checks query params → saved config → env vars in order
- Settings Save button posts keys to server after a successful test;
  confirms "saved for all devices" in the status line
- On page load, if no localStorage keys but server is configured,
  the station loads automatically on any device
2026-08-19 15:53:10 +00:00
nmemmertandClaude b9e2b463f5 Add Ambient Weather personal station integration
* Add Ambient Weather personal station integration

Fetches live data from the user's Ambient Weather station via their
REST API and displays it as a "My Station" card in the conditions tab.

- server.js: add /api/ambient endpoint with 60s cache using
  AMBIENT_API_KEY and AMBIENT_APP_KEY env vars
- docker-compose.yml: expose AMBIENT_API_KEY/AMBIENT_APP_KEY env vars
- index.html: add collapsible "My Station" drawer to conditions tab
  showing temp, humidity, wind, gusts, daily rain, pressure, UV,
  solar radiation, and indoor readings
- app.js: add fetchAmbientStation() and renderAmbientStation(),
  auto-refresh every 60s, peek text summary in drawer header
- style.css: station drawer styles
- .gitignore: add .env so API keys stay off git

Co-Authored-By: Claude <noreply@anthropic.com>

* Move Ambient Weather keys to Settings panel

Users can now enter their API Key and Application Key directly in the
Settings tab under "Ambient Weather Station". Keys are saved to
localStorage and sent per-request to the server proxy.

- index.html: add API Key + Application Key inputs with Save button
- app.js: persist keys in localStorage, populate inputs on load,
  wire Save button (validates by testing the connection), pass keys
  as query params in fetchAmbientStation and its auto-refresh loop
- server.js: accept apiKey/appKey from query params with env var
  fallback; cache keyed per-user so multiple callers don't collide

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-19 11:35:16 -04:00
Nate EmmertandClaude Sonnet 4.6 a25864d9ed Upgrade maps to MapLibre GL JS; compact header; move search to settings
- Replace Leaflet with MapLibre GL JS v4.7.1 across all map instances
- CARTO dark/light and Esri satellite raster basemaps (no API key)
- All overlays (hurricane, wildfire, SPC, wind arrows) ported to GeoJSON sources/layers
- AQI, alert, temp, sun/moon markers via maplibregl.Marker with custom HTML
- Radar animation pre-loads all frames on load for smoother playback
- Compact loc-header: tighter padding and font sizes, all info preserved
- Search bar moved from header to Settings tab under Location section
- Service worker bumped to weather-v7

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-14 11:04:32 -04:00
Nate Emmert 1863f6784b Fix XSS, validation, and CSS regressions; refactor proxy retry logic
- Sanitize geocode suggestion rendering to prevent XSS
- Add lat/lon validation and cache eviction to weather proxy endpoints
- Extract shared fetchWithRetry helper, dedupe retry/timeout logic
- Stop leaking upstream error details to clients
- Fix radar provider metadata and drop dead nowcast field
- Fix missing --surface-radius-sm var and duplicate/conflicting CSS rules
2026-06-15 08:51:18 -04:00
Nate Emmert 950e2708ab Enhance mobile UX: learn guide, alerts actions, and shareable weather cards 2026-03-17 14:21:32 -04:00
Nate Emmert 14995987ae Stabilize SW and cache headers to match backup behavior 2026-03-17 11:36:12 -04:00
Nate Emmert b242232e0c Fix geolocation and map rendering 2026-03-16 12:37:33 -04:00
Nate e4c631f9a8 Add lightning strikes and wind overlay toggles to Maps tab 2026-03-16 11:56:03 -04:00
Nate e397f11285 Initial commit 2026-03-16 09:40:48 -04:00