ha-integration-events-add

ha-integration-events-add is a skill for Claude Code from nolte/claude-home-assistant. It costs 226 tokens per session (2,111 once invoked), scanned A, original, MIT.

A skill for adding event support to an existing Home Assistant custom integration. It can add code that fires events, listens for events, or does both on Home Assistant’s event bus.

In plain words
What is it for?
Use it to announce integration occurrences, react to Home Assistant events, define event data, and add listener cleanup.
Why use it?
It helps connect an integration to Home Assistant’s event system with documented event data and cleanup for listeners. It also guides the choice between events and state changes.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-home-assistant plugin — 45 skills, 11 agents shipped together

Good fit Use it to announce integration occurrences, react to Home Assistant events, define event data, and add listener cleanup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nolte/claude-home-assistant/ha-integration-events-add
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nolte/claude-home-assistant --skill ha-integration-events-add
Clone the repo
git clone --depth 1 https://github.com/nolte/claude-home-assistant

Made for: Claude Code.

Or install claude-home-assistant, the plugin that ships this one along with the rest of its 45 skills, 11 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ha-integration-events-add

README.md
[![agentmods](https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-integration-events-add/github.svg)](https://agentmods.dev/skills/nolte/claude-home-assistant/ha-integration-events-add)
Your own site
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-integration-events-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-integration-events-add/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ha-integration-events-add

Your own site · 80×15
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-integration-events-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-integration-events-add.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 226 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,111 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00226 $0.02111
Opus 5 $0.00113 $0.01056
Sonnet 5 $0.00045 $0.00422
Haiku 4.5 $0.00023 $0.00211

Measured 12d ago against content hash d41db9605b6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ha-integration-events-add scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ha-integration-events-add/SKILL.md · 112 lines

How it starts

The opening of the file, as written. The whole thing — 112 lines — stays where its author put it; the contents beside it link to each section on GitHub.

HA Integration Events Add

Spec: spec/claude/ha-integration-events-add/en.md (EN canonical) / spec/claude/ha-integration-events-add/de.md (DE translation).

Why this is a skill, not an agent

  • Human-visible augmentation surface — the user describes an occurrence and reads back the async_fire call, the documented data shape, the listener wiring, and the conformance report; a skill keeps this on the visible command surface, like the sibling augment skills (ha-config-flow-augment, ha-coordinator-add, ha-device-automation-add).
  • Mid-flow interactivity — the fire-vs-listen-vs-both decision and the event-vs-state check are per-run dialogues the user approves before generation.
  • Bounded, inline generation — a bus-fire call plus a documented data shape, or a listener with its async_on_unload teardown, fit inline; no isolated agent context is needed.
  • Counter-dimension considered: the draft→validate loop could be an agent, but the direction decision and the event-vs-state advice belong in the user's working context; skill wins.

When this skill activates

Use this skill to add event firing and/or listening to an existing integration — firing a domain-prefixed custom event when a transient occurrence happens, or subscribing to a bus event with clean unsubscribe teardown.

When NOT to activate

  • a user-driven action with its own schema → ha-service-definition-add / ha/services
  • a device trigger built on top of a fired event → ha-device-automation-add / ha/device-automations
  • greenfield integration scaffolding → ha-integration-scaffold
  • deploying/importing into a running HA instance → out of scope

Hard rules

  1. Decide the direction first. Resolve fire vs. listen vs. both with the user before generating anything.
  2. Read spec/ha/integration-events/en.md first. Do not generate from memory.
  3. Domain-prefixed firing. Fire via hass.bus.async_fire("<domain>_event", event_data); the event type must carry the domain prefix; event_data is a JSON-serializable dict. Never use unprefixed or generic event names.
  4. Firing lives in setup. Place firing code in async_setup_entry (__init__.py), never in a platform's entity logic. For device-/service-related events add a device_id attribute from the device registry, and document the event_data shape (keys + types).
  5. Listen via the bus or a helper. Use hass.bus.async_listen (until canceled) or hass.bus.async_listen_once (exactly once); prefer async_listen_once for one-shot lifecycle events (EVENT_HOMEASSISTANT_START / _STARTED / _STOP). Prefer an homeassistant.helpers.event helper when it covers the type; do not listen to core events like EVENT_STATE_CHANGED when a dedicated helper exists.
  6. Never drop the unsubscribe. Hold the callable returned by async_listen / async_listen_once (or the helper) and register it via entry.async_on_unload(unsub) — or tear it down in async_unload_entry (see spec/ha/setup-lifecycle/en.md). A discarded callable leaks beyond the reload and fires twice.
  7. @callback listeners. Decorate non-blocking, loop-running listeners with @callback (homeassistant.core.callback); avoid blocking or I/O work inside them and offload follow-up work as a task (see spec/ha/async-patterns/en.md).
  8. Event, not state. Fire transient occurrences as events; never let entity state represent a transient event (no "30-second-on" binary sensor). Point at an event entity (spec/ha/entity-architecture/en.md) when it models the occurrence more cleanly.
  9. Name per spec/ha/naming-conventions/en.md and verify HA internals against the official docs (see spec/ha/upstream-docs-verification/en.md).

Read the full file on GitHub · 112 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 112 lines · 226 tokens per session scan A d41db9605b6f

Subscribe to this mod's changes

ha-integration-events-add is a skill published in the GitHub repository nolte/claude-home-assistant (1 stars, last pushed 1mo ago), licensed MIT. It adds 226 tokens to every session and 2,111 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.