0.114:深色模式、Open Z-Wave 进展,以及更多自动化和脚本更新

哇,这个发布周期过得真快;现在已经来到 0.114 了!

就我个人而言,我甚至还没来得及把上个版本新增的自动化功能都用起来呢。😅

自从 2018 年 Lovelace UI 以测试版形式推出以来,呼声最高的功能之一,大概就是深色模式了。这一点也不奇怪,毕竟如今几乎所有软件都在加入深色模式。

这个版本加入了深色模式!@bramkragten 还更进一步,为默认主题的主色和强调色加入了取色器。我一直很期待这个功能,因为它让你无需专门创建主题,也能轻松调整一点界面风格。

这无疑是本次发布最显眼的功能,因为你一升级就能立刻看到它。

与此同时,测试版 Open Z-Wave 集成在贡献、反馈、修复和改进方面都在加速推进。我已经在用了,而且非常喜欢。我的 Z-Wave 网络从来没有这么稳定过。如果你还没试过,我强烈推荐你尝试一下。社区里还有一篇很不错的指南,介绍了如何在不完全切换的情况下进行测试。

除了下面列出的重点内容,0.114 看起来也许会显得有点“空”,但其实并不是这样。这个版本塞满了各种小改进和修复。这次的“所有变更”部分绝对值得看看。

祝你享受这个版本。

../Frenck

深色模式和主题颜色取色器

我们现在已经正式支持深色模式了。🎉

我们会检测你的设备是否开启了深色模式;如果是,默认主题也会自动切换为深色。你也可以在个人资料中覆盖这种深浅主题的自动切换行为。

此外,你现在还可以为默认主题选择主色和强调色。我们会自动计算其他相关颜色,确保整体协调且易于阅读。

Screenshot of the new dark mode theme 设置 Screenshot of the new dark mode and theme 设置.

所以,如果你升级到 Home Assistant 0.114、使用的是默认主题,并且你的设备启用了深色模式,那么升级后默认看到的就会是深色主题。

另外,选择颜色时,请确保你挑选的主色在浅色和深色背景下都清晰可读。目前这仍是本地设置,需要在每一台设备上分别应用。

对于自定义主题,set_theme 服务调用新增了一个选项:mode: 'dark'; 这允许你设置一个会在设备处于深色模式时使用的主题。

最后,使用 set_theme 服务时,相关设置现在会在重启后保留。所以如果你原本有一个在启动时调用 set_theme 的自动化,现在已经不再需要它了。😉

自动化和脚本更新

Home Assistant 0.113 中,我们为自动化和脚本加入了大量新功能。本次发布修复了一些后来发现并反馈的问题,同时也继续加入了几项小而实用的新能力。

首先,现在你可以在 UI 中创建自动化或脚本时使用 repeatchoose 动作了。

Screenshot of the new 自动化 features available in the UI Screenshot of the new 自动化 features available in the UI.

亚秒级精度现在已经扩展到所有与时间相关的写法中。例如,你现在可以使用 2.5 秒、小时或分钟,也可以在完整时间格式中使用它,比如 23:59:59.999

automation.turn_off 服务现在接受一个 stop_actions 数据参数。默认情况下,关闭一个自动化时,当前正在运行的动作也会被停止。这个新选项允许你关闭自动化,同时选择是否让已经开始执行的动作继续运行。

最后,time 触发器还加入了一个小捷径:现在它可以接受多个时间值了。

automation:
  - alias: "Example with multiple time values in a single time trigger"
    trigger:
      - platform: time
        at:
          - "05:00:00"
          - "06:00:00"
          - "10:00:00"
    action:
      choose: ...

Open Z-Wave(测试版)

Open Z-Wave(测试版)集成进展顺利,也有越来越多人加入协作!感谢 @firstof9@RobBie1221@tradiuz 在这个版本周期中一起投入并提供帮助。

Open Z-Wave 的 UI 中新增了一些额外信息。现在你可以直接在设备页面看到设备信息,比如 Z-Wave 节点 ID 以及其他相关细节。

Screenshot of Z-Wave 设备 information available in the UI Screenshot of Z-Wave 设备 information available in the UI.

此外,灯光现在加入了 RGB 颜色支持,同时也修复了色温和调光相关的问题。💡

最后,还减少了不必要的设备轮询。

又一轮性能提升

我们有没有说过,@bdraco 在提升 Home Assistant 性能与稳定性这件事上简直停不下来?他的列车还在持续前进!

0.114 也不例外,这次同样带来了许多性能与稳定性方面的小改进。

这些内容可能稍微技术一些,不过这里有一份简短概览:

  • 内部的设备注册表与实体注册表现在都建立了索引,因此速度更快了。
  • 启动时设置分组的效率更高了。
  • 重新加载 YAML 配置或检查配置的速度也更快了。
  • Home Assistant 中的每个事件都会附带一个上下文(每个触发器、自动化等都记录了“由什么、由谁触发”)。这些上下文现在创建得更快,也就让整体更快了。
  • 时间模式触发器现在会直接调度到事件循环中,效率高得多。
  • 系统日志的处理现在被移出了主程序循环,因此不会干扰 Home Assistant 为你执行的其他工作。

最后,如果 Home Assistant 的 recorder 数据库(SQLite)因任何原因被检测到损坏,旧数据库会被移走,并创建一个全新的数据库,以避免启动时出现问题。

说实话,上面列的甚至都还不完整。😅 感谢 @bdraco

分享诊断信息和崩溃报告

随 Home Assistant 0.114 一同发布的 Supervisor 231,在系统面板中加入了一个新选项,可匿名与我们分享诊断信息和崩溃报告。这将帮助我们发现并修复问题。

这些共享信息仅 Home Assistant 核心团队可访问,不会分享给其他人。数据中不包含任何私人或敏感信息,而且你可以随时在设置中关闭此功能。

当然,这个选项默认是关闭的。所以,如果你愿意帮助这个项目,可以考虑在 Supervisor 面板中启用它。

这项服务由 Sentry.io 赞助提供——非常感谢!

其他值得注意的变化

  • 你现在可以从设备页面把 Lovelace 卡片移动到其他仪表盘中,也可以把卡片添加到不只是主仪表盘的地方。
  • 新增了对安全区域边距的支持;例如,带刘海屏的 iPhone 现在可以真正铺满整个屏幕,同时又保留足够的边距给顶部刘海和底部 Home 滑动手势。
  • HomeKit 现在支持门铃了(感谢 @adrum),而且 @bdraco 还加入了多路摄像头流支持。
  • 如果你使用 灯光 配置文件,现在它们支持默认过渡时间了,感谢 @donkawechico
  • @agners 为 Home Assistant 的Web 服务器加入了 IPv4 与 IPv6(双栈)支持,让它可以同时运行在两种协议上。

新集成

本次发布新增了 6 个集成:

新平台

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

现在可通过 UI 设置的集成

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

如果你需要帮助……

欢迎前往我们非常活跃的论坛,或者加入我们的聊天频道

如果这个版本带来了问题,请到我们的 issue tracker 提交报告,并尽量完整填写 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.

Recorder

The default sqlite database (home-assistant_v2.db) is now validated on startup and if corruption is detected, the database is renamed to home-assistant_v2.db.corrupt.{ISOTIME} and startup proceeds with a fresh database.

(@bdraco - #37949) (recorder docs)

Google Assistant

A sync will be required for source selection to work after this 更新. The keyword to select source will also have changed from "Set mode on TV to.." to "Set input on TV to.."

(@elupus - #35753) (google_assistant docs)

Blink

Due to the new 2FA endpoint, the YAML 配置 is no longer supported.

In addition, due to some API changes, if you are upgrading from a previous 版本, you will need to navigate to the 集成 page at startup and re-配置 Blink.

Your username and 密码 will be imported, but you need to submit a 2FA token (emailed to you by Blink) in order to continue setting up the 集成.

(@fronzbot - #38027) (blink docs)

TensorFlow

TensorFlow has been upgraded to TensorFlow 2.

TensorFlow 1 object detection models are not compatible with TensorFlow 2, therefore you'll will need to walk through the 设置 文档 again and choose a new model from the Model Zoo.

(@hunterjm - #38384) (tensorflow docs)

Pi-hole

A 开关 has been added to the Pi-hole 集成. Because of the 开关 being added, the pi_hole.enable 服务 is removed.

The pi_hole.disable 服务 remains in order to support disabling the 服务 for a given amount of time, but now it relies on the 开关 实体 id instead of the name set by the 用户, so the name field is removed.

With this change, a 开关 实体 switch.pi_hole will be added if you set up the 集成 with an API key and default name (Pi-hole).

Now, you can use switch.turn_on and switch.turn_off to enable and disable the Pi-hole 服务 permanently. To disable the 服务 for a given time, use pi_hole.disable with entity_id: switch.pi_hole and duration: 00:00:15. To target all Pi-hole 服务, use entity_id: all.

(@shenxn - #35605) (pi_hole docs)

Volumio

The Volumio 集成 is now configured through the UI. If you previously had it in 配置.yaml, please remove it and 配置 through the 集成 面板.

(@OnFreund - #38252) (discovery docs) (volumio docs)

Honeywell Total Connect Comfort (evohome)

The hvac_action() property has been removed from Evohome 区域 as this data was inaccurate - the algorithm used to provide this data was not reliable, and there is no reasonable hope for a satisfactory alternative.

You will have no indication if a 区域 is actively calling for heat (CURRENT_HVAC_*), nor if the heat source is currently active. However, you will continue to have the hvac_mode() property, which will indicate if the heating is enabled, or not (HVAC_MODE_*).

This will be most obvious by the absence of this information in the UI.

There is no intervention required for this breaking change.

(@zxdavb - #38244) (evohome docs)

Flume

The unique id is being updated for existing 传感器. You will need to clean up the stale 实体 from the 实体 registry via the GUI.

(@ChrisMandich - #38138) (flume docs)

Météo-France

The meteo_france 集成 moved from a web scraping architecture to a API-based architecture. With this major refactor the following change could break:

  • The thunder chance 实体 is no longer available (no longer in the API results).
  • The next rain 实体 状态 is now a datetime instead of a delay.
  • next rain 属性 have been simplified.
  • weather_alert: only one 实体 创建 by department. Was by city in the previous 版本 and could create duplicates.
  • weather alert 属性 have been simplified.
  • weather platform is showing the current day forecast in the first position of daily forecast (instead of tomorrow forecast).

(@oncleben31 - #37737) (meteo_france docs)

Bond

When you have multiple Bond hubs, each with its own set of 设备, those 设备 have IDs that the Bond 集成 uses to generate unique 实体 IDs in Home Assistant. Unfortunately, those IDs are only unique within the hub. So it is possible that unique IDs generated for 实体 from different hubs will not be unique and collide.

This has been fixed by prefixing 设备 ID with a hub ID and the resulting ID is now truly unique. After restarting you will see each bond 实体 twice. One which is live with the new unique ID. The second which is disabled with old unique ID.

How to make it work:

  1. Remove the disabled 实体 (note its friendly ID, e.g., cover.shades)
  2. Optionally rename the generated friendly ID on the live 实体, so that your 自动化 continue to work. For example, your live 实体 will have ID cover.shades_2. Rename it to cover.shades.

(@prystupa - #38496) (bond docs)

Hi-Link HLK-SW16

The hlk-sw16 实体 ids will change upon 更新 and the old 实体 will need to be removed manually.

(@jameshilliard - #37190) (hlk_sw16 docs)

Slack

The Slack attachments framework was deprecated in 0.108.0 and is now officially removed. The blocks framework should be used instead.

(@bachya - #38139) (slack docs)

IQVIA

Per ADR-0010, IQVIA can no longer be configured via YAML and must be configured from the UI. Existing IQVIA 用户 have already had their 集成 imported and only need to remove IQVIA-related items from configuration.yaml.

(@bachya - #38141) (iqvia docs)

Shell 命令

Processes spawned from the shell_command 集成 (the command executes) now timeout after 60 seconds instead of running forever.

(@bdraco - #38491) (shell_command docs)

命令行

The command_line 遮盖, 通知 and 开关 platforms, now timeout after 15 seconds (by default) instead of blocking forever.

(@bdraco - #38497) (command_line docs)

时间模式监听器

If time abruptly moves forward or backward, time pattern listeners will only be adjusted after they were previously scheduled to fire.

This avoids the need for every time pattern listener to check for this every second.

(@bdraco - #38021)

日志簿

Support for legacy logbook events 创建 before 0.112 is removed.

(@bdraco - #37822) (logbook docs)

自动化 `turn_off` 服务

This change is actually not a breaking change, but it is making up for the fact that a previous change was that was not marked as such.

It turns out there are valid use cases where an 自动化 needs to be turned off, so that it will not 触发器, but where previous runs may still be active that should be allowed to complete. For example, an 自动化 that performs a reasonably lengthy procedure that should not be aborted midstream, otherwise it would leave the system in an undesirable 状态. Or a queued 自动化 that needs to handle all previous events, some of which may not be complete when the 自动化 is turned off.

To accommodate for these use cases, this 发布 introduces adds an optional parameter to the automation.turn_off 服务, namely stop_actions, which defaults to true. It controls whether or not active runs should be stopped when the 自动化 is turned off.

(@pnbruckner - #38436)

告别以下内容

  • The Linky 集成 has been removed. Enedis has discontinued its Linky API (to get electric consumption). (@Quentame - #38565)

发布 0.114.1 - August 15

发布 0.114.2 - August 17

发布 0.114.3 - August 20

发布 0.114.4 - August 26

所有变更

点击查看所有变更!