ha-integration-patternsHome Assistant custom integration patterns and architectural decisions. Use when building HACS integrations, custom components, or API bridges for Home Assistant. Covers service response data, HTTP views, storage APIs, and integration architecture.
Install via ClawdBot CLI:
clawdbot install usimic/ha-integration-patternsBy default, HA services are "fire-and-forget" and return empty arrays [].
Register service with supports_response:
from homeassistant.helpers.service import SupportsResponse
hass.services.async_register(
domain,
"get_full_config",
handle_get_full_config,
schema=GET_CONFIG_SCHEMA,
supports_response=SupportsResponse.ONLY, # ā KEY PARAMETER
)
Call with ?return_response flag:
curl -X POST "$HA_URL/api/services/your_domain/get_full_config?return_response"
async def handle_get_full_config(hass: HomeAssistant, call: ServiceCall):
"""Handle the service call and return data."""
# ... your logic ...
return {"entities": entity_data, "automations": automation_data}
| Use Case | Use | Don't Use |
|----------|-----|-----------|
| Return complex data | HTTP View | Service (without response support) |
| Fire-and-forget actions | Service | HTTP View |
| Trigger automations | Service | HTTP View |
| Query state/config | HTTP View | Internal storage APIs |
For data retrieval APIs:
from homeassistant.components.http import HomeAssistantView
class OpenClawConfigView(HomeAssistantView):
"""HTTP view for retrieving config."""
url = "/api/openclaw/config"
name = "api:openclaw:config"
requires_auth = True
async def get(self, request):
hass = request.app["hass"]
config = await get_config_data(hass)
return json_response(config)
# Register in async_setup:
hass.http.register_view(OpenClawConfigView())
Never use underscore-prefixed APIs ā they're private and change between versions.
ā Wrong:
storage_collection = hass.data["_storage_collection"]
ā Right:
# Use public APIs only
from homeassistant.helpers.storage import Store
store = Store(hass, STORAGE_VERSION, STORAGE_KEY)
from homeassistant.helpers.storage import Store
STORAGE_KEY = "your_domain.storage"
STORAGE_VERSION = 1
store = Store(hass, STORAGE_VERSION, STORAGE_KEY)
# Save
data = {"entities": modified_entities}
await store.async_save(data)
# Load
data = await store.async_load()
Use external database or file storage, not HA storage helpers.
| Change | Version | Migration |
|--------|---------|-----------|
| Conversation agents | 2025.x+ | Use async_process directly |
| Service response data | 2023.7+ | Add supports_response param |
| Config entry migration | 2022.x+ | Use async_migrate_entry |
Always check: https://www.home-assistant.io/blog/ for your target version range.
custom_components/your_domain/
āāā __init__.py # async_setup_entry
āāā config_flow.py # UI configuration
āāā manifest.json # Dependencies, version
āāā services.yaml # Service definitions
āāā storage_services.py # Your storage logic
{
"domain": "your_domain",
"name": "Your Integration",
"codeowners": ["@yourusername"],
"config_flow": true,
"dependencies": [],
"requirements": [],
"version": "1.0.0"
}
?return_response)developers.home-assistant.io/docs/creating_integration_indexdevelopers.home-assistant.io/docs/dev_101_servicesdevelopers.home-assistant.io/docs/api/webserverhome-assistant.io/blog/ (filter by version)hacs.xyz/docs/publish/startFrom HA-OpenClaw Bridge attempt:
"80% of our issues were discoverable with 30-60 minutes of upfront docs reading. We jumped straight to coding based on assumptions rather than reading how HA actually works."
Use skills/pre-coding-research/ methodology before starting.
Generated Feb 23, 2026
A developer creating a custom Home Assistant integration to connect a proprietary IoT device, such as a smart lock or thermostat, using HACS. They need to implement service calls with response data for configuration retrieval and use HTTP views for status dashboards.
A consultant building a bridge between Home Assistant and a third-party API, like a weather service or energy management system, to automate actions based on external data. They require storage patterns for caching and avoid internal APIs to ensure compatibility.
A maintainer updating an existing HACS integration to support new Home Assistant versions, focusing on migrating from deprecated APIs to public ones and adding service response support for better user feedback.
A manager implementing Home Assistant for monitoring and controlling building systems, such as lighting or HVAC, across multiple locations. They use HTTP views for centralized data access and follow storage patterns for configuration persistence.
A hobbyist creating a custom component to integrate niche hardware, like a 3D printer or garden sensor, into Home Assistant. They rely on the skill's patterns for service responses and avoid common pitfalls with internal APIs.
Offer a basic free version of a HACS integration with core features, and charge for premium add-ons like advanced analytics, priority support, or custom HTTP views. Revenue comes from one-time purchases or subscriptions via platforms like GitHub Sponsors.
Provide paid services to businesses or individuals for building, optimizing, or troubleshooting Home Assistant integrations. This includes code reviews, migration assistance, and implementation of patterns like storage APIs and service responses.
Develop a cloud-based service that acts as a bridge between Home Assistant and external APIs, handling authentication, data syncing, and storage. Monetize through API usage tiers or enterprise licenses for large-scale deployments.
š¬ Integration Tip
Always use public APIs like Store for storage and register services with supports_response for data returns; avoid underscore-prefixed internal APIs to prevent breaking changes.
Use the mcporter CLI to list, configure, auth, and call MCP servers/tools directly (HTTP or stdio), including ad-hoc servers, config edits, and CLI/type generation.
Connect to 100+ APIs (Google Workspace, Microsoft 365, GitHub, Notion, Slack, Airtable, HubSpot, etc.) with managed OAuth. Use this skill when users want to...
Build, debug, and deploy websites using HTML, CSS, JavaScript, and modern frameworks following production best practices.
YouTube Data API integration with managed OAuth. Search videos, manage playlists, access channel data, and interact with comments. Use this skill when users want to interact with YouTube. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Scaffold, test, document, and debug REST and GraphQL APIs. Use when the user needs to create API endpoints, write integration tests, generate OpenAPI specs, test with curl, mock APIs, or troubleshoot HTTP issues.
Search for jobs across LinkedIn, Indeed, Glassdoor, ZipRecruiter, Google Jobs, Bayt, Naukri, and BDJobs using the JobSpy MCP server.