Skip to content

Add Helper CRUD API (input_boolean, counter, timer, etc.) #440

@jessica-claude

Description

@jessica-claude

Description

No typed wrappers exist for HA helper management WebSocket commands. Users who want their apps to programmatically create helpers (e.g., an app that bootstraps its own input_boolean for state tracking) must use raw ws_send_and_wait() with untyped responses.

Helpers created via these WS commands persist across HA restarts (stored in .storage/), making them suitable for apps that self-provision their own state without requiring manual HA setup.

HA WebSocket pattern: Each helper domain registers five commands via DictStorageCollectionWebsocket:

  • {domain}/list
  • {domain}/create
  • {domain}/update
  • {domain}/delete
  • {domain}/subscribe

Domains to cover: input_boolean, input_number, input_text, input_select, input_datetime, input_button, counter, timer

Use Cases

  • App that creates its own input_boolean toggle (e.g., vacation mode, guest mode)
  • App that bootstraps a counter for tracking cycles (e.g., air filter replacement)
  • App that creates an input_select for user-facing mode selection
  • Self-contained apps that don't require users to manually create helpers in HA before installing

Acceptance Criteria

  • Add typed methods for list, create, update, delete per helper domain
  • Pydantic response models for each helper type
  • Convenience method that creates-if-not-exists (idempotent bootstrap)
  • Tests cover all new API methods

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiHA REST/WebSocket APIenhancementNew feature or requestsize:largeSignificant effort

    Projects

    Status

    Refinement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions