API Reference
The hub exposes a same‑origin HTTP+JSON API on :4700 (HTTPS :4443). When
OPEN_HOME_PASSWORD is set, every endpoint except /health requires a valid
session cookie (see Security).
Conventions: JSON bodies, JSON responses. POST with `Content-Type:
application/json. All examples assume http://localhost:4700`.
System
| Method · Path | Description |
|---|
GET /health | {status, service, uptime, model, devices} — always open. |
GET /events/recent | Recent event‑bus events. |
Agent (voice & text)
| Method · Path | Description |
|---|
POST /agent | Body {text} → {reply, actions, understood}. The conversational brain (home control + web search + cooking). |
POST /agent/audio | Body with base64 audio → transcribes, then runs the agent. Needs a Gemini key for STT. |
Devices & scenes
| Method · Path | Description |
|---|
GET /devices | All devices + summary (real onboarded + mock). |
GET /home | Full home snapshot. |
GET /scenes | List scenes. |
POST /scenes | Body {id} → activate a scene. |
POST /device | Body {id, patch} → set one device. |
Lights
| Method · Path | Description |
|---|
GET /lights/discover?backend=esphome | Discover onboardable lights. |
POST /lights/command | Onboard / control a real light (see Devices). |
Audio / music
| Method · Path | Description |
|---|
GET /speakers | Speakers + zones. |
GET /audio/state | Current audio state. |
GET /audio/outputs | PipeWire output router status. |
GET /audio/spotify/search?q= | Search Spotify. |
GET /audio/spotify/login → …/callback | Spotify OAuth. |
| `GET /audio/spotify/me \ | playlists \ | liked \ | top` | Account data. |
Climate
| Method · Path | Description |
|---|
GET /climate* | Thermostat/climate device state and control. |
Recipes & cooking
| Method · Path | Description |
|---|
GET /recipes | List recipe summaries. |
GET /recipes/suggest?people=&diet=&max=&q= | Filtered suggestions. |
GET /recipes/:id?servings= | Full recipe, ingredients scaled. |
POST /cooking/start | {recipeId, servings} → start a session. |
GET /cooking/state | Current session + live timers. |
| `POST /cooking/next \ | /cooking/prev` | Step navigation. |
POST /cooking/goto | {step}. |
POST /cooking/timer | {label?, seconds?} (omit seconds → step's timer). |
| `POST /cooking/complete \ | /cooking/abandon` | End the session. |
GET /cooking/history | Past attempts. |
GET /cooking/stats?recipeId= | Started / finished / completion‑rate. |
App pages (HTML)
/ (Home), /control, /music, /lights, /speakers, /climate,
/cooking, /tv, /setup, /docs.
Example
# ask the agent
curl -s localhost:4700/agent -H 'content-type: application/json' \
-d '{"text":"turn the living room orange"}'
# suggest a vegan dinner for four
curl -s 'localhost:4700/recipes/suggest?people=4&diet=vegan&max=30'
Next: Cooking Agent · Configuration