openhome

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 · PathDescription
GET /health{status, service, uptime, model, devices} — always open.
GET /events/recentRecent event‑bus events.

Agent (voice & text)

Method · PathDescription
POST /agentBody {text} → {reply, actions, understood}. The conversational brain (home control + web search + cooking).
POST /agent/audioBody with base64 audio → transcribes, then runs the agent. Needs a Gemini key for STT.

Devices & scenes

Method · PathDescription
GET /devicesAll devices + summary (real onboarded + mock).
GET /homeFull home snapshot.
GET /scenesList scenes.
POST /scenesBody {id} → activate a scene.
POST /deviceBody {id, patch} → set one device.

Lights

Method · PathDescription
GET /lights/discover?backend=esphomeDiscover onboardable lights.
POST /lights/commandOnboard / control a real light (see Devices).

Audio / music

Method · PathDescription
GET /speakersSpeakers + zones.
GET /audio/stateCurrent audio state.
GET /audio/outputsPipeWire output router status.
GET /audio/spotify/search?q=Search Spotify.
GET /audio/spotify/login → …/callbackSpotify OAuth.
`GET /audio/spotify/me \playlists \liked \top`Account data.

Climate

Method · PathDescription
GET /climate*Thermostat/climate device state and control.

Recipes & cooking

Method · PathDescription
GET /recipesList 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/stateCurrent 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/historyPast 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