Skip to main content

Text-to-speech say service to use media source IDs

· One min read

Starting with Home Assistant 2022.5, the TTS say service will set the media content ID to be a media source URI. These need to be resolved inside the media player using the media source integration.

Previously the TTS integration would set the media content ID to a URL that pointed at Home Assistant and it required no extra work from the media players.

Media players need to support the media source integration as documented here.

Saying goodbye to the time_changed event

· One min read

With Home Assistant Core 0.113, we began transiting to using the asyncio event loop for scheduling events.

With 2022.5, we are excited to announce that this process is now complete. The legacy time_changed event, also known as EVENT_TIME_CHANGED is no longer fired every second. Integrations that listen for all events no longer need to filter out EVENT_TIME_CHANGED. Integrations that run in a separate thread may see slight performance benefits since they will no longer be awakened every second.

With the previous implementation, consumers would subscribe to the time_changed event and check the time every time it fired to see if it was a match. This pattern led to many callbacks where most of the time, the callback would reject the event and continue receiving callbacks until the desired time was reached.

If your custom integration is still relying on listening for time_changed events, it will need to transition to using one of the built-in event helpers, which are, in most cases, a one-line drop-in replacement. For more information, please review the integration documentation on listening for events.

Calendar Data Model improvements and deprecations

· One min read

As of Home Assistant Core 2022.5, CalendarDeviceEntity is deprecated and superseded by CalendarEntity. The new entity has a more well defined data model, and a streamlined websocket API. CalendarDeviceEntity will be removed in a future Home Assistant release and custom components are required to migrate to the new APIs. See the new Calendar Entity developer documentation for details.

Local OAuth2 Updates

· One min read

As of Home Assistant Core 2022.5, integrations that register a config_entry_oauth2_flow.LocalOAuth2Implementation must have a manifest dependency on the auth component.

This is motivated by a broader effort to improve OAuth Application Credentials handling, which required changing how the HTTP endpoint for the OAuth callback is registered.

Deprecating all SUPPORT_* constants

· 2 min read

As of Home Assistant Core 2022.5, all SUPPORT_* constants are deprecated, each entity platform is providing an EntityFeature enum to replace them.

This applies to, the following platforms:

  • Alarm Control Panel

    Deprecated supported feature constants:

    • SUPPORT_ALARM_ARM_AWAY
    • SUPPORT_ALARM_ARM_CUSTOM_BYPASS
    • SUPPORT_ALARM_ARM_HOME
    • SUPPORT_ALARM_ARM_NIGHT
    • SUPPORT_ALARM_ARM_VACATION
    • SUPPORT_ALARM_TRIGGER

    Use the new AlarmControlPanelEntityFeature enum instead.

  • Camera

    Deprecated supported feature constants:

    • SUPPORT_ON_OFF
    • SUPPORT_STREAM

    Use the new CameraEntityFeature enum instead.

  • Cover

    Deprecated supported feature constants:

    • SUPPORT_OPEN
    • SUPPORT_CLOSE
    • SUPPORT_SET_POSITION
    • SUPPORT_STOP
    • SUPPORT_OPEN_TILT
    • SUPPORT_CLOSE_TILT
    • SUPPORT_STOP_TILT
    • SUPPORT_SET_TILT_POSITION

    Use the new CoverEntityFeature enum instead.

  • Climate

    Deprecated supported feature constants:

    • SUPPORT_TARGET_TEMPERATURE
    • SUPPORT_TARGET_TEMPERATURE_RANGE
    • SUPPORT_TARGET_HUMIDITY
    • SUPPORT_FAN_MODE
    • SUPPORT_PRESET_MODE
    • SUPPORT_SWING_MODE
    • SUPPORT_AUX_HEAT

    Use the new ClimateEntityFeature enum instead.

  • Humidifier

    Deprecated supported feature constants:

    • SUPPORT_MODES

    Use the new HumidifierEntityFeature enum instead.

  • Fan

    Deprecated supported feature constants:

    • SUPPORT_SET_SPEED
    • SUPPORT_OSCILLATE
    • SUPPORT_DIRECTION
    • SUPPORT_PRESET_MODE

    Use the new FanEntityFeature enum instead.

  • Light

    Deprecated supported feature constants:

    • SUPPORT_EFFECT
    • SUPPORT_FLASH
    • SUPPORT_TRANSITION

    Use the new LightEntityFeature enum instead.

    Note that the following light constants were already deprecated, thus LightEntityFeature does not provide a replacement for those.

    • SUPPORT_BRIGHTNESS
    • SUPPORT_COLOR_TEMP
    • SUPPORT_COLOR
    • SUPPORT_WHITE_VALUE

    These cases should instead be migrated to the new color modes.

  • Lock

    Deprecated supported feature constants:

    • SUPPORT_OPEN

    Use the new LockEntityFeature enum instead.

  • Media Player

    Deprecated supported feature constants:

    • SUPPORT_PAUSE
    • SUPPORT_SEEK
    • SUPPORT_VOLUME_SET
    • SUPPORT_VOLUME_MUTE
    • SUPPORT_PREVIOUS_TRACK
    • SUPPORT_NEXT_TRACK
    • SUPPORT_TURN_ON
    • SUPPORT_TURN_OFF
    • SUPPORT_PLAY_MEDIA
    • SUPPORT_VOLUME_STEP
    • SUPPORT_SELECT_SOURCE
    • SUPPORT_STOP
    • SUPPORT_CLEAR_PLAYLIST
    • SUPPORT_PLAY
    • SUPPORT_SHUFFLE_SET
    • SUPPORT_SELECT_SOUND_MODE
    • SUPPORT_BROWSE_MEDIA
    • SUPPORT_REPEAT_SET
    • SUPPORT_GROUPING

    Use the new MediaPlayerEntityFeature enum instead.

  • Remote

    Deprecated supported feature constants:

    • SUPPORT_LEARN_COMMAND
    • SUPPORT_DELETE_COMMAND
    • SUPPORT_ACTIVITY

    Use the new RemoteEntityFeature enum instead.

  • Siren

    Deprecated supported feature constants:

    • SUPPORT_DURATION
    • SUPPORT_TONES
    • SUPPORT_TURN_OFF
    • SUPPORT_TURN_ON
    • SUPPORT_VOLUME_SET

    Use the new SirenEntityFeature enum instead.

  • Vacuum

    Deprecated supported feature constants:

    • SUPPORT_TURN_ON
    • SUPPORT_TURN_OFF
    • SUPPORT_PAUSE
    • SUPPORT_STOP
    • SUPPORT_RETURN_HOME
    • SUPPORT_FAN_SPEED
    • SUPPORT_BATTERY
    • SUPPORT_STATUS
    • SUPPORT_SEND_COMMAND
    • SUPPORT_LOCATE
    • SUPPORT_CLEAN_SPOT
    • SUPPORT_MAP
    • SUPPORT_STATE
    • SUPPORT_START

    Use the new VacuumEntityFeature enum instead.

  • Water Heater

    Deprecated supported feature constants:

    • SUPPORT_TARGET_TEMPERATURE
    • SUPPORT_OPERATION_MODE
    • SUPPORT_AWAY_MODE

    Use the new WaterHeaterEntityFeature enum instead.

New features for developers in 2022.4

· 2 min read

There are a handful of new features for developers in 2022.4.

  • Integration Type: Integrations can now mark themselves as helper.
  • Backup platform: Integrations can now pause work during a backup by implementing the new backup platform.
  • hidden_by in entity registry: Entities can now be hidden via the entity registry. These entities should default to not be included when exposing entities to an external UI like voice assistants.
  • New and updated selectors: We added a bunch of new selectors to be used in blueprints, services.yaml, and config flows.
  • Selectors in backend flows: You can now use the selector helper in your config flows. It is configured and renders just like selectors in services.yaml/blueprints.
  • ha-form context: Context is a new way to allow selectors to be dynamically configured based on values from other fields. Currently only available for the attribute selector.
  • config flow helper text for fields: Config flow fields can now have a description.
  • Schema Config Flow helper: New helper to create config flows based on a config schema. Example implementation
  • Show Menu step: This new step in a data entry flow shows a menu to the user.
  • Fan speed: We introduced a new format and this transition is now completed.
  • Device State Attributes: Backwards compatibility support for this property has been removed after being deprecated since Home Assistant 2021.4. Use extra_state_attributes instead.
  • Cameras without width/height: The compatbility layer for cameras without width/height has been removed.
  • Calendar offset: Calendar method signatures for calculate_offset and is_offset_reached have changed, in preparation for typing improvements in Calendar, and potential simplification of offsets more generally.

Introducing the update entity

· 2 min read

Home Assistant 2022.4 will provide a brand new entity platform: the update entity.

The update entity can be provided by integrations to indicate there is an update available, for a device or service, towards the Home Assistant user. It allows you to provide additional information about the update, such as the latest version available, a summary of the release notes and a link to the full release announcement online.

Additionally, the install method can be implemented, so the user can install the update directly from within Home Assistant.

Adding the update platform to your integration is relatively simple to do, as it is just a couple of properties and, if available for the integration, a single install method. Most other details are handled by Home Assistant automatically.

In Home Assistant Core 2021.12 we moved updates provided by the Supervisor to the Configuration panel, using this new platform, we will be able to extend that in the near future by the information provided by these brand new entities.

See our developer documentation for how to implement this in an integration.

If your integration previously provided a binary_sensor or button entity with the update device class, please consider replacing those with the update entity.

Opt in support to manually remove device

· One min read

In the Home Assistant Core 2022.3 release, Erik Montnemery added support for any integration to opt in to show a "delete device" button on the device page in the Home Assistant interface.

See our developer documentation for how to implement this in an integration.

So far five integrations have opted in to this feature:

Why is this needed?

Before this feature was added, integrations were advised to automatically clean up stale devices from the config entry. But not all integrations are able to automatically determine if a device should be removed, so a manual option where the user can make the choice is in some cases still needed.

To solve this need, some integrations had implemented an integration specific websocket command with accompanying frontend support to allow manual removal of a device. With this new feature, integrations do no longer need to add any websocket or frontend code but can easily support, just by implementing the backend callback function, manual device removal.

Happy days!

Paper Elements are being removed

· 2 min read

In the Home Assistant Core 2022.3 release, we are removing all of the paper-dropdown-menu and paper-input elements in the Frontend Repository. This means that any custom card that was previously using these elements in the card or card editor will no longer render correctly and will require updates to its codebase.

Custom Cards using the elements used in the Home Assistant Frontend have never been supported.

Why did we do this?

We are converting our codebase from the deprecated paper elements to the new Material Web Components from Google. This is to keep our frontend up to date with the latest components and features.

What should custom cards do?

Our advice is to bundle the Material Web Components in your custom card using Scoped Custom Element Registry. The Home Assistant Frontend loads the polyfill needed for this to work starting with the release of Home Assistant 2022.3.

This will allow any custom card to utilize the same MWC elements that are used in the Lovelace Editors. You can see an example of this usage in the Boilerplate Card. Other HA elements like the icon picker (<ha-icon-picker>) are not supported in this same way.

See this old blog post for more information.

Device configuration URL and entity categories

· 2 min read

Home Assistant Core 2021.11 introduces two new concepts to make managing devices easier, device configuration URL and entity categories.

Device configuration URL

It's now possible to provide a configuration_url as part of the device registry information. The configuration_url is used in the device card to allow the user to visit the device for configuration or diagnostics which is not available in Home Assistant. Note that the URL linked to is not proxied by Home Assistant, so this typically won't work when connecting to Home Assistant remotely.

Screenshot showing visit device

Entity categories

Entities now have an optional property entity_category for classifying non-primary entities. Set to config for entities that allow changing the configuration of a device, for example, a switching entity making it possible to turn the background illumination of a switch on and off. Set to diagnostic for an entity exposing some configuration parameter or diagnostics of a device but does not allow changing it, for example, a sensor showing RSSI or MAC address with allowed values.

Entities which have the entity_category set:

  • Are not included in a service call targetting a whole device or area.
  • Are, by default, not exposed to Google Assistant or Alexa.
  • Are shown on a separate card on the device configuration page.
  • Do not show up on the automatically generated Lovelace Dashboards.

Screenshot showing seperation of entity categories