-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Introduce Home Assistant Labs #2866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8e4a1eb
Introduce Home Assistant Labs
frenck 1dbf3fc
Clean up duplicate
frenck 0ada83c
Update docs/development/labs.md
frenck 23c274b
Apply suggestion from @frenck
frenck aef9c8c
Apply suggestion from @frenck
frenck 8e743aa
Update blog/2025-11-20-labs-preview-features.md
frenck 2801c02
Update blog/2025-11-20-labs-preview-features.md
frenck acb155b
Update docs/development/labs.md
frenck d03d5e3
Process feedback, process upstream changes, align with end-user docs
frenck 9e67628
More tuning
frenck aa0b802
More tuning
frenck 3d8316d
More tuning
frenck 38ae99d
More tuning
frenck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,162 @@ | ||
| --- | ||
| author: Frenck | ||
| authorURL: https://github.com/frenck | ||
| authorImageURL: https://avatars.githubusercontent.com/u/195327?v=4 | ||
| title: "Introducing Labs: Preview features before they become standard" | ||
| --- | ||
|
|
||
| We're excited to announce a new system for shipping preview features in Home Assistant: **Labs**. Labs provides a standardized way for integrations to offer critical bug-free features that users can opt into before they become standard. | ||
|
|
||
| ## What are Labs preview features? | ||
|
|
||
| Labs preview features are different from beta testing. While beta testing evaluates release stability, Labs features are already critical bug-free and fully functional. However, their feature set may still be extended or refined as we gather real-world usage and feedback before graduating them to standard. | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
|
|
||
| Think of it this way: | ||
|
|
||
| - **Beta**: Testing for stability and bugs | ||
| - **Labs**: Critical bug free features with potentially incomplete feature sets, gathering feedback to refine user experience and extend functionality | ||
|
|
||
| ## How it works | ||
|
|
||
| Labs features are defined in an integration's `manifest.json`: | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
|
|
||
| ```json | ||
| { | ||
| "domain": "my_integration", | ||
| "preview_features": { | ||
| "my_preview_feature": { | ||
| "feedback_url": "https://community.home-assistant.io/t/...", | ||
| "learn_more_url": "https://www.home-assistant.io/integrations/my_integration", | ||
| "report_issue_url": "https://github.com/home-assistant/core/issues/new" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| Users can enable preview features in **Settings** → **System** → **Labs**, and the features activate immediately without requiring a restart. | ||
|
|
||
| ## Why Labs? | ||
|
|
||
| Many of our most significant improvements benefit from real-world testing before becoming standard. Labs provides: | ||
|
|
||
| 1. **Structured feedback channels**: Each feature has dedicated URLs for feedback, documentation, and issue reporting | ||
| 2. **Runtime activation**: Features enable and disable instantly, no restart required | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
| 3. **Clear expectations**: Users know they're trying a critical bug free preview feature that may have its feature set extended or refined | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
| 4. **Iterative development**: Integrate user feedback directly into the development process | ||
|
|
||
| ## Example: Kitchen Sink special repair | ||
|
|
||
| The [Kitchen Sink](https://www.home-assistant.io/integrations/kitchen_sink/) demo integration includes a working example. When enabled, the "special repair" feature creates a repair issue to demonstrate how Labs features can interact with other Home Assistant systems. | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
|
|
||
| Here's how it's implemented: | ||
|
frenck marked this conversation as resolved.
Outdated
|
||
|
|
||
| **manifest.json**: | ||
| ```json | ||
| { | ||
| "domain": "kitchen_sink", | ||
| "preview_features": { | ||
| "special_repair": { | ||
| "feedback_url": "https://community.home-assistant.io", | ||
| "learn_more_url": "https://www.home-assistant.io/integrations/kitchen_sink", | ||
| "report_issue_url": "https://github.com/home-assistant/core/issues/new" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **strings.json**: | ||
| ```json | ||
| { | ||
| "preview_features": { | ||
| "special_repair": { | ||
| "name": "Special repair", | ||
| "description": "Creates a **special repair issue** when enabled.\n\nThis demonstrates how lab features can interact with other Home Assistant integrations." | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **__init__.py** (excerpt): | ||
|
|
||
| ```python | ||
| from homeassistant.components.labs import ( | ||
| EVENT_LABS_UPDATED, | ||
| EventLabsUpdatedData, | ||
| async_is_preview_feature_enabled, | ||
| ) | ||
| from homeassistant.core import Event | ||
| from homeassistant.helpers.issue_registry import ( | ||
| IssueSeverity, | ||
| async_create_issue, | ||
| async_delete_issue, | ||
| ) | ||
|
|
||
| @callback | ||
| def _async_labs_updated(event: Event[EventLabsUpdatedData]) -> None: | ||
| """Handle labs feature update event.""" | ||
| if ( | ||
| event.data["domain"] == "kitchen_sink" | ||
| and event.data["preview_feature"] == "special_repair" | ||
| ): | ||
| _async_update_special_repair(hass) | ||
|
|
||
| @callback | ||
| def _async_update_special_repair(hass: HomeAssistant) -> None: | ||
| """Update special repair based on feature state.""" | ||
| if async_is_preview_feature_enabled(hass, DOMAIN, "special_repair"): | ||
| # Feature is enabled - create the repair issue | ||
| async_create_issue( | ||
| hass, | ||
| DOMAIN, | ||
| "kitchen_sink_special_repair_issue", | ||
| is_fixable=False, | ||
| severity=IssueSeverity.WARNING, | ||
| translation_key="special_repair", | ||
| ) | ||
| else: | ||
| # Feature is disabled - remove the repair issue | ||
| async_delete_issue(hass, DOMAIN, "kitchen_sink_special_repair_issue") | ||
|
|
||
| async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: | ||
| """Set up the integration.""" | ||
| # Subscribe to labs feature updates for runtime toggling | ||
| entry.async_on_unload( | ||
| hass.bus.async_listen(EVENT_LABS_UPDATED, _async_labs_updated) | ||
| ) | ||
|
|
||
| # Check current state and apply | ||
| _async_update_special_repair(hass) | ||
|
|
||
| return True | ||
| ``` | ||
|
|
||
| The feature listens for `EVENT_LABS_UPDATED` to react when users toggle it, and creates or removes a repair issue accordingly. | ||
|
|
||
| ## Getting started | ||
|
|
||
| Ready to add a Labs preview feature to your integration? Check out our [comprehensive guide](/docs/development/labs) which covers: | ||
|
|
||
| - When to use Labs (and when not to) | ||
| - How to define features in your manifest | ||
| - Implementation patterns for backend and frontend features | ||
| - Runtime activation requirements | ||
| - Testing approaches | ||
| - Feature lifecycle (preview → standard or removal) | ||
|
|
||
| ## What's next? | ||
|
|
||
| We encourage integration developers to consider Labs for: | ||
|
|
||
| - Major UI changes or redesigns | ||
| - New subsystems that benefit from real-world testing | ||
| - Features where user feedback will shape the final design | ||
|
|
||
| Labs is **not** for: | ||
|
|
||
| - Permanent configuration options (use integration options instead) | ||
| - Minor changes that can go directly into releases | ||
| - Features with critical bugs or that are fundamentally incomplete | ||
|
|
||
| ## Try it yourself | ||
|
|
||
| Want to see Labs in action? Install the Kitchen Sink demo integration and enable the "Special repair" feature in Settings → System → Labs. You'll see firsthand how preview features work. | ||
|
frenck marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.