Add Home Assistant integration for live entities #5

Closed
opened 2026-08-02 14:42:34 +00:00 by Mark · 1 comment
Owner

Problem: The editor currently only exports static YAML and uses hardcoded entity IDs in the seed data. There is no way to connect to a Home Assistant instance, browse real entities, and populate rooms from the live API.

Files to add/modify:

  • src/lib/ha-api.ts or similar API client.
  • src/hooks/useHomeAssistant.ts for connection state.
  • Add UI for connecting to HA (Long-Lived Access Token, URL).
  • Add entity picker in PropertiesPanel.

Acceptance criteria:

  • User can enter HA URL + token.
  • Entity picker fetches lights, climate, sensors, media players, switches.
  • Selected entities are stored in room state and exported in YAML.
  • Connection errors are surfaced in the UI.
  • Consider CORS / proxy options for local development.
**Problem:** The editor currently only exports static YAML and uses hardcoded entity IDs in the seed data. There is no way to connect to a Home Assistant instance, browse real entities, and populate rooms from the live API. **Files to add/modify:** - `src/lib/ha-api.ts` or similar API client. - `src/hooks/useHomeAssistant.ts` for connection state. - Add UI for connecting to HA (Long-Lived Access Token, URL). - Add entity picker in `PropertiesPanel`. **Acceptance criteria:** - User can enter HA URL + token. - Entity picker fetches lights, climate, sensors, media players, switches. - Selected entities are stored in room state and exported in YAML. - Connection errors are surfaced in the UI. - Consider CORS / proxy options for local development.
Author
Owner

Decomposed into 3 child issues, each scoped to one PR:

  • #8 — HA connection hook + Settings UI for URL + token (Slice 2 + 3: useHomeAssistant hook, SettingsDialog, localStorage persistence, toolbar error indicator).
  • #9 — Entity picker in PropertiesPanel + selected-entities room state (Slice 4 + 5: domain-grouped entity list, search/filter, room.haEntities[] schema, error banner).
  • #10 — YAML export wiring + CORS / proxy notes (Slice 6: YAML round-trip of ha_entities, README/docs/home-assistant.md CORS guidance referencing #6's nginx config, surface connection errors).

Slice 1 status: src/lib/ha-api.ts (the HA API client) is committed locally on this branch as 2c6a9c2 (alongside the #6 Docker work in 45b6056). It is the foundation all three children build on; the children each reference it directly and must land on top of it.

Closing this parent issue — the parent request becomes the three child issues listed above. Each child is sized for one PR and one triage card.

Decomposed into 3 child issues, each scoped to one PR: - #8 — HA connection hook + Settings UI for URL + token (Slice 2 + 3: `useHomeAssistant` hook, `SettingsDialog`, localStorage persistence, toolbar error indicator). - #9 — Entity picker in `PropertiesPanel` + selected-entities room state (Slice 4 + 5: domain-grouped entity list, search/filter, `room.haEntities[]` schema, error banner). - #10 — YAML export wiring + CORS / proxy notes (Slice 6: YAML round-trip of `ha_entities`, README/`docs/home-assistant.md` CORS guidance referencing #6's nginx config, surface connection errors). **Slice 1 status**: `src/lib/ha-api.ts` (the HA API client) is committed locally on this branch as `2c6a9c2` (alongside the #6 Docker work in `45b6056`). It is the foundation all three children build on; the children each reference it directly and must land on top of it. Closing this parent issue — the parent request becomes the three child issues listed above. Each child is sized for one PR and one triage card.
Mark closed this issue 2026-09-18 16:24:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/kimi_agent_home_assistant#5
No description provided.