ha-websocket-command-add

ha-websocket-command-add is a skill for Claude Code from nolte/claude-home-assistant. It costs 195 tokens per session (2,021 once invoked), scanned A, original, MIT.

A tool for adding one custom WebSocket command to a Home Assistant integration. A WebSocket command is a backend request that a browser-based card or panel sends to retrieve or change integration data.

In plain words
What is it for?
Use it to add the command handler, validate its input schema, and register the endpoint for a frontend card or panel.
Why use it?
It provides a defined backend endpoint for a Home Assistant interface without requiring the command to be designed from scratch. It also guides choices such as synchronous versus asynchronous handling.

Skill for Claude Code

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

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

Good fit Use it to add the command handler, validate its input schema, and register the endpoint for a frontend card or panel.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nolte/claude-home-assistant/ha-websocket-command-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-websocket-command-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 64 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-websocket-command-add

README.md
[![agentmods](https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-websocket-command-add/github.svg)](https://agentmods.dev/skills/nolte/claude-home-assistant/ha-websocket-command-add)
Your own site
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-websocket-command-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-websocket-command-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-websocket-command-add

Your own site · 80×15
<a href="https://agentmods.dev/skills/nolte/claude-home-assistant/ha-websocket-command-add"><img src="https://agentmods.dev/badge/skills/nolte/claude-home-assistant/ha-websocket-command-add.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 195 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,021 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.00195 $0.02021
Opus 5.5 $0.00078 $0.00808
Sonnet 5.5 $0.00039 $0.00404
Haiku 4.5 $0.00019 $0.00202

Measured 1mo ago against content hash 8ff7823073c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ha-websocket-command-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 1mo 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-websocket-command-add/SKILL.md · 107 lines

How it starts

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

HA WebSocket Command Add

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

Why this is a skill, not an agent

  • Human-visible augmentation surface — the user describes the data a card needs and reads back the handler, the schema, 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-repairs-add).
  • Mid-flow interactivity — the command-vs-service decision and the sync-vs-async choice are per-run dialogues the user approves before generation.
  • Bounded, inline generation — one decorated handler plus its schema and the async_register_command call fit inline; no isolated agent context is needed.
  • Counter-dimension considered: the draft→validate loop could be an agent, but the command-vs-service and admin-exposure decisions belong in the user's working context; skill wins.

When this skill activates

Use this skill to add one custom WebSocket API command to an existing integration — the backend endpoint a card or panel calls via hass.callWS(...) to load integration-specific data that is not a state attribute.

When NOT to activate

  • a user-driven action / backend mutation with its own schema → ha-service-definition-add / ha/services
  • the frontend consumer side (TypeScript typing, callWS error handling in the card) → ha/frontend-data-api
  • a custom panel that consumes the command → ha-panel-add
  • deploying/importing into a running HA instance → out of scope

Hard rules

  1. One command, one run. No multi-command batches.
  2. Read spec/ha/frontend-websocket-commands/en.md first. Do not generate from memory.
  3. Command vs. service. Run the choice first: a data fetch into the frontend is a command; a user-driven action/mutation is a service. On action/mutation, point at ha-service-definition-add and abort.
  4. Three-part contract. Declare type and schema via @websocket_api.websocket_command({...}) on a handler with signature (hass, connection, msg); namespace the type as vol.Required("type"): "<domain>/<name>" (docs example: "camera/get_thumbnail"); declare input fields via vol.Required/vol.Optional with a type annotation, kept minimal.
  5. Sync vs. async. A pure in-memory handler is a synchronous function with @callback; a handler doing network/device/computation work is async def decorated with @websocket_api.async_response. Never run blocking I/O in a @callback handler.
  6. Results and errors. Deliver success via connection.send_result(msg["id"], result) using the incoming msg["id"]; report errors via connection.send_error(msg["id"], "<code>", "<message>") instead of letting an exception propagate, and return after every send_error. Never substitute the msg["id"].
  7. Admin restriction. Decorate admin-only commands with @websocket_api.require_admin; consider it for sensitive or integration-internal data. Never hand-roll admin checks in the handler body.
  8. Register in setup. Register via websocket_api.async_register_command(hass, ws_handler) inside the integration's setup method (e.g. async_setup), not scattered across platform modules; do not require websocket_api as a manifest dependency.
  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 · 107 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. 1mo ago First seen · 107 lines · 195 tokens per session scan A 8ff7823073c2

Subscribe to this mod's changes

ha-websocket-command-add is a skill published in the GitHub repository nolte/claude-home-assistant (1 stars, last pushed 1mo ago), licensed MIT. It adds 195 tokens to every session and 2,021 once invoked, about $0.0008 per session on Opus 5.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-09-15.

Related

Other skills, from other repositories

inference-serving-sglang

Fast structured generation and serving for LLMs with RadixAttention prefix caching. Use for JSON/regex outputs, constrained decoding, agentic workflows with tool calls, or when you need 5× faster inference than vLLM with prefix sharing. Powers 300,000+ GPUs at xAI, AMD, NVIDIA, and LinkedIn.

davila7/claude-code-templates · 76 tokens

agent-django-fastapi-expert

Specialist subagent: Django ORM, Django REST Framework, FastAPI async patterns, and Pydantic v2 specialist. Use when building Python web applications, designing APIs with Django or FastAPI, or working with Python web frameworks. Trigger phrases: Django, FastAPI, DRF, Django REST Framework, Pydantic, ORM, queryset…

travisjneuman/.claude · 92 tokens

microservices-architecture

Microservices architecture patterns and best practices. Use when designing distributed systems, breaking down monoliths, or implementing service communication.

travisjneuman/.claude · 30 tokens

authentication-patterns

OAuth 2.0, JWT, SSO, MFA, NextAuth/Clerk/Supabase Auth implementation patterns.

travisjneuman/.claude · 28 tokens

email-systems

Transactional email (Resend, SendGrid, SES), templates (React Email, MJML), deliverability (SPF/DKIM/DMARC), and inboxing best practices. Use when building email infrastructure, designing templates, or troubleshooting deliverability.

travisjneuman/.claude · 55 tokens

event-driven-architecture

Kafka, RabbitMQ, SQS/SNS, event sourcing, CQRS, saga patterns, dead letter queues, and idempotency. Use when designing asynchronous systems, implementing message-driven workflows, or building event streaming pipelines.

travisjneuman/.claude · 50 tokens