Home Assistant 0.112 Released

The Home Assistant project has released version 0.112 of the open-source home automation hub we have previously covered, which is the eighth release of the project this year. While previous releases have largely focused on new integrations and enhancements to the front-end interface, in this release the focus has shifted more toward improving the performance of the database. It is important to be aware that there are significant database changes and multiple potential backward compatibility breaks to understand before attempting an upgrade to take advantage of the improvements.

According to the release notes written by contributor Franck Nijhof, better performance has been a major goal of this release with a focus on both the logbook and history components. This builds on the work of the previous release (v0.111) from a performance perspective, which focused on reducing the time it takes to initialize the hub at startup.

Faster historic data

logbook and history are essentially different views of the same data — the historic state of an entity at any given point in time. The history component is more of a raw view of the state changes of entities, where logbook is a more user-friendly and higher-level representation of the data in reverse chronological order. Over time, as Home Assistant runs, it produces a great deal of historic data regarding the home. Every time a light turns on or a sensor takes a reading, it is recorded in the database and made accessible by these components via the web interface. The volume of data can be quite large, and in previous versions it resulted in poor performance when attempting to access it in the UI.

Home Assistant 0.112 offers “absolutely game-changing performance improvements to the logbook and history panels”, Nijhof said. “Honestly, I avoided using the logbook in the past because of the slowness it had.” The majority of the performance improvements seem to be tied to schema improvements in the underlying database. Users who are upgrading can expect the first time Home Assistant 0.112 starts to take anywhere from minutes to hours while a data migration is performed. The time the migration takes, and thus the initial post-upgrade startup time, depends on the quantity of data that needs to be migrated to the new schema.

Beyond schema changes, logbook also improves the user interface it provides, with more robust date and time filtering controls to make it easier to dig into the hub’s data. Additionally, logbook now tracks the person associated with an entry in the log, making it easier to understand why a particular state change happened (knowing “John” turned on the kitchen lights versus an automation rule).

Improvements to automation condition syntax

Another notable improvement relates to designing automation rules whose conditions deal with multiple entities. It is a common practice to place conditions involving multiple entities’ state values on an automated action (“automation” in Home Assistant terms) before it executes. In the past this had to be done verbosely, by creating a separate condition for each entity. Starting with version 0.112, multiple conditions can be collapsed into a single conditional and the list of entities it applies to. For example, let’s assume there is an automation action that should only occur if both the kitchen and living room lights are on. In previous releases, this could be accomplished as follows:

    condition:
       - condition: state
         entity_id: light.kitchen
         state: 'on'
       - condition: state
         entity_id: light.living_room
         state: 'on'

As of version 0.112, these conditions can be expressed more compactly as follows:

    condition:
      - condition: state
        entity_id:
          - light.kitchen
          - light.living_room
        state: 'on'

Providing a list to entity_id isn’t the only improvement to the state condition either, as lists can also now be provided to indicate multiple state values to accept in the conditional:

    # Instead of creating multiple condition entries 
    # for two different acceptable states, one can now 
    # be used. 
    condition: 
      - condition: state
        entity_id: alarm_control_panel.home
        state:
          - armed_home
          - armed_away

General improvements

Version 0.112 brings a few notable UI changes and improvements. For an integration that offers specialized configuration or development tooling (such as MQTT), those integration-specific items have been consolidated. Previously these tools were scattered across the configuration and development tool sections of the interface. With version 0.112, integration-specific tools have been moved into a dedicated configuration section for the integration.

The 0.112 release makes additional headway toward the goal of providing UI-based integration configuration (as opposed to requiring direct editing of YAML files). In total it adds twelve new UI-configurable integrations. Other changes include information pages — like system-level logs (these capture Python exceptions for example, rather than hub events like logbook) — that have been moved from the development tools section into the server control section of the configuration UI. As Nijhof wrote, “[…] the logs and information pages used to be in the development tools panel, but they didn’t really belong there. They aren’t really tools for developing, they provide information on your setup.”

Upgrading will require being mindful of compatibility breaks; the release notes specifically draw attention to the use of the hidden attribute in automations, scenes, and scripts. Beginning with this release the attribute will be ignored. The hidden attribute is something the project has been working on deprecating for some time, and it has been completely removed in this release. This will likely cause problems for users during the upgrade, when older-style configurations still using hidden no longer work as expected — users who are still using the attribute will need to remove it from the relevant configurations. The release notes also indicate various other backward compatibility breaks related to specific integrations, making the complete list worth a review before upgrading.

Finally, the 0.112 release added four brand new integrations and nine new platforms. This notably includes a completely rewritten integration for the Smappee power-monitoring platform. This rewrite was contributed by Smappee itself, a sign of Home Assistant’s expanding acceptance into the broader commercial ecosystem. Complete details on these new integrations can be found in the release notes.

With every release, Home Assistant continues to mature and we’ll continue to follow the project’s progression as it does. Overall there are a lot of improvements in this release, and plenty to look forward to when upgrading to it.