Bridge Home Assistant entities to OpenApp
Many homes and small buildings already run Home Assistant for relays, garage doors, and sensors. OpenApp acts as a control plane on top: policies, guest invites, virtual intercom, and audit — while entity actions still drive your existing switch.garage_door (or similar) through the Home Assistant integration.
This guide is for integrators who want no rip-and-replace. Product setup: Home Assistant integration. Comparison: OpenApp + Home Assistant vs HA-only.
Architecture
Section titled “Architecture”Agent / SDK / Dashboard → OpenApp entity action (switchable.open) → Home Assistant integration → HA REST API → switch.garage_doorOne-time setup
Section titled “One-time setup”- Create a Home Assistant long-lived access token.
- In OpenApp, add integration provider type
home_assistantwithbase_urlandtoken. See Setup reference. - Create a device on that integration.
- For each controllable point, create an OpenApp entity with
external_idset to the Home Assistant entity id (e.g.switch.garage_door).
Open the bridged relay
Section titled “Open the bridged relay”SDK
await client.entities.by_id(entity_id).open()const res = await fetch( `${apiBase}/entities/${entityId}/actions/switchable.open`, { method: "POST", headers: { authorization: `Bearer ${apiKey}`, "content-type": "application/json", "x-org": orgId, }, body: JSON.stringify({}), },);if (!res.ok) throw new Error(`open failed: ${res.status}`);use openapp_sdk::Client;use serde_json::json;
let client = Client::builder() .api_key("https://api.openapp.house/api/v1_openapp_YOUR_SECRET") .build()?;
client .entities() .invoke_action(entity_id, "open", &json!({})) .await?;httpResp, err := client.EntitiesAPI.ExecuteEntityAction(ctx, entityID, "open"). Body(map[string]interface{}{}). Execute()if err != nil { return err}defer httpResp.Body.Close()HTTP API (curl)
export OPENAPP_API_BASE='https://api.openapp.house/api/v1'export OPENAPP_API_KEY='v1_openapp_YOUR_SECRET'export OPENAPP_ORG_ID='01HORG00000000000000000000'export ENTITY_ID='01HENTITY000000000000000000'
curl -sS -X POST \ -H "Authorization: Bearer ${OPENAPP_API_KEY}" \ -H "Content-Type: application/json" \ -H "X-Org: ${OPENAPP_ORG_ID}" \ -d '{}' \ "${OPENAPP_API_BASE}/entities/${ENTITY_ID}/actions/switchable.open"OpenApp must reach your HA instance (network, DNS, firewall).
What you gain vs HA alone
Section titled “What you gain vs HA alone”| HA alone | OpenApp + HA bridge |
|---|---|
| Automations in HA YAML | Same hardware + org-wide API, invites, intercom |
| Per-household silo | Multi-site orgs, roles, delegation |
| Ad-hoc guest access | Time-bound invites + public portal flows |
Agent tips
Section titled “Agent tips”- List entities on the integration to verify
external_idmapping before automating. - Handle 501 on unsupported actions — see Entities SDK.
- Do not expose HA tokens to LLM prompts; use server-side env vars.