Bento House

6. Home Assistant link

GuideUpdated Nov 212 min read

On this page
  1. Decisions
  2. Prompt for Claude Code
  3. Checks

You get: a House card (doors, locks, garage, temperature) on the dashboard, and voice commands like "add eggs to the shopping list" through Home Assistant.

Skip this phase if you don't run Home Assistant.

Decisions

  • Two narrow links, one in each direction.
    • The app reads a few named Home Assistant entities with a long-lived access token. It never sends commands to Home Assistant.
    • Home Assistant calls one app endpoint for voice shopping, using a separate shared secret that only works for that endpoint.
  • Lists aren't read aloud. Voice can add and remove; it doesn't recite the list (anyone in the room would hear it).
  • Alerts go to phones. If you add house alerts, send them to phones, not speakers.

Prompt for Claude Code

Add a House card that reads a fixed list of Home Assistant entities (HA_URL,
HA_TOKEN and HA_ENTITIES in .env) through the Home Assistant REST API, every minute,
read-only. Show friendly names and states, highlight anything unlocked or open, and
show "Home Assistant unreachable" (with the last good time) if a call fails.

Add POST /api/voice/shopping that accepts {action: add|remove, item} with an
x-api-secret header checked against VOICE_API_SECRET (.env). This endpoint must not
accept the login cookie or anything else, and the secret must not work on any other
route. Record voice actions like chat ones so "undo" works.

Then give me the Home Assistant side: a rest_command that calls the endpoint, and
custom sentences "add {item} to the shopping list" / "remove {item} from the
shopping list" with an intent_script that calls it.

Checks

  • Open the garage (or a door): the House card shows it within a minute.
  • Say "add bananas to the shopping list" to your voice assistant: bananas appear.
  • curl the voice endpoint without the secret: refused.
  • curl another API route with the voice secret: refused.