2021.12:全新配置菜单、按钮实体与惊艳的区域卡片!

Home Assistant 核心 2021.12,也就是 2021 年的最后一个发布,来了;而我真的觉得,这次发布里一定有属于每个人的节日礼物!

随着假期季到来,项目也该稍微放慢一点脚步,和家人一起享受时光。再过几周,2022 年就要到了!

在这份 2021 年最后的发布说明里,我最想说的只有一句:谢谢你

谢谢你一直陪着这个项目。谢谢你的贡献,也谢谢你报告问题。谢谢你在论坛、聊天群、Reddit,或任何地方帮助其他 Home Assistant 用户。谢谢你分享自己的经验、想法、自动化、脚本、YouTube 视频和博客;最重要的是: 谢谢你使用 Home Assistant ❤️

假期愉快,也请你在 2021 年最后一次:好好享受这次发布!

../Frenck

附注:因为假期安排,我们将跳过 1 月发布。所以 2022 年的第一个发布,将会是 2022 年 2 月 2 日,星期三。

全新的配置面板

配置面板已经全面翻新。现在的布局更紧凑、分组更清晰,还加入了一些颜色点缀,让你能更快找到自己要找的项目。

Screenshot of the new areas 面板

Supervisor 面板以及它在侧边栏中的入口都已移除,并整合进了配置面板。所有 OS、核心和附加组件更新,现在都会显示在配置面板顶部。

如果你正在使用我们的 Android、iOS 或 macOS Companion 应用,用来配置这些应用的侧边栏菜单也已经移动到了配置面板中。

所有与配置相关的内容,现在都整齐地集中在一个地方 🤘

按钮实体

我们引入了一种新的实体:按钮实体。 没错,就是按钮。你可以拿它做什么?按下去!

Home Assistant 里原本已经有开关实体,但开关是有状态的:不是开,就是关。而按钮更像是按压式按钮,也就是无状态或瞬时型开关。

按钮实体可以由集成提供,适用于像下面这些场景:

Examples use cases of button 实体 按钮实体的示例用法。

这些事情都可以由 Home Assistant 触发,但它们本身并没有明确的开或关状态。

我们已经为 Google Assistant、Alexa 和 HomeKit 加入了对按钮实体的支持;这意味着你现在可以通过喜欢的语音助手来“按下”这些按钮。

在这个版本中,MQTT 和 KNX 已经加入了按钮支持。Shelly、WLED、Elgato、Litter-Robot、TOLO Sauna、Tuya、Renault 和 NAM 集成也都新增了按钮实体。

另外,ESPHome 2021.12 也已经完整支持按钮了!除了重启按钮以外,你现在还可以在 ESPHome 中创建按钮实体,用来从 Home Assistant 触发你的 DIY 项目中的某些动作。

重新设计的区域面板与区域 Lovelace 卡片

区域面板已经重新设计了。它不再只是一个区域列表,而是会为每个区域显示一张卡片。卡片上还能展示该区域的图片。

等等,图片?没错!你现在可以直接在 Home Assistant 前端为区域上传图片。所以它最终看起来可以像这样:

Screenshot of the new areas 面板

但这还不是全部,@zsarnett 还创建了一张全新的区域 Lovelace 卡片。它会使用你为该区域上传的图片,并自动填入分配到该区域中的设备实体。

Screenshot of a new area Lovelace 卡片 新的区域 Lovelace 卡片截图。

只能从本地网络登录的用户

这个新功能可以让你创建一种用户:他们只能从本地网络登录,而不能通过互联网或云端登录。

如果你有一些并不总是在家的用户,或者有一个专门给墙面平板使用、永远不需要远程登录的账户,这个功能就会很实用。

Screenshot of user 配置 in Home Assistant with local only enabled.

Z-Wave JS SmartStart 与实体分类

现在,借助 Z-Wave JS 对 Z-Wave SmartStart 的支持,你在 Home Assistant 中设置 Z-Wave 设备比以往任何时候都更简单。

如果你有支持 SmartStart 的 Z-Wave 控制棒和设备,现在只需要扫描设备上的二维码,不管是用摄像头,还是用安装了 Home Assistant Companion 应用的手机,都能完成设备设置。

把设备加入你的 Z-Wave 网络,从来没有这么轻松过。

Screenshot of scanning the QR code to add a Z-Wave SmartStart 设备 in Home Assistant.

另外,Z-Wave JS 也已经支持实体分类,所以你的 Z-Wave 传感器现在会被整齐地组织起来。

蓝图脚本

其实这个功能已经在 Home Assistant 核心 2021.11 中上线了,但我们完全忘了提……这可太丢人了……现在补上!

你现在可以为脚本创建、提供和分享蓝图了!它的工作方式和自动化蓝图完全一样,只不过这次提供的是脚本。

脚本蓝图可以像现在的自动化蓝图一样被分享和导入。它们对于其他 Home Assistant 用户会非常有帮助,因为这些脚本可以被重复用于其他自动化中。

对任意但仅状态变化进行触发

直到现在,如果你想写一个自动化,让它在某个实体的任意状态变化时触发、但不在属性变化时触发,几乎都必须额外加条件才能实现。

现在我们终于加入了一种方法,让你可以对任意状态变化进行触发,而不会因为属性变化而触发。如果你设置 fromto,但将它留空,它就会匹配任意状态变化,同时忽略属性变化。

automation:
  trigger:
    - platform: state
      entity_id: media_player.living_room
      to: ~

上面的例子只有在客厅媒体播放器的状态发生变化时才会触发,而不会在它的任意属性变化时触发。

同样的语法也支持属性。如果你想在某个特定属性的任意变化时触发,也可以使用类似写法:

automation:
  trigger:
    - platform: state
      entity_id: media_player.living_room
      attribute: volume_level
      to: ~

上面的例子只有在客厅媒体播放器的音量等级变化时才会触发。

Cast 问题已解决

你可能已经注意到,Home Assistant 里的 Google Cast 功能此前存在一些问题。比如把 Lovelace 仪表板投射出去时,稳定性并没有达到应有的水平。

好消息是,这些投射问题现在已经解决了!

虽然这本质上只是一个 bug 修复,但我们认为它的影响足够大,值得在发布说明中特别提一下。

其他值得注意的变化

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

  • The Hue 集成 now only uses the v2 API when talking to compatible hubs. This means that all 灯光 updates and remote presses are instantly available in Home Assistant, and 场景 are now also natively supported. Amazing job, thanks @marcelveldt!
  • @farmio completely rewrote the Fronius 集成 adding support for all the latest, and greatest Home Assistant offers. Nice!
  • Besides supporting the new button 实体, ESPHome now also supports setting the mode and unit of measurement on number 实体. Thanks, @jesserockz!
  • Magic Home (Flux LED) got lots of love from @bdraco, adding support for new 设备 and features along the way.
  • @jbouwh improved the as_datetime template method, which now supports the UNIX timestamp.
  • The motionEye 集成 added 传感器 and 服务, thank you @dermotduffy.
  • WLED 设备 can now be restarted and upgraded from Home Assistant.
  • @chemelli74 added the 温控 platform support for Shelly, and @mib1185 added support for rebooting and upgrading Shelly 设备.
  • 实体 provided by the Vallox 集成 now have unique IDs and can be adjusted from the UI. Thanks @viiru-!
  • The Pi-hole 集成 now has a 二元sensor to indicate an 更新 is available, added by @andreasbrett.
  • System Bridge has two new 服务 for sending keyboard events to the remote machine, added by @timmo001.
  • @klada added support for media player groups to Denon HEOS.
  • The REST platform now supports templates for its headers and query parameters. Thanks, @koying.
  • Mill now supports its 3rd generation heaters, thanks @Danielhiversen
  • @hmmbob added support for ms-MY, nl-BE, pa-IN to Google TTS.
  • Nanoleaf now pushes updates into Home Assistant, thanks @milanmeu.
  • @micha91 extended Yamaha MusicCast with number 实体 for controlling equalizers, dialogue volume/lift, and the display brightness.
  • The Levoit 核心 400S air purifier is now supported by the VeSync 集成, thanks for that @jparchem.
  • The 状态 of number helpers is now exposed to Prometheus. Nice, @alim4r!
  • @tschamm added support for shutter controls to Bosch SHC.
  • 通知 for Android TV can now send a 通知 with custom icons; Awesome adding @redahb!
  • MQTT has seen multiple improvements in this 发布:
    • The select and number platforms now have command_template support (@jbouwh)
    • 开关 now support device_class (@koying)
    • MQTT platforms can now set the object_id option (@Smeagolworms4)
    • Selects can now have a single or no options (@emontnemery)
    • Added '触发器' support for 报警 Control 面板 (@XaF)
    • Added lock.open support (@Hypnos3)

This 发布 adds support for long-term statistics to the following 集成:

And the following 集成 now have 实体 categories:

新集成

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

现在可在 UI 中配置的集成

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

此外,KNX 现在也已经可以部分通过 UI 进行设置。连接部分可在 UI 中完成,而实体依旧像以前一样通过 YAML 配置。由 @marvin-w 完成。

发布 2021.12.1 - December 12

发布 2021.12.2 - December 15

发布 2021.12.3 - December 17

发布 2021.12.4 - December 20

发布 2021.12.5 - December 23

发布 2021.12.6 - December 27

发布 2021.12.7 - December 29

发布 2021.12.8 - January 4

发布 2021.12.9 - January 10

发布 2021.12.10 - January 17

如果你需要帮助……

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

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

破坏性变更

下面按主题或集成列出了本次发布中的破坏性变更。点击对应项目即可阅读该条变更的更多说明。

The customize.yaml UI (customization) has been removed. The YAML 配置 for this is recommended and remains available. To customize 实体, use the 实体 设置 available via the icon in the top right of the 实体 "more info" dialog (when clicking on an 实体). 实体 设置 now also allows customizing device_class for certain binary_sensor and cover cases.

A small explanation why it has been removed:

With customize, one is changing the 状态 machine directly, without any checks. This comes at a risk. Additionally, for many use cases (like: name, icon, 设备 class) one should edit the 实体 via the UI instead, which is possible for the greater part of the 实体 nowadays.

The old customize UI is confusing in many ways and has a level of power that, if wielded incorrectly, can have unforeseen consequences. Someone found and used the customize UI first, and then things are out of sync throughout the UI, as the internal 实体 registry would show the old values.

The customize UI also relied on setting up an include and YAML 配置 to begin with; which already made it an advanced feature.

Therefore, the customize UI was removed and remains available as an advanced YAML feature, additionally we have added the capability, to adjust the common device_class changes using the "Show as" feature while editing the 实体 from UI.

The Supervisor 面板 has been merged into the 配置 面板. The separate menu item from the 侧边栏 has been removed.


The binary_sensor with "running" device_class that was provided for the Home Assistant Operating System 设备 did not work and has now been removed; If you have added this to templates or 自动化, remove it from your 配置.

(@ludeeus - #60597) (hassio docs)

The Companion App 配置 has been merged into the 配置 面板. The separate menu item from the 侧边栏 has been removed.

The HVAC mode for zone 温控 实体 was set to FAN or OFF, because the actual HVAC mode is set for the entire ducted AC system. However, using 风扇 means the Google Home app won't let you set a target temperature, so it has been changed to AUTO instead.

(@Bre77 - #52816) (advantage_air docs)

The following 服务/传感器 have been removed due to not being available using the My BMW API:

  • alltrips_*
  • lasttrips_*
  • chargingconnectiontype
  • charginginductivepositioning
  • lastchargingendreason
  • lastchargingendresult
  • maxelectricrange

属性 of binary_sensor.doors and binary_sensor.windows do not start with door/window anymore.

notify requires a location 属性 at data.location, as the MyBMW API only supports sending POI and not messages.

The find_vehicle 服务 will always send the location of your Home Assistant instance to BMW.

(@rikroe - #59881 #60938) (bmw_connected_drive docs)

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

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

Additionally, the Brunt 集成 can now be reloaded via the 集成 screen in the 前端 and will also 重载 if a Brunt 设备 is removed from your account.

(@eavanvalkenburg - #49714) (brunt docs)

The Fronius 集成 migrated to 配置 via the UI. Configuring Fronius 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.

This change will remove manual 配置 of Fronius 设备 IDs. Connected SolarNet 设备 will be detected automatically on startup.

(@farmio - #59686) (fronius docs)

Guardian 服务 have been reorganized and now utilize a Home Assistant selector (设备 ID) instead of using a Guardian 实体.

(@bachya - #58632) (guardian docs)

This 发布 removes the air quality from HomeKit Controller as the platform has been previously deprecated.

The air quality values have been broken out as their own 传感器 starting from September, making them easier to incorporate in your 仪表盘 widgets, graphs, and 自动化. These should be used instead.

(@Jc2k - #60480) (homekit_controller docs)

Events for Hue remotes/开关

Philips/Signify streamlined the events that are emitted for remotes/开关; these are now no longer 设备 specific but more generic. This means that if you're relying on the hue_event to 触发器 events emitted by these 设备, the event_data will now be slightly different. To easily identify what events get emitted by your Hue remotes, Open 开发者工具 and subscribe to the hue_event.

灯光 实体 for Hue rooms/zones

实体 for Hue groups (zones/rooms) will be imported but in a disabled 状态 by default. The 集成 option to enable Hue groups has been phased out in favor of the default Home Assistant functionality to enable/disable 实体.

To enable any (new) 灯光 实体 for Hue groups: Open 设置 --> 集成 --> Hue --> 实体 --> Click one of the disabled 实体 and enable it.

Existing Hue group 灯光 for rooms/zones will be migrated as enabled 实体.

Legacy Hue groups of type LightGroup (which are not visible in the official Hue app) will no longer be supported!

实体 for Hue 场景

If you create any 场景 for your Hue zones/rooms, these will now be automatically imported to Home Assistant as 场景 实体, including support for the new Hue Dynamic 场景. You can disable any 场景 实体 you don't like to use in Home Assistant (or delete them in the Hue app).

(@marcelveldt - #58996) (hue docs)

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

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

Additionally, the KNX 集成 can now be reloaded via the 集成 screen in the 前端, and thus the knx.reload 服务 has been removed.

(@marvin-w - #59377) (knx docs)


The last_knx_update 属性 has been removed from the KNX 传感器 and 二元sensor. The last_update 属性 can be used alternatively.

If you are relying on this 属性 in your 自动化 or 脚本, you will need to adjust them to this change.

(@farmio - #58786) (knx docs)


The 配置 key event_filter is now deprecated and will be removed in a future 版本 of Home Assistant. Please use the new event config key instead.

(@farmio - #57621) (knx docs)

The "Battery Strategy" 传感器 has been removed from the Kostal Plenticore 集成. It is replaced by a switch and a select 实体 to allow setting the battery charging 设置 from Home Assistant.

(@slowflyer - #56529) (kostal_plenticore docs)

The litterrobot.reset_waste_drawer and litterrobot.set_wait_time 服务 are deprecated and replaced by dedicated button 实体; please use those instead.

(@natekspencer - #59734) (litterrobot docs)

The previously deprecated MDI icons, now have been removed.

The following icons have been removed:

  • adobe-acrobat
  • adobe
  • amazon-alexa
  • amazon
  • android-auto
  • android-debug-bridge
  • bandcamp
  • battlenet
  • blogger
  • buffer
  • cash-usd-outline
  • cash-usd
  • cellphone-android (alternative: cellphone)
  • cellphone-iphone (alternative: cellphone)
  • concourse-ci
  • currency-usd-circle
  • currency-usd-circle-outline
  • do-not-disturb-off (alternative: minus-circle-off)
  • do-not-disturb (alternative: minus-circle)
  • douban
  • file-pdf (alternative: file-pdf-box)
  • file-pdf-outline (alternative: file-pdf-box)
  • file-pdf-box-outline (alternative: file-pdf-box)
  • google-photos
  • home-currency-usd
  • laptop-chromebook (alternative: laptop)
  • laptop-mac (alternative: laptop)
  • laptop-windows (alternative: laptop)
  • microsoft-edge-legacy
  • microsoft-yammer
  • pdf-box (alternative: file-pdf-box)
  • plus-one (alternative: numeric-positive-1)
  • poll-box (alternative: chart-box)
  • poll-box-outline (alternative: chart-box-outline)
  • tablet-ipad (alternative: tablet)
  • telegram
  • untappd
  • vk
  • xamarian-outline
  • xing
  • y-combinator

The following icons have been renamed:

  • apple-airplay to cast-variant
  • application to application-outline
  • application-cog to application-cog-outline
  • application-settings to application-settings-outline
  • bolnisi-cross to cross-bolnisi
  • boom-gate-up to boom-gate-arrow-up
  • boom-gate-up-outline to boom-gate-arrow-up-outline
  • boom-gate-down to boom-gate-arrow-down
  • boom-gate-down-outline to boom-gate-arrow-down-outline
  • buddhism to dharmachakra
  • cellphone-erase to cellphone-remove
  • celtic-cross to cross-celtic
  • christianity to cross
  • christianity-outline to cross-outline
  • face to face-man
  • face-outline to face-man-outline
  • face-profile-woman to face-woman-profile
  • face-shimmer to face-man-shimmer
  • face-shimmer-outline to face-man-shimmer-outline
  • flash-circle to lightning-bolt-circle
  • floor-lamp-variant to floor-lamp-torchiere-variant
  • gif to file-gif-box
  • gradient to gradient-vertical
  • hand to hand-front-right
  • hand-left to hand-back-left
  • hand-right to hand-back-right
  • hinduism to om
  • human-greeting to human-greeting-variant
  • iframe to application-brackets
  • iframe-outline to application-brackets-outline
  • iframe-array to application-array
  • iframe-array-outline to application-array-outline
  • iframe-braces to application-braces
  • iframe-braces-outline to application-braces-outline
  • iframe-parentheses to application-parentheses
  • iframe-parentheses-outline to application-parentheses-outline
  • iframe-variable to application-variable
  • iframe-variable-outline to application-variable-outline
  • islam to star-crescent
  • judaism to star-david
  • monitor-clean to monitor-shimmer
  • pharmacy to mortar-pestle-plus
  • sparkles to shimmer
  • teach to human-male-board
  • television-clean to television-shimmer
  • text-subject to text-long
  • twitter-retweet to repeat-variant
  • voice-off to account-voice-off

The following previously deprecated MQTT 风扇 options are no longer supported and have been removed:

  • payload_high_speed
  • payload_low_speed
  • payload_medium_speed
  • speed_command_topic
  • speed_list
  • speed_state_topic
  • speed_value_template

(@jbouwh - #58992) (MQTT docs)

The 通知 for Android TV 集成 allows you to send custom 通知 to Android TV 设备. Sending a file along with the 通知, allows you to send image files that will show up above the 通知.

Now that support for icons has been added in the same way as images, the file option has been renamed to image to properly identify what you're sending with the 通知.

As such, code and 自动化 that use the file option for an image have to refer to image from now on.

(@redahb - #60159) (nfandroidtv docs)

Screenlogic SCG levels have moved to the number platform to support setting of these values. The 传感器 实体 that previously represented these values will need to be manually deleted in Configuration -> Entities.

(@dieselrabbit - #60872) (screenlogic docs)

The previously deprecated YAML 配置 of the Phone Modem 集成 has been removed. Phone Modem 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.

(@tkdrob - #59526) (modem_callerid docs)

The rainmachine.disable_program, rainmachine.enable_program, rainmachine.disable_zone, and rainmachine.enable_zone 服务 have been removed.

Instead, new 配置 开关 related to each 实体 can be used to enable/disable the program/zone.

(@bachya - #59617) (rainmachine docs)

The renault.charge_start 服务 is deprecated and replaced by a dedicated start charge button 实体; please use that 实体 to start the charge instead.

(@epenet - #59383) (renault docs)

SimpliSafe 服务 have been reorganized and now utilize a Home Assistant selector (设备 ID) instead of using a SimpliSafe system ID.

(@bachya - #58722) (simplisafe docs)

Previously when the inverter was not supplying any power, the 传感器 showed as Unknown. These 传感器 will now show the value of 0, making it more useful for graphs or calculations.

(@rklomp - #59848) (sma docs)

The sonos.set_option 服务 has been removed along with the bass_level and treble_level 属性 on media_player 实体.

Controls for bass and treble adjustments have been moved to dedicated number 实体.

(@jjlawren - #60498) (sonos docs)

All statistical characteristics were removed from 传感器 属性 and are now selectable through state_characteristic as the 状态 of the 传感器. The parameter state_characteristic will become mandatory in a future 发布.

Please adapt the 配置 of your statistics 传感器(s) and expose the characteristic you are interested in directly through state_characteristic. Existing template 传感器 to access individual characteristics can be removed. In case you are interested in multiple characteristics, you need to define multiple statistics 传感器.

Many characteristics were renamed and additional ones were added, including a few for binary source 传感器. Consider opening a feature request if your use case is not directly covered.

(@ThomDietrich - #59867) (statistics docs)

The timestamp_local and timestamp_utc template functions/filters have changed their output format. The timestamp is now formatted to iso standards and contains timezone information.

Previously a timestamp from these would look like: 2016-07-21 16:39:04. Now it is formatted as: 2016-07-21T16:39:04+01:00.

This change may break templates that need a specific format, in those cases, you can use the timestamp_custom template filter instead.

(@jbouwh - #60269)

The Trafikverket Weather Station 集成 migrated to 配置 via the UI. Configuring Trafikverket Weather Station 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 - #60078) (trafikverket_weatherstation docs)

Due to the modernization of the Twente Milieu 集成; the twentemilieu.update 服务 has been removed.

You can now use the homeassistant.update_entity 服务 with the Twente Milieu 集成 as a replacement for the removed 服务.

(@frenck - #59632) (twentemilieu docs)

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

Velbus 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.

(@Cereal2nd - #60411) (velbus docs)

The Viessmann ViCare 集成 migrated to 配置 via the UI. Configuring Viessmann ViCare 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.

(@oischinger - #56691) (vicare docs)

The led_count and max_power 属性 have been removed from the 传感器 实体 that provides the estimated current of the WLED 设备. These have been replaced by their own 传感器 实体.

If you have been using the 属性 in your 自动化 or 脚本, you'll need to adjust those to reflect these changes.

(@frenck - #58839) (wled docs)


The speed, palette name, intensity, and reverse effect indicator 属性 have been removed from the WLED 灯光 实体. They all have been replaced by their own, dedicated, number and 开关 实体.

If you rely on these 属性 in your 自动化 or 脚本, you'll need to adjust those to this change.

(@frenck - #60535) (wled docs)


The wled.effect and wled.preset 服务 have been removed. For both 服务, full replacements are available as normal 实体 in Home Assistant.

If you are still using these 服务 in your 自动化 or 脚本, please replace them with 服务 calls to their native 实体 instead.

(@frenck - #60537) (wled docs)

Only one Home Assistant 设备 was 创建 for a Yamaha MusicCast 设备, and the media player 实体 of all zones were part of this 设备.

As of this 发布, every zone media player will be located in its own Home Assistant 设备. For single zone 设备, nothing will change and all your 自动化, 脚本, 场景, etc., should work in the same way as before.

A new 设备 will be 创建 for multi-zone 设备 for every non-main zone (e.g., zone2 or zone3). The media_player of the main-zone will remain in the original 设备 with all its properties, 脚本, 自动化 and 场景, configured for it.

For other zones, you will have to set the area of the newly generated 设备 for the various zones manually. If you 创建 脚本, 自动化, or 场景 with the 设备 as a target and want them to work for non-main zones, you will have to add the newly added 设备 as a target to your 脚本/自动化/场景.

If you used the media player 实体 as a target, everything should still work like before.

(@micha91 - #58285) (yamaha_musiccast docs)

Some 实体 have been marked as 配置 实体, e.g., default tone of siren 设备 and protection mode of smart plugs.

配置 实体:

  • Are not included in a 服务 call targeting a whole 设备 or area.
  • Are, by default, not exposed to Google Assistant or Alexa.
  • Are shown on a separate 卡片 on the 设备 配置 page.
  • Do not show up on the automatically generated Lovelace 仪表盘.

(@MartinHjelmare - #59157 #58703 #59474) (zwave_js docs)

Updates for custom 集成 开发者

If you are a custom 集成 developer, we have some updates in this 发布 that you may want to take into account for your 集成.

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

mqtt.async_publish is now a coroutine and custom 集成 calling this function needs to be adjusted accordingly.

(@emontnemery - #58441)

The, previously deprecated, homeassistant.const.HTTP_* HTTP status constants have been removed, use stdlib http.HTTPStatus instead.

(@scop - #58380)

Removed util.get_local_ip() in favor of components.network.async_get_source_ip().

Previous implementation was determining local IP based on the routing versus a fixed public ip "8.8.8.8". The new function instead allows to choose the destination and determine local_ip based on the source interface needed to get there.

(@chemelli74 - #58669)

When using datetime and date 设备 classes in 传感器, the returned native value must (respectively) be a datetime or date Python object.

Returning an iso formatted date(time) string in these cases is now deprecated and will write a deprecation 警告 in the 日志. This fallback/backward compatibility will be removed in Home Assistant 2022.2.

(@frenck - #52671)

The (outdated) customize 前端 has been removed, and thus the (now unused) API endpoints for customizing have been removed from the Home Assistant API as well.

(@frenck - #59824)

The use of the MODE_* constants in the number 实体 platform is deprecated. Please use the NumberMode enum instead.

(@frenck - #60614)

The use of the DEVICE_CLASS_* constants and DEVICE_CLASSES constants in all 实体 platforms, has now been depreacted. Instead, use the equavalent DeviceClass StrEnum provided by each platform.

Example:

from homeassistant.components.sensor import SensorDeviceClass

@property
def device_class(self) -> SensorDeviceClass:
    return SensorDeviceClass.TEMPERATURE

(@frenck - #60655 #60658 #60656 #60654 #60651 #60706 #60709 #60720)

Removed two (long time) deprecated helpers:

  • homeassistant.util.sanitize_filename
  • homeassistant.util.sanitize_path

(@frenck - #60859)

The value of ATTR_HA_MATCHING_DOMAINS constant has been updated to replace the hash (-) with underscore (_):

  • Old value: x-homeassistant-matching-domains
  • New value: x_homeassistant_matching_domains

(@epenet - #60283)

MQTT, DHCP, ZerConf, USB and SSDP discovery now provides a dataclass object, instead of using a dictionary.

The dataclass objects have implemented dictionary access for temporary backwards compatibility during this deprecation period.

Dataclasses provided by discovery type:

  • MQTT: MqttServiceInfo (#60191)
  • DHCP: DhcpServiceInfo (#60136)
  • USB: UsbServiceInfo (#60140)
  • ZeroConf: ZeroconfServiceInfo (#60206)
  • SSDP: SsdpServiceInfo (#59931)

(@epenet)

向以下集成告别

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

  • Dyson has been removed. The 集成 has been broken for a long time now, so its time for it to go, (@epenet - #59401)
  • IOTA has been removed. The protocol is no longer compatible/usable with 此integrations. (@lambtho12 - #59380
  • Loop Energy has been removed. Loop has shutdown their API in November 2020. (@cgarwood- #61175)
  • myChevrolet has been removed. It has been broken for 6 months and GM keeps actively hardening their authentication; preventing the 集成 to work. (@sdague - #59629)

全部变更