# Send Ha Integration Patterns to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "ha-integration-patterns",
    "name": "Ha Integration Patterns",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/usimic/ha-integration-patterns",
    "canonicalUrl": "https://clawhub.ai/usimic/ha-integration-patterns",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/ha-integration-patterns",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ha-integration-patterns",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "ha-integration-patterns",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-04T01:31:07.642Z",
      "expiresAt": "2026-05-11T01:31:07.642Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ha-integration-patterns",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ha-integration-patterns",
        "contentDisposition": "attachment; filename=\"ha-integration-patterns-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "ha-integration-patterns"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/ha-integration-patterns"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/ha-integration-patterns",
    "downloadUrl": "https://openagent3.xyz/downloads/ha-integration-patterns",
    "agentUrl": "https://openagent3.xyz/skills/ha-integration-patterns/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ha-integration-patterns/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ha-integration-patterns/agent.md"
  }
}
```
## Documentation

### The Problem

By default, HA services are "fire-and-forget" and return empty arrays [].

### The Solution (HA 2023.7+)

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"

### Response Handler

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}

### HTTP View vs Service: When to Use Each

Use CaseUseDon't UseReturn complex dataHTTP ViewService (without response support)Fire-and-forget actionsServiceHTTP ViewTrigger automationsServiceHTTP ViewQuery state/configHTTP ViewInternal storage APIs

### HTTP View Pattern

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())

### Critical: Avoid Internal APIs

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)

### For Small Data (Settings, Cache)

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()

### For Large Data (History, Logs)

Use external database or file storage, not HA storage helpers.

### Breaking Changes to Watch

ChangeVersionMigrationConversation agents2025.x+Use async_process directlyService response data2023.7+Add supports_response paramConfig entry migration2022.x+Use async_migrate_entry

Always check: https://www.home-assistant.io/blog/ for your target version range.

### HACS Integration Structure

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

### Minimal manifest.json

{
  "domain": "your_domain",
  "name": "Your Integration",
  "codeowners": ["@yourusername"],
  "config_flow": true,
  "dependencies": [],
  "requirements": [],
  "version": "1.0.0"
}

### Testing Checklist

Service calls return expected data (with ?return_response)
 HTTP views accessible with auth token
 No underscore-prefixed API usage
 Storage persists across restarts
 Config flow creates config entry
 Error handling returns meaningful messages

### Documentation Resources

Integration basics: developers.home-assistant.io/docs/creating_integration_index
Service calls: developers.home-assistant.io/docs/dev_101_services
HTTP views: developers.home-assistant.io/docs/api/webserver
Breaking changes: home-assistant.io/blog/ (filter by version)
HACS guidelines: hacs.xyz/docs/publish/start

### Lesson Learned

From 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.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: usimic
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-04T01:31:07.642Z
- Expires at: 2026-05-11T01:31:07.642Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/ha-integration-patterns)
- [Send to Agent page](https://openagent3.xyz/skills/ha-integration-patterns/agent)
- [JSON manifest](https://openagent3.xyz/skills/ha-integration-patterns/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/ha-integration-patterns/agent.md)
- [Download page](https://openagent3.xyz/downloads/ha-integration-patterns)