Home Assistant API
Home Assistant API
Home Assistant API is the local control interface for the open-source smart home platform — device states, automations, scenes, cross-vendor integrations (2500+ integrations).
Fully open-source (Apache 2.0)
Must self-host server (Raspberry Pi or NUC)
Run local Home Assistant instance. Profile → create long-lived access token. GET http://homeassistant.local:8123/api/states -H "Authorization: Bearer ..."
Uptime · 30-day window
About this API
Home Assistant is an open-source smart home platform launched 2013, the de-facto open-source standard in this space. Unlike Apple HomeKit / Google Home / Amazon Alexa closed-source single-vendor solutions, Home Assistant's philosophy is "neutral hub" — integrating 2500+ vendor devices (Philips Hue lights, Xiaomi appliances, IKEA Trådfri, Sonos speakers, Ring doorbells, Tesla charging, Apple HomeKit devices, nearly all Z-Wave / Zigbee devices), abstracting different-protocol devices into unified entities, then running Python-written automation rules (condition triggers, timers, state machines). Local-first — no cloud dependency (devices work normally if your home internet is down); users run a Raspberry Pi or NUC at home as server. API lets developers integrate Home Assistant into their apps or write custom scripts. vs. single smart home brand cloud APIs, Home Assistant provides vendor-neutral unified interface for "whole-home智能".
What you can build
- 1Self-built smart home hub (not locked to one brand)
- 2Integrate multi-vendor devices (Philips Hue + Xiaomi + Alexa + Apple HomeKit)
- 3Custom automation ("auto-on lights at sunset")
- 4Voice assistant integration (NLP "turn off living room light" to API)
Strengths & limitations
Strengths
- Fully open-source (Apache 2.0)
- Broadest device compatibility (2500+ vendors)
- Local-first (no cloud dependency)
- Extremely active community
Limitations
- Must self-host server (Raspberry Pi or NUC)
- Learning curve to start (not consumer plug-and-play)
Example request
curl https://www.home-assistant.io/<endpoint> \
-H "Authorization: Bearer $ACCESS_TOKEN"Getting started
Run local Home Assistant instance. Profile → create long-lived access token. GET http://homeassistant.local:8123/api/states -H "Authorization: Bearer ..."
FAQ
Home Assistant and Apple HomeKit relationship?+
Home Assistant fully integrates HomeKit devices (even exports its own devices to appear in HomeKit). Not mutually exclusive — can coexist.
Technical details
- Auth type
- jwt
- Pricing
- free
- Rate limit
- 本地运行无 rate limit
- Protocols
- REST, WebSocket
- SDKs
- python, javascript, go