ha-entity-lifecycle

Manage Home Assistant entity lifecycle and registry registration.

6|1|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/L3DigitalNet/Claude-Code-Plugins --skill ha-entity-lifecycle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ha-entity-lifecycle
Source: https://github.com/L3DigitalNet/Claude-Code-Plugins/tree/main/plugins/home-assistant-dev/skills/ha-entity-lifecycle
Command: npx skills add https://github.com/L3DigitalNet/Claude-Code-Plugins --skill ha-entity-lifecycle

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers understand and manage the lifecycle of entities within Home Assistant, including device and entity registry interactions, ensuring proper registration, state management, and cleanup.

Core Features & Use Cases

  • Entity Lifecycle Management: Covers platform discovery, entity creation, registration, initial updates, and removal.
  • State Restoration: Demonstrates how to restore an entity's previous state upon re-initialization.
  • Device Registry Integration: Explains how to define DeviceInfo for grouping entities under a specific device, using stable identifiers.
  • Use Case: When developing a new Home Assistant integration, use this Skill to ensure your custom entities are correctly registered, handle state persistence, and are properly cleaned up when removed.

Quick Start

Explain how to restore the previous state of a Home Assistant entity.

Frequently Asked Questions about ha-entity-lifecycle

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restore an entity's previous state in Home Assistant after re-initialization?

Home Assistant entity lifecycle management covers platform discovery, entity creation, registry registration, initial updates, and removal. This ensures custom integration entities are properly registered and cleaned up when deleted.

What is the best way to define device information for Home Assistant entity registry grouping?

Defining DeviceInfo with stable identifiers is the best way to group entities under a specific device in the Home Assistant device registry. This ensures proper registration and persistent device association across reboots.

Do I need to understand asynchronous frameworks to manage Home Assistant entity lifecycles?

Yes, managing Home Assistant entity lifecycles requires understanding the asynchronous framework and helper libraries like CoordinatorEntity. These tools handle async state restoration and registry interactions for custom integrations.

Why does my custom Home Assistant entity not clean up properly when removed?

Improper Home Assistant entity cleanup usually occurs when the lifecycle management steps are incomplete. You must correctly handle the removal phase within the device and entity registries to ensure the entity is fully deregistered.