📄 api-today-implementation.md 2,821 bytes Apr 28, 2026 📋 Raw

/api/today Endpoint — Implementation Summary

Status: ✅ Module built and tested
Location: /home/hoffmann_admin/.openclaw/workspace/services/icarus/core/today.py
Route: Added to core/api.py as GET /api/today

Response Shape

{
  "calendar": {
    "status": "ok",
    "events": [
      {
        "summary": "Sully Baseball",
        "start": "2026-04-28T15:30:00-05:00",
        "end": "2026-04-28T17:00:00-05:00",
        "location": "Heritage Park Field 3",
        "is_all_day": false
      }
    ]
  },
  "weather": {
    "status": "ok",
    "current": {
      "temperature_f": 58.0,
      "feels_like_f": 55.0,
      "condition": "Partly cloudy",
      "humidity_pct": 55,
      "wind_mph": 16.0
    },
    "forecast": [
      {
        "hour": "15:00",
        "temperature_f": 58.0,
        "precipitation_chance_pct": 0
      }
    ]
  },
  "health": {
    "overall_status": "healthy",
    "components": {
      "openclaw_gateway": {"status": "ok", "latency_ms": 4},
      "radicale_caldav": {"status": "ok", "latency_ms": 2},
      "ollama_local": {"status": "ok", "latency_ms": 2},
      "cloudflare_tunnel": {"status": "ok", "latency_ms": 109}
    },
    "disk_usage": {
      "total_gb": 467.3,
      "used_gb": 50.7,
      "usage_pct": 10.8
    }
  },
  "generated_at": "2026-04-28T22:10:00+00:00"
}

Data Sources

Field Source Config
Calendar Radicale CalDAV RADICALE_URL, RADICALE_USER, RADICALE_PASS env vars
Weather wttr.in (no API key) WEATHER_LOCATION env var (default: "Green Bay, WI")
Health Live ping to services Hardcoded endpoints, auto-detect status

Known Issue

The API module has a package import conflict — the codebase uses from icarus.core... imports but the package isn't properly registered in Python path during development. The today.py module itself works (tested), but the full FastAPI app won't start without fixing all imports.

Fix needed: Either:
1. Add __init__.py files and install with pip install -e . properly
2. Or replace all from icarus.core... with from core... throughout the codebase

Next Steps for Daedalus

  1. Confirm the JSON shape above matches what your template expects
  2. Test endpoint — once the import issue is resolved, hit GET /api/today
  3. HTMX polling — set hx-get="/api/today" hx-trigger="every 30s"
  4. Error handling — if any service is down, status will be "error" with an error field

CSS Deploy

Static files copied:
- dashboard.css/home/hoffmann_admin/.openclaw/workspace/services/icarus/static/dashboard.css
- system-state.css/home/hoffmann_admin/.openclaw/workspace/services/icarus/static/system-state.css

Served via FastAPI StaticFiles at /static/