2021.9.0: More energy, USB discovery, template ❤️

Last release we introduced Home Energy management, and we are so happy with all the reactions and response we have received ❤️! In this version we have added some much requested features to make it even more useful, also a lot more integrations now have support for it ⚡️.

Personally I also really like the new long term statistics and statistics card introduced last release, and I’m really happy that in this release we will be able to use it for a lot more sensors.

Enjoy another great release! Be sure to tune into the 2021.9 Release Party on YouTube later today (9:00 PM CET) to learn more about this release!

Home Energy Management updates

Last release, we introduced the new Home Energy management features into Home Assistant and we are happy to see you like it!

We have seen quite a few people sharing their Energy dashboards on socials like Facebook and Twitter, which is really awesome. Share a screenshot of your dashboard and your story too!

In this release, the story continues! Here is what we have in store for you:

View energy usage over a period of time

The first iteration of the Energy Dashboard showed a single day at the time. Great! But what if you want to see how you did this week? Or month? Heck, a year even?!

Well, now you can! In the top right of the dashboard, you can now select the grouping period you want to see: Day, Week, Month or Year.

Screenshot of the new Energy Dashboard period selection Screenshot of the new Energy Dashboard period selection.

The arrow buttons allow you to browse through those periods. For example, when selecting a period of a month to display, the arrow buttons will take you a whole month back/forward in the view.

Keeping track of your gas usage

In some countries, homes are connected to gas. The gas is being used to heat water, cook and for heating the house. If you have a home that is connected to gas, we have some great news for you!

Maybe you noticed it already in the previous screenshot, as of this release, we have added support for monitoring your gas usage.

Screenshot of the new Energy Dashboard monitoring gas usage Screenshot of the new Energy Dashboard monitoring gas usage.

In certain countries, the gas meters have a standardized way of reading out the gas usage locally or provide this information via the electricity meter. For example, in the Netherlands, Belgium and Luxembourg you could use the SlimmeLezer to obtain your gas usage.

Support for home batteries

Having solar panels is a great way to generate electricity to power your home. However, where do you store energy generated by your solar panels that you don’t need right now?

Well, for many, the solution resides in a, high capacity, home battery to store electricity for use when the sun can’t provide it (e.g., during the night).

Numerous have requested this feature, and therefore we now have added support for home batteries to the Home Assistant energy management.

Animation of a home battery as part of the energy distribution Animation of a home battery as part of the energy distribution.

Added support for many more integrations

When releasing a feature such as the Home Energy management, we understand you want to use and play with it right away. And while we had prepared and updated a lot of integrations to be ready when we first launched, there were still many in need of an update.

As a result, we have been flooded by requests to add support to virtually all integrations that didn’t had it yet… :) Many of those requests have been fulfilled in this release.

For example, the Kostal Plenticore Solar Inverter, PVOutput, Fronius, SolaX Power, Growatt, Solar-Log, YouLess, Emoncms, Modbus, and many more have added support for all the energy goodness.

If you are a custom integration developer who wants to add support, be sure to check out our developer blog to catch up with the latest changes.

Long term statistics unlocked for all sensors

In the previous release, we introduced long term statistics for sensors, including a beautiful Lovelace card that goes with it. However, in the previous release we had limited this feature to temperature, humidity, power and energy related sensors.

As of this release, we unleashed the long term statistics for all sensors!

Screenshot of a statistics graph showing the luminosity in the garden versus the front of my house Screenshot of a statistics graph showing the luminosity in the garden versus the front of my house.

Long term statistics applies to all integrations that indicate their sensors support those. Luckily a lot have already done so.

USB Discovery

Thanks to @bdraco, Home Assistant can now discover USB devices and the integrations that work with that device. This makes setting up things like Z-Wave or Zigbee with Home Assistant an actual breeze now!

For example, if you plug in your new Nortek HubZ USB stick into the machine running Home Assistant, it will discover and notify you about it.

Screenshot of a discovered USB device compatible with Z-Wave JS Screenshot of a discovered USB device compatible with Z-Wave JS.

Now it is just a single click on the “Configure” button to set up the Z-Wave JS integration and done! Super nice!

Support for USB discovery has currently been added to the Z-Wave JS and ZHA integrations.

Z-Wave JS Updates

If you are a Z-Wave siren/doorbell owner, you probably know how frustrating it was to wait for Home Assistant to add entity support for the Sound Switch CC (Command Class). This is caused by the blazing fast speed the upstream Z-Wave JS project is moving forward at; Often much faster than Home Assistant is able to keep up with.

It also might be that Home Assistant cannot (or is likely not to) support the specific command class you care about; Nevertheless, that shouldn’t stop you from being able to create automations for those devices!

In this release, we have introduced the new zwave_js.value_updated automation trigger type which will allow you to trigger an automation off of any Command Class value that Z-Wave JS supports!

In order to leverage this trigger type in the UI, you will have to use device automations, but if you are writing your automations in YAML, you can use the trigger directly.

That’s not all for Z-Wave JS integration, we have more to share!

  • Tired of your child flipping that switch that’s fully automated? Use the new select entity for the Protection Command Class to disable local access.
  • Don’t want to specify the tone and volume every time you activate your siren? Now you have access to the default volume via a number entity and the default tone via a select entity.
  • We’ve made zwave_js.* services more flexible: They now support area IDs and group entities as inputs!
  • We’ve made basic CC values directly controllable by moving them from using sensor entities to become number entities instead.

New template entities: Number and Select

Yes! We have new platforms you can utilize using the template integration!

Thanks to @raman325 you can now template your own select and number entities! This unlocks quite the potential for creating some advanced user interfaces :)

As an example says more than a thousand words, here are two examples that both are based on a WLED LED strip. It can be used to extract features from the WLED strip into their own entities.

# Example number entity that represents the effect speed on a WLED LED strip
# between 0 and 100%, translating it from an 0 to 255 scale.
template:
  number:
    - name: "Example number: WLED effect speed"
      state: "{{ (( state_attr('light.wled', 'Speed') / 255) * 100) | round }}"
      min: 0
      max: 100
      step: "{{ 1 }}"
      set_value:
        service: wled.effect
        target:
          entity_id: light.wled
        data:
          speed: "{{ (255 / 100) * value }}"
# Example select entity that extracts effects from a light.
# When you change the selected option, the effect of the light changes.
template:
  select:
    - name: "Example select: WLED effect"
      state: "{{ state_attr('light.wled', 'effect') }}"
      options: "{{ state_attr('light.wled', 'effect_list') }}"
      select_option:
        service: light.turn_on
        target:
          entity_id: light.wled
        data:
          effect: "{{ option }}"

Oh! And they can also be used with the new trigger templates! Check out the documentation for all options available.

New template functions for areas

Two new template functions have been added, making working with areas in YAML (when using templating) a little bit easier.

  • area_id("value") returns the area ID for a given value. The value can be a device ID, entity ID, or area name. This function can also be used as a filter.

    example: "{{ area_id('light.living_room_tv') }}"
    example: "{{ area_id('Garden Shed') }}"
    example: "{{ trigger.entity_id | area_id }}"
    
  • area_name("value") returns the area name for a given value. The value can be a device ID, entity ID, or area ID. This function can also be used as a filter.

    service: notify.frenck
    data:
      title: "Motion detected!"
      message: >-
        Motion has been detected in the {{ area_name(trigger.entity_id) }} area.
    

Thanks @raman325!

Other noteworthy changes

There is much more juice in this release; here are some of the other noteworthy changes this release:

  • @balloob added a lot more validations to the energy configuration UI and added more warning/error messages. @ludeeus made them look good by adding a beautiful new styling for these kind of messages.
  • Home Assistant offline and missed generating its energy/long statistics? Not anymore! Home Assistant will now catch up on start, thanks @emontnemery!
  • Thanks to @bdraco, camera images can now be scaled to a resolution that fits the device/screen you are looking at; Additionally, they only update when visible. This makes cameras usable in any bandwidth situation.
  • The Shelly integration now supports transitions for lights! Thanks @bieniu!
  • Yeelight now supports local push (instead of polling), awesome @starkillerOG!
  • @emontnemery upgraded DSMR to support Swedish smart energy meters! Nice!
  • For Yamaha MusicCast, @micha91 has unlocked the Media Browser features!
  • The Rainforest Eagle will now provide pricing data if that is available, thanks @balloob!
  • @giannello added the ability to ask your Google Home where your vacuum cleaner is :)
  • If you use the shopping list feature of Home Assistant, you can now remove all completed items at once using a service call. Thanks, @GrumpyMeow!
  • @bdraco Added a new advanced feature for HomeKit, allowing to forward device events to HomeKit, unlocking the ability to trigger HomeKit automations or scenes.
  • Thanks to @ludeeus, we can now use different brand images in the UI when it is in dark mode.
  • If you have a Sonos speaker, you can now modify the bass & treble level using a service call, thanks @Tigger2014!
  • Utility Meter cycles are now super flexible with the new cron patterns option, nice @dgomes!
  • Bond now provides new services to start/stop increasing/decreasing the brightness of a light. Thanks @bdraco!

New Integrations

We welcome the following new integrations this release:

Integrations now available to set up from the UI

The following integrations are now available via the Home Assistant UI:

Release 2021.9.1 - September 2

Release 2021.9.2 - September 3

Release 2021.9.3 - September 4

Release 2021.9.4 - September 6

Release 2021.9.5 - September 8

Release 2021.9.6 - September 11

Release 2021.9.7 - September 18

If you need help…

…don’t hesitate to use our very active forums or join us for a little chat.

Experiencing issues introduced by this release? Please report them in our issue tracker. Make sure to fill in all fields of the issue template.

Backward-incompatible changes

Below is a listing of the breaking change for this release, per subject or integration. Click on one of those to read more about the breaking change for that specific item.

1-Wire

The previously deprecated YAML configuration of the 1-Wire integration has been removed.

1-Wire is now configured via the UI, any existing YAML configuration has been imported in previous releases and can now be safely removed from your YAML configuration files.

(@epenet - #53728) (onewire docs)

AVM FRITZ!Box Tools

The attributes of the switches provided by AVM FRITZ!Box Tools have been adjusted to match the naming rules and schema of Home Assistant.

If you relied on one of these attributes in your automation or scripts, you’ll need to adopt to this change.

(@AaronDavidSchneider - #54842) (fritz docs)

DSMR

The unit of measurement of gas sensors for DSMR has changed from m3 to .

(@bramkragten - #54110) (dsmr docs)

Epson

The previously deprecated YAML configuration of the Epson integration has been removed.

Epson is now configured via the UI, any existing YAML configuration has been imported in previous releases and can now be safely removed from your YAML configuration files.

(@pszafer - #55045) (epson docs)

Growatt

The previously deprecated YAML configuration of the Growatt integration has been removed.

Growatt is now configured via the UI, any existing YAML configuration has been imported in previous releases and can now be safely removed from your YAML configuration files.

(@frenck - #54325) (growatt_server docs)

HomeKit

The underlying HomeKit protocol version has changed from version 1.0 to version 1.1.

Cameras with motion sensors and some other accessories may need to be reset using the homekit.reset_accessory service or unpaired and paired again.

If after unpairing with your iOS the QR code does not show, the pairings can manually be removed with the homekit.unpair service using the Developer Tools.

(@bdraco - #53780) (homekit docs)

HomeKit Controller

A future release (currently scheduled for 2021.12.0) will remove the (deprecated) air quality platform from the HomeKit Controller integration.

Starting from this release the air quality values have been broken out as their own sensors, making them easier to incorporate in your dashboard widgets, graphs and automations.

If you relied on an air quality entity (provided by the HomeKit Controller integration) in your automation or scripts, you’ll need to adopt to this change.

(@Jc2k - #54673) (homekit_controller docs)

IKEA TRÅDFRI

The legacy code, which imported hosts from a JSON file have been removed. If you relied on that, please follow the instructions to setup the hosts (can be detected automatically).

To avoid this, upgrade to 2021.8.x first (which will automatically import the hosts from the JSON file) and then upgrade to latest release.

(@janiversen - #54452) (tradfri docs)

Lutron

If (and only if) you currently attempt to make use of the (previously ambiguous) Lutron button events in an automation, then you will need to switch to the new, unambiguous name. That said, since the current events are ambiguous they are not very useful.

(@nickovs - #53666) (lutron docs)

MQTT

MQTT fan no longer supports the legacy speeds (OFF, LOW, MEDIUM, HIGH). With release 2021.3 the support for legacy speeds was announced to be removed after a quarter (2021.7).

With removing the legacy speeds support, integrations that rely on MQTT fan platform that still use legacy speeds would break because they can not be setup if deprecated attributes are used. This includes the MQTT auto discovery.

To prevent that these integrations will fail to setup, the deprecated attributes listed here are still allowed in the config:

  • payload_high_speed
  • payload_low_speed
  • payload_medium_speed
  • speed_command_topic
  • speeds
  • speed_state_topic
  • speed_value_template

(@jbouwh - #54768) (mqtt docs)

The last_reset_topic configuration variable for MQTT sensor is deprecated, last_reset_value_template is still supported but will use the state_topic if no last_reset_topic is configured.

In Home Assistant core 2021.10, it will no longer be possible to configure a last_reset_topic.

(@emontnemery - #55463) (mqtt docs)

MySensors

MySensors lights no longer supports deprecated white_value, use rgbw_color instead.

(@emontnemery - #52068) (mysensors docs)

Nanoleaf

The Nanoleaf integration migrated to configuration via the UI. Configuring Nanoleaf via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

If you have configured Nanoleaf with the discovery integration: You can remove discovery: from your YAML configuration if you only used it for Nanoleaf. The .nanoleaf.conf file in your configuration folder is no longer used, you can delete it after upgrading.

(@milanmeu - #52199) (nanoleaf docs)

Nmap Tracker

The Nmap Tracker integration migrated to configuration via the UI. Configuring Nmap Tracker via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

To disable creation of new entities, use the the system option to disable new entities for the config entry, and manually enable entities as needed.

(@bdraco - #54715) (nmap_tracker docs)

OVO Energy

These attributes have been removed and replaced with full sensors for both gas and electricity:

  • start_time
  • end_time

If you relied on one of these attributes in your automation or scripts, you’ll need to adopt to this change.

(@timmo001 - #54952) (ovo_energy docs)

Rainforest Eagle-200

The Rainforest Eagle-200 integration migrated to configuration via the UI. Configuring Rainforest Eagle-200 via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

(@balloob - #54846) (rainforest_eagle docs)

SimpliSafe

SimpliSafe locks no longer have a jammed attribute; instead, when jammed, they will show a jammed state.

If you are currently using the jammed attribute in your automation or scripts, you’ll need to adapt them to this change.

(@bachya - #54006) (simplisafe docs)

Smappee

The power and energy attributes from switch entities have been removed and replaced by sensors.

If you relied on these attributes in your automations, scripts or Lovelace dashboards, you’ll need to update your configuration to match this change.

(@bsmappee - #54329) (smappee docs)

Solar-Log

The Watt-peak unit of measurement has changed to W.

(@Ernst79 - #55110) (solarlog docs)

Supervisor

The usage of “snapshot” is deprecated, from now “backup” is used instead.

  • The service snapshot_full is now named backup_full, the service snapshot_full will be removed in Home Assistant 2021.11.
  • The service snapshot_partial is now named backup_partial, the service snapshot_partial will be removed in Home Assistant 2021.11.
  • Using snapshot in the data for the restore_full and restore_partial services is deprecated and will be removed in Home Assistant 2021.11, use slug instead.

Old examples:

service: hassio.snapshot_full
data:
  name: "Awesome full snapshot"
...
service: hassio.snapshot_partial
data:
  name: "Awesome partial snapshot"
  addons:
    - awesome_addon
...
service: hassio.restore_full
data:
  snapshot: sn2321
...
service: hassio.restore_partial
data:
  snapshot: sn2321
  addons:
    - awesome_addon

New examples:

service: hassio.backup_full
data:
  name: "Awesome full snapshot"
...
service: hassio.backup_partial
data:
  name: "Awesome partial snapshot"
  addons:
    - awesome_addon
...
service: hassio.restore_full
data:
  slug: sn2321
...
service: hassio.restore_partial
data:
  slug: sn2321
  addons:
    - awesome_addon

(@ludeeus - #53851) (hassio docs) (zwave_js docs)

Tesla Powerwall

The Tesla Powerwall attributes for energy_exported_(in_kW) and energy_imported_(in_kW) have been converted to their own energy sensors.

If you relied on those attributes in your automation or scripts, you’ll need to adapt them to this change.

(@bdraco - #54018) (powerwall docs)

Toon

The unit of measurement of gas and water sensors for Toon has changed from m3 to .

(@bramkragten - #54110) (toon docs)

UpCloud

The previously deprecated YAML configuration of the UpCloud integration has been removed.

UpCloud is now configured via the UI, any existing YAML configuration has been imported in previous releases and can now be safely removed from your YAML configuration files.

(@scop - #54516) (upcloud docs)

Uptime Robot

The Uptime Robot integration migrated to configuration via the UI. Configuring Uptime Robot via YAML configuration has been deprecated and will be removed in a future Home Assistant release.

Your existing YAML configuration is automatically imported on upgrade to this release; and thus can be safely removed from your YAML configuration after upgrading.

(@ludeeus - #53938) (uptimerobot docs)

Wink

The Wink integration has been deprecated and is pending removal in Home Assistant 2021.11.

Their developer portal, needed for obtaining an API token, has been taken offline and their customer support has confirmed no new token or client/secret can be obtained. This makes it impossible to use this integration.

(@frenck - #54496) (wink docs)

Xiaomi Miio

The following fan entity attributes temperature, humidity, aqi, purify volume, filter life remaining, filter hours used, co2, illuminance, motor speed and motor2 speed have been migrated to their own sensor entities.

If you relied on those attributes in your automation or scripts, you’ll need to adapt them to this change.

The filter_rfid_product_id and filter_rfid_tag fan entity attributes have been removed as they are of little use to keep around.

(@bieniu - #54564) (xiaomi_miio docs)


The service fan_set_led_brightness is removed and the Led Brightness select entity has been created instead.

If you relied on this service in your automation or scripts, you’ll need to adapt them to this change.

(@bieniu - #54702) (xiaomi_miio docs)


The previously (deprecated and old style) speeds, speed list and speed services have been removed.

(@SmaginPV - #54182) (xiaomi_miio docs)


The services fan_set_buzzer_on, fan_set_buzzer_off, fan_set_led_on, fan_set_led_off, fan_set_child_lock_on, fan_set_child_lock_off, fan_set_auto_detect_on, fan_set_auto_detect_off, fan_set_learn_mode_on and fan_set_learn_mode_off have been removed.

Switch entities have been created to replace those.

If you relied on one of these services in your automation or scripts, you’ll need to adapt them to this change.

(@bieniu - #54834) (xiaomi_miio docs)


The previously deprecated YAML configuration of the Xiaomi Miio integration has been removed (with the exception of the remote platform).

Xiaomi Miio is now configured via the UI, any existing YAML configuration has been imported in previous releases and can now be safely removed from your YAML configuration files.

(@rytilahti - #54930) (xiaomi_miio docs)


The services fan_set_favorite_level, fan_set_fan_level, and fan_set_volume have been removed and number entities have been created instead.

If you relied on one of these services in your automation or scripts, you’ll need to adapt them to this change.

(@bieniu - #54977) (xiaomi_miio docs)

Z-Wave JS

The Basic CC always comes with two values, currentValue and targetValue.

We currently only have a discovery schema for currentValue which creates a sensor, making these Basic CC values noninteractive. As of this release we will create a number platform entity for Basic CC values instead of sensors.

(@raman325 - #54512) (zwave_js docs)


If you have created an automation with the zwave_js device condition Current value of a Z-Wave Value for the CONFIGURATION Command Class, your automation will no longer work.

Instead, you should use the Config parameter device condition for the value you were trying to use for your condition.

(@raman325 - #54962) (zwave_js docs)

Custom integrations: Cameras

This breaking change is only relevant to custom integration authors!

The function signature for async_camera_image and camera_image has changed to include a width and height.

    async def async_camera_image(
        self, width: int | None = None, height: int | None = None
    ) -> bytes | None:

The goal of the change is to reduce the overhead of sending large images that will only be displayed as small images as this can quickly consume hundred of megabytes of bandwidth / mobile data allocation. Scaling should be done on a best effort basis and is not a strict requirement as the existing behavior of falling back to scaling at the display layer is preserved.

  • Integrations should pass on the width and height if the underlying camera is capable of scaling the image.

  • Integrations may choose to ignore the height parameter in order to preserve aspect ratio

  • If the integration cannot scale the image and returns a jpeg image, it will automatically be scaled by the camera integration when requested.

(@bdraco - #53835)

Custom integrations: Sensors

This breaking change is only relevant to custom integration authors!

Although not a breaking change from a user’s perspective, this is a significant change from a developer’s perspective.

Temperature conversions are moving from the Entity base class to the SensorEntity base class.

Additionally, we have two new properties, native_value (which replaces state) and native_unit_of_measurement which replaces unit_of_measurement.

Read all about it in the developer blog:

https://developers.home-assistant.io/blog/2021/08/12/sensor_temperature_conversion/

(@emontnemery - #48261) (abode docs) (sensor docs)


Additionally, a new sensor state class has been introduced: total_increasing.

This changes the measurement state class that was used in conjunction with the last_reset attribute. For more information about his can be found in the developer blog about it:

https://developers.home-assistant.io/blog/2021/08/16/state_class_total/

All changes

Click to see all changes!