With the upcoming release of Home Assistant Core 2021.6, a significant change will be implemented that may cause outdated custom components and integrations to stop functioning. This new requirement, initially announced over three months ago with the release of Home Assistant Core 2021.3, is set to take effect this month. Developers have had a grace period to adjust, and now it's crucial for users to ensure their custom components are updated to avoid disruptions.
Contents
Understanding Custom Components in Home Assistant
In the context of Home Assistant, a custom component is a user-created extension that adds functionality or integrations not available in the official Home Assistant core. These components can range from new device integrations, automation scripts, to unique sensors or services that enhance the overall capabilities of Home Assistant. They are typically developed by community members and shared via platforms like GitHub or the Home Assistant Community Store (HACS). Custom components are popular because they allow users to:
- Integrate Unofficial Devices: Connect devices and services that are not officially supported by Home Assistant.
- Enhance Functionality: Add new features or improve existing ones.
- Personalize Automation: Tailor Home Assistant to meet specific needs and preferences that are not covered by the standard components.
Introduction of the Version Key Requirement
Starting with Home Assistant Core 2021.6, all custom components and integrations must include a version key in their manifest.json
file. This version key should be a string formatted as a major, minor, and patch version, for example, “1.0.0”. This change is mandatory for all custom components and integrations to be loaded by Home Assistant.
What is a manifest.json File?
A manifest.json
file is a JSON (JavaScript Object Notation) formatted file used to describe metadata about a custom component or integration in Home Assistant. It contains essential information that Home Assistant uses to load and manage the component.
Key Elements of manifest.json
Here are some of the critical elements that can be found in a manifest.json
file:
- Domain: This is a unique identifier for the component. For example,
"domain": "my_custom_component"
. - Name: A human-readable name for the component. For example,
"name": "My Custom Component"
. - Version: This is a new requirement introduced with Home Assistant Core 2021.6. It specifies the version of the component in a string format like
"version": "1.0.0"
. - Documentation: A URL to the documentation for the component, for example,
"documentation": "https://example.com/docs/my_custom_component"
. - Dependencies: Other components or integrations that this component relies on. For example,
"dependencies": ["http"]
. - Code Owners: GitHub usernames of the maintainers of the component. For example,
"codeowners": ["@myusername"]
. - Requirements: Python packages that the component needs to function. For example,
"requirements": ["requests2.25.1"]
The manifest.json
file is a crucial part of Home Assistant custom components, serving as a roadmap for how the component should be loaded, managed, and maintained. By understanding and correctly utilizing the manifest.json
file, both developers and users can ensure a seamless and secure Home Assistant experience.
Reasons for the Change
This update is part of a broader initiative to enhance security and reliability in Home Assistant. Following several security issues affecting popular custom components and integrations, the Home Assistant developers decided to deprecate certain utilities and introduce the version key requirement. You can read more about the background and security implications on the Home Assistant Developers Blog.
The version key allows users to easily identify the version of a custom component or integration they are using and determine if an update is necessary. Moreover, it enables the Home Assistant developers to block versions that have been identified as insecure, thereby improving overall security.
Consequences for Outdated Home Assistant Custom Components
Custom components and integrations that have not been updated to include the version key will fail to load when Home Assistant Core starts. This applies to both new and existing installations of Home Assistant Core. Users will experience broken components until the respective developers update them to comply with the new requirement.
Identifying Affected Custom Components
Unfortunately, there is no automated way to compile a comprehensive list of all custom components and integrations that need updating. However, users can manually check each component's repository. To do this, visit the GitHub repository of the component and navigate to the folder custom_components/NAME/
. Inside this folder, look for the manifest.json
file. For instance, the BlueIris integration includes a version key, whereas the gPodder integration does not.
Steps to Ensure Compatibility
To ensure your Home Assistant setup remains functional after the update, follow these steps:
- Review Installed Components: Identify all custom components and integrations currently in use.
- Check for Updates: Visit the GitHub repositories of these components and check their
manifest.json
files for a version key. - Update as Necessary: If a component lacks a version key, look for updates or contact the developer to encourage them to release a compliant version.
- Test Your Setup: After updating, restart Home Assistant Core to ensure all components load correctly.
Conclusion
The introduction of the version key requirement in Home Assistant Core 2021.6 is a crucial step toward enhancing the security and reliability of the platform. By proactively updating your custom components and integrations, you can avoid disruptions and contribute to a more secure Home Assistant environment. Ensure to regularly check for updates and stay informed about any further changes in the Home Assistant ecosystem.
By following these guidelines, you can maintain a stable and secure Home Assistant setup, even as the platform continues to evolve. If you have any questions or need assistance, the Home Assistant community is always ready to help.