xiaohongshu
xiaohongshu
homeassistant
Expert HomeAssistant development skill for creating custom sensors (template, REST, command line, Python components), building Lovelace dashboards with custom cards and layouts, and developing custom integrations with config flows, coordinators, and multiple platforms. Use this skill when working...
Full skill instructions
This skill provides comprehensive guidance for HomeAssistant development across three core areas: custom sensors, dashboards (Lovelace UI), and custom integrations. Use this skill when creating or modifying HomeAssistant configurations, developing custom Python components, or building user interfaces.
Activate this skill when:
Use template sensors for calculations, unit conversions, or combining multiple sensor values. Templates use Jinja2 syntax and are defined in YAML configuration.
When to use:
Implementation approach:
| float(0) or | default()device_class, state_class, and unit_of_measurementunique_id for UI customization capabilityReference: See references/sensors.md for comprehensive template sensor examples and patterns.
Use REST sensors to pull data from external APIs or web services.
When to use:
Implementation approach:
value_template to extract the desired value from JSON responsesjson_attributes or json_attributes_path for additional datascan_interval to balance freshness and API limitsReference: See references/sensors.md for REST sensor configuration patterns.
Use command line sensors to execute shell commands and use their output as sensor values.
When to use:
Reference: See references/sensors.md for command line sensor examples.
Use custom Python components when sensor logic is too complex for templates or requires external libraries.
When to use:
Implementation approach:
custom_components/<domain>/assets/integration_template/sensor.py with proper entity classesDataUpdateCoordinator for efficient data fetchingReference: See references/sensors.md for Python sensor implementation details.
Create intuitive, responsive user interfaces using Lovelace cards and custom layouts.
Approach:
Entities Card - List multiple entities with controls:
Button Card - Single entity with large tap target:
Gauge Card - Visual representation of numeric values:
Picture Elements Card - Interactive image with overlays:
Conditional Card - Show/hide based on conditions:
Grid Layout - Responsive grid of cards:
square: false for flexible heightsVertical/Horizontal Stack - Group cards together:
Install custom cards via HACS for enhanced functionality:
Installation steps:
type: custom:<card-name>Reference: See references/dashboards.md for comprehensive card examples, custom card configurations, and layout patterns.
Develop full-featured integrations with Python for complex device or service integrations.
Required files:
manifest.json - Integration metadata, dependencies, and requirements__init__.py - Integration setup and platform loadingconfig_flow.py - UI-based configuration (recommended)sensor.py, switch.py, etc.) - Entity implementationsOptional but recommended:
coordinator.py - Centralized data fetchingconst.py - Constants and configuration keysstrings.json - UI text and translationsStep 1: Plan the Integration
Step 2: Start with Template
Copy the integration template from assets/integration_template/ to custom_components/<your_domain>/:
cp -r assets/integration_template custom_components/my_device
Step 3: Customize Manifest
Update manifest.json:
domain (lowercase, underscores)name, documentation, codeownersrequirementsiot_class (local_polling, cloud_polling, etc.)Step 4: Implement Config Flow
In config_flow.py:
_test_connectionStep 5: Implement Coordinator
In coordinator.py:
_async_update_data to fetch device dataUpdateFailed on failuresupdate_intervalStep 6: Implement Platforms For each platform (sensor.py, switch.py, etc.):
CoordinatorEntity and platform basenative_value property to return current stateDeviceInfo to group entities under one deviceunique_id for each entityStep 7: Test and Iterate
custom_components/ directoryData Fetching:
DataUpdateCoordinator to centralize API callsError Handling:
UpdateFailed in coordinator when data fetch failsNone or fallback values for unavailable dataEntity Design:
unique_id to enable UI customizationdevice_class for proper icon and unit handlingstate_class for sensors that should appear in statisticsDeviceInfoCode Quality:
-> bool, : str, etc.)Configuration:
config_flow.py over YAML configurationReference: See references/integrations.md for complete integration development guide with detailed code examples.
Detailed documentation loaded into context as needed:
sensors.md - Comprehensive sensor implementation guide covering all sensor types, device classes, state classes, and best practicesdashboards.md - Complete Lovelace dashboard reference with card types, custom cards, layouts, and design patternsintegrations.md - In-depth custom integration development guide with file structure, coordinator patterns, and platform implementationWhen to read references:
sensors.md when implementing any type of sensordashboards.md when building or modifying dashboardsintegrations.md when developing custom Python integrationsTemplate files used in development output:
integration_template/ - Complete, working integration boilerplate with:
manifest.json - Integration metadata template__init__.py - Integration setup with coordinatorconfig_flow.py - UI configuration flowcoordinator.py - Data update coordinatorsensor.py - Example sensor platform with multiple sensorsconst.py - Constants filestrings.json - UI translationsREADME.md - Customization guideWhen to use assets:
integration_template/ as starting point for new integrationsUse Developer Tools → Template in HomeAssistant to test Jinja2 templates before adding to configuration.
Run Configuration → Check Configuration before restarting HomeAssistant to catch YAML errors.
Monitor logs at Settings → System → Logs or via command line:
tail -f /config/home-assistant.log
Many components support reload without full restart:
Add debug logging to configuration.yaml:
logger:
default: info
logs:
custom_components.my_integration: debug
Always check HomeAssistant version compatibility:
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience