2021.8.0:感受能源的力量 ⚡️

八月快乐!☀️

Home Assistant 核心 2021.8 来了,而这正是我期待了好几个月的发布!这里面有太多让人兴奋的新内容,我都不知道该从哪里开始说起。

最令人兴奋的部分,是 Home Assistant 新增了一个全新的核心关注点:

Home Energy management.

这对很多人来说都意义重大,不管你是为了环保,还是单纯想省点钱(或者两者都有 😬)。想到未来它会成为一个持续投入的重点,我真的觉得很棒。

但除了能源管理本身,我也很期待它带来的那些“副产品”。很多为 Energy 打造出来的东西,其实也都可以复用到其他场景!这不正是我们的风格吗?

我们得到了长期统计、全新又漂亮而且速度飞快的图表,以及 Lovelace 的一种新布局选项。所有这些构件都可以被自定义和复用。我很期待看到大家会怎样把它们玩出花来。

总之,祝你享受这次发布!也别忘了稍后参加 YouTube 上的发布派对,活动将在今天稍晚的欧洲中部时间晚上 9 点开始。

../Frenck

Matthias de Baat 加入 Nabu Casa

先宣布一则消息:Matthias de Baat 将加入 Nabu Casa 团队,作为 UX 设计师参与 Home Assistant 的工作。

UX 是 “User Experience(用户体验)” 的缩写,这正是 Matthias 的专业领域,也是他接下来要重点改进的方向。他的目标是让 Home Assistant 更易用,并让所有人都能更方便地使用它。他会建立设计流程与工具体系、进行用户研究,并产出设计方案。

如果你有兴趣加入 Home Assistant 用户研究小组,可以填写 Matthias 准备好的这份 Google 表单 来表达你的意愿。

欢迎 Matthias!很高兴你加入我们!

但等等!还有更多!

ESPHome 的创始人 Otto Winter 也会在暑假期间加入 Nabu Casa!欢迎 Otto!这个夏天注定会非常精彩!

Home Energy Management!

这个功能非常重要,它是一个全新方向的开始。Home Assistant 将为你提供关于家庭能源使用情况的洞察。

不过,这件事不该只用发布说明里的一小段来介绍,它值得拥有自己的一篇博客!所以,现在请先暂停阅读这篇发布说明,去看看 Paulus 为此写的那篇文章:

阅读这篇介绍 Home Assistant 全新家庭能源管理功能的博客

长期统计

如果使用 recorder 长时间存储传感器数据,你的数据库会增长得非常快(特别是当你有很多频繁更新的传感器时!)。

在前几个版本中,我们一直在努力改善这个问题,并为在数据库中追踪统计数据打下基础;而在这次发布中,我们正式把它广泛开放出来!

集成现在可以告诉 Home Assistant 某个传感器数值代表的类型,从而让我们能以更高效的方式处理并存储这些数据。每小时,我们会计算平均值、最大/最小值,或该小时内产生的差值,并只把这些结果存进长期统计中。

这些统计数据是新 Energy 仪表板的重要基础之一,不过它们也可以用于别的地方:比如全新的 Lovelace statistics graph 卡片

Screenshot of the new Lovelace statistics graph 卡片 Screenshot of the new Lovelace statistics graph 卡片.

这张卡片可以绘制非常漂亮的图表,让你把任意已存储的长期统计数据可视化出来。它可以渲染为折线图或柱状图。柱状图适合那些具有累计值的 metered 实体,而折线图则非常适合展示实体的 meanminmax

目前长期统计的支持范围还比较有限。我们预计会在接下来的版本中逐步开放到更多测量类型,同时也会有更多集成加入对这些新测量类型的支持。

侧边栏视图

你在 Lovelace 中看到的默认布局(也是我们大多数人平时用的布局)叫做 “masonry”。我们也有一种 panel 视图/布局,可以让单个卡片铺满整个视图。这次发布带来了一种全新的视图布局:侧边栏。

这个新的侧边栏视图有两列:左侧是一列较宽的主区域,右侧是一列较窄的附加区域。它非常适合显示图表(比如那张漂亮的新统计图卡片)或地图这类较大的卡片,同时在右侧放上一些附带信息的小卡片。

新的 Energy 仪表板已经使用了这种新视图布局;当然,它同样也可以用在其他 Lovelace 仪表板中。

Screenshot of new Lovelace 侧边栏 view layout Screenshot of new Lovelace 侧边栏 view layout.

Gauge 卡片现在支持指针模式

Lovelace gauge 卡片迎来了一项很棒的小增强:指针模式!

在指针模式下,它不再只是显示一个数值并填充部分仪表,而是会显示完整仪表盘,并用指针指出当前值。而且,如果你在 gauge 卡片配置中设置了严重级别,它也会始终显示出来。

Screenshot of the Gauge 卡片 in needle mode with severity configured Screenshot of the Gauge 卡片 in needle mode with severity configured.

这些设置现在可以直接在 Lovelace UI 编辑器中完成;更多信息和示例可以查看 Gauge 卡片文档

核心货币设置

为了支持财务数值的显示,我们为 Home Assistant 新增了一项设置,让你可以定义在需要你提供货币信息时,Home Assistant 应该使用哪种货币。

你可以在 Home Assistant 的常规设置中找到这个新的货币设置。

这项设置会被用于新能耗功能中的费用计算。

警报器

在上一个发布中,我们介绍了 select 实体;而这一次,我们带来了 siren 实体!🚨

Thanks to @raman325 for adding this noisemaker to the family! He also implemented the first 集成 to add support for Sirens: the Z-Wave JS 集成. So, if you have a Z-Wave enabled Siren, you can now control it.

上锁、解锁与卡住

多亏了 @bdraco,Home Assistant 里的门锁从今天开始变得更聪明了一点。除了 locked 和 unlocked 状态之外,现在还新增了 locking、unlocking 以及 jammed 状态支持。

Support for these new 状态 has been added to the August, HomeKit Controller and template 集成. Additionally, HomeKit, Alexa and Google Assistant have been made compatible and aware for these 状态 as well.

脚本 / 自动化 / 模板

这次发布为脚本、自动化和模板带来了一些新功能。

this

当一个自动化或脚本被触发运行时,现在会有一个新的变量可用:this。这个变量包含当前正在运行的自动化或脚本的状态对象,让你可以直接访问与该自动化相关的信息。感谢 @r-t-s

设备模板函数

如果你喜欢手写 YAML 自动化、也会用模板,并且需要设备 ID 或设备信息,那你大概已经知道:这些 ID 很难找,而设备信息往往又根本拿不到。

@raman325 added some new template functions that can be helpful when working with 设备.

  • device_entities(device_id) returns a list of 实体 associated with a given 设备 ID (can also be used as a filter).
  • device_attr(device_or_entity_id, attr_name) returns the value of attr_name for the given 设备 ID or 实体 ID.
  • is_device_attr(device_or_entity_id, attr_name, attr_value) returns whether the value of attr_name for the given 设备 ID or 实体 ID matches attr_value.
  • device_id(entity_id) returns the 设备 ID for a given 实体 ID (can also be used as a filter).

感谢这些强大的新功能!

其他值得注意的变化

这次发布还有很多内容;下面是其中一些同样值得关注的变化:

  • Thanks to @firstof9, Z-Wave JS now has support for transitions with 灯光!
  • More Z-Wave JS improvements by @raman325. He added support for 设备 触发器 and 条件. Thanks!
  • You can now assign a unique ID to 灯光, 遮盖 and media player groups, allowing you to manage them from the Home Assistant 前端 and assign them to an area!
  • The motionEye 集成 now has support for motion detection, thanks @dermotduffy
  • ZHA can now work with Formaldehyde and VOC level 传感器, thanks @Adminiuga
  • @posixx added a new feature for 集成 that provide 报警 面板; those 集成 can now 更新 to support Vacation mode!
  • Rainbird now has a 服务 to change the rain delay, thanks @Kr0llx!
  • If you are using BMW Connected Drive, @EddyK69 added a lot of trip 传感器.
  • Sonos snapshots now behave, are more robust and work as expected. Additionally, support for controlling crossfade has been added, thanks @jjlawren!
  • WLED now supports controlling the new playlists features introduced in WLED 0.13.
  • @farmio added support for KNX 灯光 that use HS-colors, thanks!
  • And @joncar added support for transitions to LiteJet 灯光, awesome!
  • If you have MFA on your Tesla account, thanks to @BreakingBread0, the 集成 now supports that.
  • When using the Netatmo 集成, you can now control the schedule it should be using with a select 实体. Thanks, @cgtobi!
  • @janiversen added more data types to modus and added array write to the 打开/off capabilities of Modbus 开关, 风扇 and 灯光.
  • Advantage Air now has temperature 传感器 for each zone, thanks @Bre77!
  • Gree 温控 now has 开关 to support more modes, thanks to @cmroche!
  • You can now remove holidays from the workday 传感器 by name instead of date. This is useful for holidays they don't have a fixed date each year. Thanks @matthewgottlieb!
  • HomeKit will not auto-recreated TVs when sources are out of sync. One thinsg less to worry about, thanks @bdraco
  • @jbouwh has drastically reworked and extended the 加湿器 support for the Xiaomi Miio 集成. Amazing job!

新集成

欢迎以下新集成加入本次发布:

新平台

以下集成新增了对新平台的支持:

现已支持通过 UI 设置的集成

以下集成现在可以直接通过 Home Assistant UI 进行设置:

发布 2021.8.1 - August 4

发布 2021.8.2 - August 5

发布 2021.8.3 - August 6

发布 2021.8.4 - August 8

发布 2021.8.5 - August 9

发布 2021.8.6 - August 10

发布 2021.8.7 - August 15

发布 2021.8.8 - August 18

如果你需要帮助……

……欢迎随时使用我们非常活跃的论坛,或者加入我们的聊天频道

如果你遇到了这次发布引入的问题,请到我们的 issue tracker 提交反馈,并确保填写问题模板中的所有字段。

破坏性变更

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

The previously deprecated YAML 配置 of the Abode 集成 has been removed.

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

(@frenck - #52357) (abode docs)

The Air Quality platform has been marked as deprecated, therefore the air_quality 实体 has been removed and replaced with sensor 实体.

If you used the air_quality 实体 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@bachya - #52349) (airvisual docs)


状态 for the "Pollutant Level" and "Main Pollutant" 实体 have changed; 自动化 that depended on the old 状态 will need to be updated.

Pollutant Level:

  • Good -> good
  • Moderate -> moderate
  • Unhealthy -> unhealthy
  • Unhealthy for sensitive groups -> unhealthy_sensitive
  • Very unhealthy -> very_unhealthy
  • Hazardous -> hazardous

Pollutant Label:

  • Carbon Monoxide -> co
  • Nitrogen Dioxide -> n2
  • Ozone -> o3
  • PM10 -> p1
  • PM2.5 -> p2
  • Sulfur Dioxide -> s2

(@bachya - #53133) (airvisual docs)

The previously deprecated YAML 配置 of the Ambient Weather Station 集成 has been removed.

Ambient Weather Station is now configured via the UI, any existing YAML 配置 has been imported in previous releases and can now be safely removed from your YAML 配置 files.

(@bachya - #52459) (ambient_station docs)

In order to optimize 设备 load and avoid exhausting available connections, fritz_netmonitor has been merged into fritz.

Please remove your YAML existing 配置 and 配置 the new 集成.

(@chemelli74 - #52264) (fritz docs)


The profile 开关 introduced in the previous 发布 have been removed as they where incompatible with the Home Assistant architectural design rules.

Instead, you can now block every 设备 connected individually.

(@AaronDavidSchneider - #52721) (fritz docs)

The power and energy 属性 from 开关 实体 have been removed and replaced by 传感器.

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@mib1185 - #52562) (fritzbox docs)

The YAML 配置 for 此integrations has changed. Instead of a 传感器 config with platform section, an 集成 配置 section under the 集成 domain key should be used.

Before:

sensor:
  - platform: bme280
    name: "Stary_Oskol"

After:

bme280:
  - name: "Stary_Oskol"

(@Kuzj - #48775) (bme280 docs)

The power and energy 属性 from 开关 实体 have been removed and replaced by 传感器.

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@Danielhiversen - #53342) (broadlink docs)

The previously deprecated YAML 配置 of the Buienradar 集成 has been removed.

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

(@frenck - #52939) (buienradar docs)

The CO2 Signal 集成 migrated to 配置 via the UI. Configuring CO2 Signal via YAML 配置 has been deprecated and will be removed in a future Home Assistant 发布.

Your existing YAML 配置 is automatically imported on 升级 to this 发布; and thus can be safely removed from your YAML 配置 after upgrading.

(@Danielhiversen - #53193) (co2signal docs)

Demo 开关 实体 no longer reports current_power_w and today_energy_kwh 属性.

(@thecode - #52424) (demo docs)

The consumptions 属性 from the 开关 实体 have been removed and replaced by 传感器.

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@Shutgun - #53335) (devolo_home_control docs)

The Air Quality platform has been marked as deprecated, therefore the air_quality 实体 has been removed and replaced with sensor 实体.

If you used the air_quality 实体 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@bieniu - #52295) (gios docs)

Home Assistant will no longer expose the legacy 风扇 speeds to Google Assistant.

If you use 风扇 with with Google Assistant, you'll need to resync your 设备. Ask you Google 设备 to Sync my device or 触发器 an 更新 via the google_assistant.request_sync 服务.

(@elupus - #53105) (google_assistant docs)

Previously the on/off 开关 provided to HomeKit by 脚本, would enable or disable a 脚本. This likely was not what is expected as Hey Siri turn on "script" would appear to do nothing.

Pressing a 脚本 开关 in HomeKit now runs the 脚本 instead.

(@bdraco - #53106) (homekit docs)

HomeKit Controller was using the wrong ID to track some 传感器. The following are affected:

  • Koogeek or Eve power 传感器 (added in Jan 2021)
  • The temperature 传感器 added alongside homekit 温控 设备 (added in Jul 2021, the 温控 entities itself is not affected)

If you have one of these you may need to remove a stale 实体 registry entry and you may need to fix the names of these 实体 as customizations may be lost.

(@Jc2k - #53848) (homekit_controller docs)


If you have a power 传感器 for a Eve Energy or Koogeek P1EU/SW2, the units for that 传感器 has changed from watts to W to properly follow Home Assistant standards.

(@Jc2k - #53877) (homekit_controller docs)

The Honeywell 集成 migrated to 配置 via the UI. Configuring Honeywell via YAML 配置 has been deprecated and will be removed in a future Home Assistant 发布.

Your existing YAML 配置 is automatically imported on 升级 to this 发布; and thus can be safely removed from your YAML 配置 after upgrading.

(@rdfurman - #50731) (honeywell docs)

Routers currently in unauthenticated mode need to be provided credentials for duration of one successful startup in order to retrieve a unique id from the API. Unauthenticated mode can then be enabled for subsequent starts in 集成 options.

(@scop - #49878) (huawei_lte docs)

The power and energy 属性 from 开关 实体 have been removed and replaced by 传感器.

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@peternijssen - #53397) (spider docs)

The Jewish Calendar 集成 returned a datetime format that wasn't properly formatted according to ISO standards. This has been adjusted.

If you rely on manually parsing of dates that are returned from 此integrations, you might need to adjust your templates to incorporate this change.

(@frenck - #52722) (jewish_calendar docs)

The Lyft 集成 has been deprecated and is pending removal in Home Assistant 核心 2021.10.0. It is considered impossible to obtain API keys to be able to use 此integrations.

(@frenck - #53005) (lyft docs)

The consumption_today and consumption_total from the 温控 实体 have been removed and replace by 传感器.

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@Danielhiversen - #52311) (mill docs)

All 实体 are set to unavailable during loading of modbus 集成 and remain so until data is received. 实体 with scan_interval = 0 (entities without polling) are always available, to allow 服务 calls.

The old 配置 style with setting scan_interval: 9999 will cause the 实体 to be unavailable for 9999 seconds.

(@janiversen - #53155) (modbus docs)

The power and energy 属性 from 开关 实体 have been removed.

If you relied on these 开关 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

This measurement (S_POWER, V_WATT) will still be reported as previously by the power 传感器 实体.

(@MartinHjelmare - #53566) (mysensors docs)

This includes a few changes to the names of the exported Prometheus metrics, which now better align with Prometheus naming guidelines:

  • Default value for the namespace 配置 variable is now homeassistant, and all metric names now have a default homeassistant_ prefix.
  • Some metrics have been renamed:
    • light_state renamed to light_brightness_percent.
    • temperature_c renamed to climate_target_temperature_celsius.
    • current_temperature_c renamed to climate_current_temperature_celsius.
    • 传感器 metrics now have a sensor_ name prefix.
    • Temperature 传感器 metrics now have a _celsius unit suffix (as opposed to just _c).

Note, that users that don't currently explicitly set the namespace variable will see names changed for all exported metrics. If keeping existing metric names is important to you, you can adjust your Home Assistant and Prometheus 配置 as described below.

To keep metrics exported without the homeassistant_ prefix, explicitly set an empty namespace in Home Assistant 配置:

prometheus:
  namespace: ""

To revert the other metric name changes, you can use metric_relabel_configs in your Prometheus 配置 file to rename the metrics after scraping. This set of relabeling rules is a good starting point, but please note that if you set a non-empty namespace in Home Assistant you will need to adjust these rules accordingly.

(@knyar - #50156) (prometheus docs)

The previously deprecated 风扇 speed and room size 属性 have been removed. They have now have got their own 实体.

(@milanmeu - #53611) (rituals_perfume_genie docs)

The previously deprecated YAML 配置 of the Synology DSM 集成 has been removed.

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

(@mib1185 - #53197) (synology_dsm docs)

The previously deprecated YAML 配置 of the Tibber 集成 has been removed.

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

(@Danielhiversen - #53235) (tibber docs)

The power and energy 属性 from 开关 实体 have been removed and replaced by 传感器. This applies to all five extra 属性 about energy (current_power_w, total_energy_kwh, today_energy_kwh, voltage, current_a).

If you relied on these 属性 in your 自动化, 脚本 or Lovelace 仪表盘, you'll need to 更新 your 配置 to match this change.

(@mib1185 - #53596) (tplink docs)

The previously deprecated YAML 配置 of the VeSync 集成 has been removed.

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

(@frenck - #52358) (vesync docs)

Viessmann introduced a new API to control their 设备. The original (inofficial API) was shut down which rendered the Home Assistant 集成 useless. This breaking change restores the 集成 functionality

This involves adding a new client_id parameter. It must be set with an API key from the Viessmann developer portal.

Please register and create your private API key. Follow these steps to create your API key:

  1. Register and login in the Viessmann Developer Portal.
  2. In the menu navigate to API Keys.
  3. Create a new OAuth client using following data:
Name: PyViCare
Google reCAPTCHA: Disabled
Redirect URIs: vicare://oauth-callback/everest
  1. Copy the Client ID to the 配置, e.g. client_id="XXXXXXXXXXXXXX"
vicare:
  username: VICARE_EMAIL
  password: VICARE_PASSWORD
  client_id: VICARE_CLIENT_ID

Please not that not all previous properties are available in the new API. Missing properties were removed and might be added later if they are available again.

(@oischinger - #53281) (vicare docs)

The wled.preset 服务 has been deprecated. In the previous Home Assistant 发布, support for an select 实体 that provides access to presets has been added, use that 实体 in your 自动化 and 脚本 instead.

(@frenck - #53383) (wled docs)


The playlist 属性 from the WLED 灯光 实体 has been removed and replaced by a playlist select 实体 instead of the 属性.

If you relied on the 属性 in your 自动化 or 脚本, you need to adjust those to use the new 实体 instead.

(@frenck - #53381) (wled docs)

Existing Xiaomi Mi 自动化 using the platform specific 服务 for 加湿器 will have a breaking change. You need to change their 自动化 to use new 服务. Existing 风扇 实体 will be automatically replaced with new humidity 实体.

The 实体 name is migrated from the 风扇 实体 name. The 风扇 entity_id will change because the platform will change.

For the related 实体 the old 风扇 实体 name will be prepended to the new 实体.

Example:

实体 with entity_id "风扇.my_device" and name "My 加湿器" will migrate to an 实体 with entity_id "加湿器.my_humidifier" and name "My 加湿器".

A 传感器 for humidity will have a name like "My 加湿器 Humidity".

(@jbouwh - #52366) (xiaomi_miio docs)

The CYale Smart Living 集成 migrated to 配置 via the UI. Configuring Yale Smart Living via YAML 配置 has been deprecated and will be removed in a future Home Assistant 发布.

Your existing YAML 配置 is automatically imported on 升级 to this 发布; and thus can be safely removed from your YAML 配置 after upgrading.

(@gjohansson-ST - #50850) (yale_smart_alarm docs)

Z-Wave JS 实体 will now be in an unavailable 状态 when the parent node is considered dead by Z-Wave JS. This may impact existing 自动化 because Home Assistant will block 服务 calls to unavailable 实体.

A node can potentially be revived by sending a ping to it, therefore you can use the new node status 传感器 (disabled by default) to track node status and use the zwave_js.ping_node 服务 to try to revive the node.

The node status 传感器 will always be available even when the node is dead.

(@raman325 - #48017) (zwave_js docs)

向以下集成告别

The following 集成 are no longer available as of this 发布:

  • Weather Underground has been unavailable and in a non-working 状态 and has therefore been removed. (@frenck - #52999)
  • Garmin Connect has been removed. Due to API changes, it stopped working and cannot function without violating Home Assistant design rules. Garmin will not allow 开源 projects to their official APIs. (@cyberjunky - #52808) (garmin_connect docs)

全部变更