0.117:Quick Bar、紧凑页眉、YAML 编辑器、Xbox 与模板类型

这趟列车还在继续前进……Home Assistant 核心 0.117 来了!

最近几个版本都很大,这次当然也不例外。不过这次真正有趣的地方,在于它包含了大量细小而实用的改进!我想这就是 Hacktoberfest 的成果吧!

今年 10 月我们看到了疯狂、甚至夸张数量的贡献,也见到了许多新面孔!到目前为止,我们已经处理了 500 多个文档 PR、700 多个核心 PR,以及 150 多个前端 PR!太惊人了!你们真的太棒了!

另外,Home Assistant Conference 也已经正式公布了! 如果你想在首届线上 Home Assistant 大会中担任讲者,记得在 10 月 31 日前提交你的议题

最后,我在写这篇文章的时候,正好也在听 Home Assistant Podcast, 因为他们已经发布了 0.117 对应的节目。🎙 感谢你们一直以来的付出,真的总是听得很开心。

不得不说,我们真的拥有一个超棒的社区,不是吗?😍

../Frenck

PS:哦,今天晚些时候可能还会有点好玩!我们正在考虑在 Home Assistant YouTube 频道 上来一场 Home Assistant 直播 / 迷你发布派对 / 问答活动。 所以,记得留意我们的社交媒体公告。

Stefan Agner 加入 Nabu Casa!

今天我们很高兴地宣布,Nabu Casa 已经聘请 Stefan Agner 加入 Home Assistant 项目。

Stefan 专长于嵌入式系统和 Linux 内核,接下来他将主要负责改进和扩展 Home Assistant Operating System。

在业余时间里,他也非常喜欢折腾各种嵌入式相关的东西:从让 ARM Linux 内核用 Clang 构建,到使用 MicroPython 搭建传感器节点。

如果不是在折腾技术,那他大概就是在户外徒步,或者和朋友喝上一杯好啤酒。

欢迎 Stefan!我们非常高兴有你加入!

快速栏

Let me quickly find that 实体 that is not on my Lovelace 仪表盘... hold on... 配置 -> 实体, search for it... click the right one... Got it!

That isn't efficient, right? @donkawechico to the rescue! He added an exciting new feature to our 前端: the Quick Bar.

This new dialog allows you to quickly open an 实体 or run a command.

It can be launched anywhere in Home Assistant; with the keyboard shortcuts e for 实体 and c for commands. You can 开关 between the 实体 and command modes by removing or adding the > at the start of the search input.

The Quick Bar is similar to the Command Pallet you might know from Visual Studio Code. He even copied the filter algorithm from Visual Studio Code, so you can search what you need even faster.

Screencapture of the Quick Bar. Screencapture of the Quick Bar.

The commands are currently limited to reloading YAML 配置 and restarting Home Assistant, but expect this to grow rapidly! The same goes for the keyboard shortcuts; the plan is to add more so you can quickly perform 动作 and navigate Home Assistant from anywhere with a couple of key presses!

Check the 文档 更多信息 and usage tips.

紧凑页眉

@maykar recently archived his immensely popular custom header repository, promising to bring parts of it to the 核心 of Home Assistant.

Well, he did; this 发布, our Lovelace header is compact! 🤩

He combined the two bars we had in 1 by replacing the 仪表盘 title with the tabs that used to be shown below it. He did a lot of work to make the tabs take up the least amount of space, while still being 用户 friendly.

We think it looks great! And, finally, welcome to 核心 @maykar!

Screenshot of the compact header. Screenshot of the compact header.

脚本和自动化 YAML 编辑器

@thomasloven added the ability to edit an entire 自动化 or 脚本 in the UI with YAML.

This is the perfect blend for people that want the best of both worlds, editing in the UI with the normal UI editor and for some more complicated 自动化, maybe edit it directly in YAML, all from the UI.

Screenshot of the new YAML 自动化 editor. Screenshot of the new YAML 自动化 editor.

He also added a very useful copy 按钮 to make it easy to share your 自动化 with the community. You can then easily paste it back in the YAML editor and continue editing after switching to the UI mode.

Xbox 集成

Xbox now has a full blown 集成 in Home Assistant, which delivers 遥控器 control and tons of other features.

This awesome addition is 创建 by @hunterjm and he made this nice little video demonstrating his creation:

计数器和计时器现已可作为 UI 助手使用

A nice addition to the 助手 you can create and manage in the UI: Counters & Timers are now available! Thanks, @danimart1991!

Screenshot of the new Counter & Timer 助手. Screenshot of the new Counter & Timer 助手.

模板原生类型支持(测试版)

Ever tried to make a list of 实体 or set a RGB color via an 模板? If so, you probably would have learned, that it is not that simple. In Home Assistant, the result of a 模板 always have been a piece of text (a string), even if you made a list.

This 发布 adds support for native Python types in 模板. This means that 模板 now actually can create lists, or return a number!

For 0.117, native 模板 types will be a opt-in beta feature, that will become the default in the next 发布.

You can enable it, by disabling the legacy_template rendering in your configuration.yaml:

homeassistant:
  legacy_templates: false

After that, you can do things like this:

script:
  my_script:
    alias: "Example"
    description: Example script with native lists in templates
    variables:
      entities:
        - light.living_room_window
        - light.living_room_table
      color: [255, 0, 0]
    sequence:
      service: light.turn_on
      target:
        entity_id: ""
      data:
        rgb_color: ""

This is an extremely powerful change to our 模板 engine, that allow for more advanced future additions and can significantly reduce the complexity of existing 模板 in your set up.

It should be mostly compatible with your existing 模板, however, if you enable this feature, please be sure to check the backward-incompatible changes section.

We'd love to hear you experience with using this feature! And, if you run into, problems, please let us know.

其他值得注意的变化

It is Hacktoberfest, and a lot smaller, but noteworthy changes this 发布!

First a shout out to @spacegaier, he did a LOT of improvements (29!) this 发布. Visual tweaks, quality of life improvements and random fixes, like:

  • Colors in the 日志 for 错误 and 警告
  • Automatically fill the Lovelace resource type based on the extension of the URL
  • Make more text translateable
  • Make 属性 more 用户 friendly
  • Show the number of hidden 实体 in the 实体 配置 page
  • And a lot more!

But wait, there is more!

  • @allenporter started working on adding Google Nest 设备 Access to the Nest 集成. It is a base to extend on, for example, there is no thermostat yet. Looking forward to the upcoming releases!
  • You can now save 自动化, 脚本 and 场景 with ctrl/cmd + s. Thanks, @gilsonmandalogo!
  • @mattmattmatt added the ability to dismiss all 通知 at once, and the 通知 pane will close when the last 通知 was dismissed.
  • We improved compatibility and Home Assistant is now usable on more, mostly older, 设备.
  • You can now search for the 实体 name in the 实体 picker besides the 实体 id, thanks @zsarnett!
  • Thanks to @cgarwood, you can see the 配置 of OZW nodes straight from the UI!
  • @bieniu added voltage, power factor and energy 传感器 to Shelly 集成.
  • The Media Player platform now has a repeat_set 服务 that allows for changing the repeat mode. Sonos is the first 集成 that supports this 服务. Thanks @amelchio!
  • @amelchio also added support for playing Spotify URIs with the Sonos 集成.
  • Thanks to @timmo001, the WLED 集成 now supports color palettes.
  • You can now monitor the battery 状态 for your devolo Home Control 设备, thanks, @Shutgun!
  • The Netatmo 集成 got some nice 天气 trend 传感器, thanks @cgtobi!
  • Chromecast 设备 can now play Plex media using the standard play_media 服务. Nice work @jjlawren!
  • The media browser now supports the Squeezebox and Volumio 集成, thanks to @rajlaud and @OnFreund.

新集成

We welcome the following new 集成 this 发布:

新平台

The following 集成 got support for a new platform:

现在可通过 UI 设置的集成

The following 集成 are now available via the Home Assistant UI:

发布 0.117.1 - October 30

发布 0.117.2 - November 1

发布 0.117.3 - November 4

发布 0.117.4 - November 4

发布 0.117.5 - November 5

发布 0.117.6 - November 11

如果你需要帮助……

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

Experiencing issues introduced by this 发布? Please report them in our issue tracker. Make sure to fill in all fields of the issue 模板.

不向后兼容的变更

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.

Cast

The host option for the cast 集成 has previously been deprecated and is now removed. Configuring media players via the media_player platform was also deprecated before, and removed in this 发布 as well.

If you use any of those above, you'll need to migrate to use the new 配置 method. Please see the cast 文档 on how to set this up.

(@emontnemery - #41402) (cast docs)

Cloudflare

Cloudflare is now available exclusively via the 集成 UI. This means it's no longer configured in YAML. Existing 配置 are not imported as API Tokens are now used to authenticate. Refer to 集成 文档 on how to 设置 via UI.

(@ctalkington - #41167) (cloudflare docs)

Elkm1

The bypassed 属性 of a 区域 传感器 is removed as it is no longer used. The bypassed status of a 区域 can be determined when the logical_status of a 区域 has a value of bypassed.

Auto-配置 now only configures elements that have a name or description associated with them. The previous mechanism for automatically detecting if element are configured on the ElkM1 面板 was to note any element that have 属性 different than the elkm1-lib's defaults. This is 错误 prone and made the library fragile when defaults change.

(@gwww - #41584 #42064) (elkm1 docs)

ISY994

This 更新 to PyISY adds native support for decimal precision in ISY Variable 传感器, any 模板 传感器 创建 to adjust the rounding or precision shown in Home Assistant should be updated/removed.

The way logging is handled in PyISY has been changed. If you previously set a different logging level for homeassistant.components.isy994 in your logger 配置, you will also need to set the level for pyisy and/or pyisy.events.

Two changes may cause some 实体 to change platforms; however, this should only affect NodeServer nodes:

  • ISY Nodes that use the ON/OFF unit of measurement and cannot be categorized/sorted by another method have been moved from switch to binary_sensor since it cannot be confirmed if the 设备 supports DON/DOF commands. The isy994.send_node_command 服务 may be used to control these 设备 if you know they are controllable.

  • The status of all nodes is now downloaded before sorting 设备, as a result some nodes which defaulted to sensor will now be correctly sorted.

传感器 values which use the ISY994's "index" unit of measurement (UOM=25) now report the "formatted" text value shown in the ISY Admin Console, instead of the integer index. If you have any 自动化 or 模板 relying on these values, they must be updated.

(@shbatm - #42043 #42050) (isy994 docs)

Modbus

温控 配置 was moved from the platform directly into the Modbus 集成. This change was required to meet the latest architecture requirements of Home Assistant.

Example of previous YAML 配置:

climate:
  - platform: modbus
    name: Watlow F4T
    hub: hub1
    slave: 1
    data_type: uint
    data_count: 1
    scale: 0.1
    offset: 0
    precision: 1
    max_temp: 30
    min_temp: 15
    temp_step: 1
    target_temp_register: 2782
    current_temp_register: 27586

Example of new YAML 配置:

modbus:
  - name: hub1
    type: tcp
    host: 127.0.0.1
    port: 5020

    climates:
      - name: Watlow F4T
        slave: 1
        data_type: uint
        data_count: 1
        scale: 0.1
        offset: 0
        precision: 1
        max_temp: 30
        min_temp: 15
        temp_step: 1
        target_temp_register: 2782
        current_temp_register: 27586

(@vzahradnik - #32439) (modbus docs)

MQTT

MQTT Discovery is now enabled by default.

(@emontnemery - #41361) (MQTT docs)

Netatmo

传感器 for raw battery values and string representation have been dropped.

(@cgtobi - #41321) (netatmo docs)

onewire

Despite the project name, the owfs package (which depends on fuse and exposes filesystem calls in the appropriate directory to this program itself) is NOT recommended for any real use, it has well 已知问题 with races etc.

The owfs/fuse implementation is therefore deprecated in favour of the owserver implementation.

Before this 发布:

sensor:
  - platform: onewire
    mount_dir: /mnt/1Wire

After this 发布:

sensor:
  - platform: onewire
    host: localhost

(@epenet - #42041) (onewire docs)

RainMachine

Per ADR-0010, this PR deprecates YAML 配置 for RainMachine until 0.119. If you already use the RainMachine 集成, you do not need to take 动作. Your 配置 has already been imported into the UI.

(@bachya - #41971) (rainmachine docs)

RFXtrx

The 集成 is now set up via the UI. YAML support has been limited to an (automatic) one-time import. You can safely remove the YAML 配置 after upgrading.

Options are now set through the UI (global options/add 设备/remove 设备/change 设备 options).

For newly added or detected 设备, device_class cannot be set.

Instead, it should be set by customizing 实体.

The 调试 key is removed as option for the 集成. Instead, 日志 level for the library can be set by configuring the logger (see below).

logger:
  logs:
    RFXtrx: debug

No 配置 changes are necessary, to keep existing configs working, the key is still accepted.

(@RobBie1221 - #39117) (rfxtrx docs)

SimpliSafe

Per ADR-0010, this PR deprecates YAML 配置 for SimpliSafe until 0.119. If you already use the SimpliSafe 集成, you do not need to take 动作. Your 配置 has already been imported into the UI.

(@bachya - #41896) (simplisafe docs)

Sonarr

Sonarr has fully transitioned to 配置 via UI. YAML 配置 is now no longer supported after being deprecated for several releases already.

(@ctalkington - #41904) (sonarr docs)

模板 - 自动更新的 now()

The entity_id: 属性 was recently removed from 模板 实体 because the 模板 are now able to find all referenced 实体 automatically. This removal introduced a new problem where 模板 using the current time could no longer use entity_id: sensor.time to ensure periodic updates.

With apologies to those who have spent the last couple of releases adding workarounds to their 模板, we are now introducing an auto-refresh feature to time-based 模板.

It is thus no longer necessary to reference sensor.time, sensor.date or manually 更新 模板 实体 when now() or utcnow() is present in the 模板.

The 模板 will automatically be updated when:

  • A referenced 实体 changes 状态.
  • At the start of each minute when now() or utcnow() is present in the 模板.

Please note, if you have a time-based 模板 where you do not want it to 更新 periodically it will now have to be reworked to not use now().

(@bdraco - #41147 #42225)

模板 - 原生类型(测试版)

模板 results can now rendered to native Python types, but only when the legacy 模板 rendering is disabled.

homeassistant:
  legacy_templates: false

This feature will be opt-in for this 发布, the backward-incompatible changes below only apply if you explicitly enable this new feature.

A 模板 would always result in a string (text). This made it hard to use things like lists, or numbers as a result of a 模板. For example, returning a list of 实体 or a RGB/HS/XY color.

This change may impact your existing 模板, as 模板 now can return other types; For example, string, float, integer, boolean, lists or dictionaries.

The following 模板 can be impacted by this:

  • 实体 with templated 属性. 属性 keep their native Python type, thus if the 属性 is used/processed in a 模板 again later, the type might be different.
  • 模板 working with lists or mappings (dictionaries). Previously, such collection would be returned as a text, for example [1, 2, 3, 4, 5]. We've seen examples where such results are decoded using text processing again (e.g., by splitting the result on a , to get the separate values). The additional processing is no longer needed, as the returned value will be a collection now.
  • Note: The 实体 状态 in Home Assistant is always a text (string). Even with native types being supported in 模板 now, if a results is stored as a 实体 状态, they will be converted to an string.

(@frenck - #41227)

模板 - 速率限制

Previously we implemented a rate limit of 1 更新 per minute for states.DOMAIN in 模板. This has been changed to an 更新 once every second.

模板 using states (without a domain) still have a rate limit of 1 更新 per minute.

(@bdraco - #42004)

UpCloud

The UpCloud 集成 is now configured via the UI. Existing YAML 配置 is automatically imported after upgrading and can be safely removed afterward.

(@scop - #37941) (upcloud docs)

告别以下内容

  • The Australian Bureau of Meteorology (BOM) 集成 has been removed. It was using webscraping to gather its data, which is not allowed. (@balloob - #41941)

所有变更

点击查看所有变更!