0.112:让一切更快;日志簿与历史记录

又过了三周!Home Assistant Core 0.112 来了!

到了这个阶段,我几乎觉得我们当前开发的口号, 已经从“让一切更简单”变成了:让一切更快! 🚀

在过去几个版本中,我们做了大量性能优化, 其中最明显的就是前一个 0.111 发布 中前端会更早启动。

这次发布也不例外,给日志簿与历史记录面板带来了堪称改变体验的性能提升。 说真的,我以前甚至会因为它太慢而刻意少用日志簿。

我个人感觉,Home Assistant 正在变得越来越成熟。 它一点点变得更可靠、更快、更易用,也更精致、更细腻。 也许我有点偏心……你怎么看?最近这些改进里,你最喜欢哪一个?

祝你享受这次发布!

../Frenck

重要升级提示!

先来说一条升级到 Home Assistant 核心 0.112 时的重要提醒。

这个版本修改了 Home Assistant 的数据库格式。升级时,数据库会迁移到新的格式。

根据你的数据库大小以及运行 Home Assistant 的硬件性能不同,这个迁移过程可能会让升级后的首次启动多花一些时间。 对大多数人来说,这通常只会多出几分钟;但如果你的数据库非常大(例如超过 30 GiB),可能会花上一两个小时。

所以,如果 Home Assistant 没有立刻启动,请不要惊慌。

日志簿与历史记录 🚀

上面提到的数据库变更,原因就在于日志簿和历史记录。 感谢 @bdraco,过去几周他一直在持续改进 Home Assistant 的这一部分。

他的努力带来的结果就是:历史记录和日志簿现在快得飞起。⚡️

这不是“小幅变快”而已,而是和过去完全不同的新体验。 @bdraco,干得太棒了!

日志簿与历史记录现在有日期/时间范围选择器了

然后, @bramkragten 也加入了日志簿与历史记录的改进列车,让这两个面板变得灵活了许多。

你不再只能在固定时间范围里二选一,而是可以自己定义想查看的数据时间段。

只要选择起始与结束日期时间,它就会只显示该范围内的数据。

Screenshot of the new date/time picker Screenshot of the new date/time picker.

默认情况下,它也不再显示整整一天的数据,而只显示最近几个小时,因此加载会更快。 毕竟大多数时候,我们看的也都是最近发生的事件。

日志簿中现在可以看到是谁做了变更

Talking about the logbook, you can now also see who made a change in the logbook! No more discussion about who changed the temperature!

Screenshot of the logbook showing who made the change Screenshot of the logbook showing who made the change.

YAML 自动化现已支持多个实体与多个状态

Are you writing your 自动化 in YAML? You might appreciate this one:

A single 条件 rule can now test if multiple 实体 match the 条件. Furthermore, 状态 and 区域 now also accept a list in a 条件. That helps testing if the 实体 matches any of the ones listed.

So this:

condition:
  - condition: state
    entity_id: light.kitchen
    state: "on"
  - condition: state
    entity_id: light.living_room
    state: "on"
  - condition: state
    entity_id: light.office
    state: "on"

Can now be shortened to this:

condition:
  - condition: state
    entity_id:
      - light.kitchen
      - light.living_room
      - light.office
    state: "on"

An example that tests if the 报警 is in any of the specified 状态:

condition:
  - condition: state
    entity_id: alarm_control_panel.home
    state:
      - armed_home
      - armed_away

And this 条件 is now also passing when Frenck is at home or at work (fake, of course, since Frenck works from his home).

condition:
  - condition: zone
    entity_id: device_tracker.frenck
    zone:
      - zone.home
      - zone.work

Or combine! The following 条件 would pass if both Frenck and Daphne are either at home or in the work 区域.

condition:
  platform: zone
  entity_id:
    - device_tracker.frenck
    - device_tracker.daphne
  zone:
    - zone.home
    - zone.work

集成专属面板现在都搬到集成页面了

Some 集成, like ZHA, Z-Wave and MQTT have their own 面板 or dev tools. For things like pairing 设备 or publishing MQTT messages.

These used to be on the 配置 page or development tools, which was weird because the 集成 设置 would be on the 集成 page. ZHA also had a lot of 设备 设置 in its own 面板, resulting in a lot of duplicate functionality spread across the Home Assistant interface.

These 面板 and tools are now moved to the 集成 pages, directly within the 集成 that provides those. You can find them on the 卡片 of the 集成 at the Configure 按钮.

Screenshot of the MQTT 配置 按钮 Screenshot of the MQTT 配置 按钮.

The 设备-specific 设置 are now available on the 设备 page, so we now have 1 place to go for information and 设置 for 设备.

Screenshot of a ZHA 设备 Screenshot of a ZHA 设备.

In the process, we also cleaned some things ups, like adding a 设备 in ZHA. If you change the name of the 设备 while adding it, the 实体 and 实体 IDs are named accordingly.

日志页与信息页的新位置

More moving this 发布, the 日志 and information pages used to be in the development tools 面板, but they didn't really belong there. They aren't really tools for developing, they provide information on your set up.

We moved them to the 配置 page where they are joined with server management and the general 配置.

Screenshot of the new home for 日志 & information Screenshot of the new home for 日志 & information.

标签页隐藏 5 分钟后自动断开连接

An improvement in the battery of your 设备 and your data cap are going to like:

When the Home Assistant UI is not visible for longer than 5 minutes, it disconnects from your Home Assistant instance. This means you no longer get data or 摄像头 streams and your 设备 can optimize resource and power consumption.

Of course, when showing the browser (or browser tab) again, it will automatically reconnect.

现在会显示所有自动化/场景/脚本

自动化, 场景 and 脚本 in the 配置 面板 are no longer hidden when they have the hidden 属性. This was erroneously added in the past and has now been undone.

Talking about the old hidden 属性. They have been slowly deprecated over time, as they originate from the previous Home Assistant UI. As of this 发布, this 属性 has been completely removed from the system.

其他值得注意的变更

  • @balloob has shaved of a couple of seconds from the Home Assistant startup again.
  • 实体 that originate from MQTT will now become "unavailable" when the 集成 is not connected to the MQTT broker. Thanks @elupus!
  • If you have a Xiaomi 吸尘器 cleaner, @jthure added a 服务 to send it to specific places using a new goto 服务.
  • The Smappee 集成 has been fully rewritten, by @bsmappee themselves!
  • Auto discovery has been added to the NUT 集成. Please note that some NAS 设备 might be discovered as they support adding an external battery.

新集成

新平台

现已可通过 UI 设置的集成

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

如果你需要帮助……

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

如果这个版本带来了问题,请到我们的 issue tracker 提交报告,并尽量完整填写 issue 模板中的所有字段。

不向后兼容的变更

  • Tile

    This is now available for 配置 via the 集成 UI. The 实体 IDs have changed to reflect the human-friendly name of the Tile (as defined in the Tile mobile app). Please 更新 your 自动化 accordingly.

    (@bachya - #36173) (tile docs)

  • Panel_Custom

    Specifying custom 面板 based on HTML imports is deprecated and will be removed in a future 版本.

    (@balloob - #36464) (panel_custom docs)

  • Avri

    Avri is now available for configration via the 集成 UI. Remove the 集成 from configuration.yaml and re-add it in the UI.

    (@timvancann - #34288)

  • Arcam

    This is now available for 配置 via the 集成 UI. Remove the 集成 from configuration.yaml and re-add it in the UI. To support the turn_on 动作, you will need to 设置 an 自动化 based on an exposed event from the 集成. This can be accomplished via 设备 动作.

    (@elupus - #34384) (arcam_fmj docs)

  • Android TV

    Usage of the 状态 'idle' and 'standby' are switched for the Android TV 集成 to be consistent with other media players. 用户-provided custom 状态 detection rules are not affected.

    (@JeffLIrion - #36509) (androidtv docs)

  • Xiaomi Miio

    Due to general code updates to the xiaomi_miio 吸尘器 component there are backward-incompatible changes to the following 服务:

    • xiaomi_miio.vacuum_remote_control_start
    • xiaomi_miio.vacuum_remote_control_stop
    • xiaomi_miio.vacuum_remote_control_move
    • xiaomi_miio.vacuum_remote_control_move_step
    • xiaomi_miio.vacuum_clean_zone

    These all now require that either entity_id or area_id is passed when calling the 服务. You need to 更新 all usages (such as 自动化 and 脚本) of these 服务 which do not already pass entity_id or area_id. For example, change the existing 自动化:

automation:
  - alias: "Test vacuum zone"
    trigger:
    - event: start
      platform: homeassistant
    condition: []
    action:
    - service: xiaomi_miio.vacuum_clean_zone
      data:
        repeats: ""
        zone: [[30914,26007,35514,28807], [20232,22496,26032,26496]]

to:

automation:
  - alias: "Test vacuum zone"
    trigger:
    - event: start
      platform: homeassistant
    condition: []
    action:
    - service: xiaomi_miio.vacuum_clean_zone
      target:
        entity_id: vacuum.xiaomi_vacuum
      data:
        repeats: ""
        zone: [[30914,26007,35514,28807], [20232,22496,26032,26496]]

(@jthure - #35737) (xiaomi_miio docs)

  • Honeywell Total Connect Comfort

    Remnants of EU 集成 for Honeywell thermostats have been removed. As the 集成 was already removed for EU, all consumers should already be US 集成. Existing 配置 should remove region: lines from their climate:honeywell 配置 sections.

    (@jhenkens - #36456) (honeywell docs)

  • Broadlink

    The timeout option has been removed from the command learning 服务 because it does not work properly. The 设备 has a fixed timeout of 30 secs, which cannot be changed.

    To adapt to these changes, 用户 need to remove timeout: num_secs from calls to the broadlink.learn_command 服务.

    (@felipediel - #36318) (broadlink docs)

  • 前端

    The config 集成 will always be loaded if you load the 前端 集成. The 配置 面板 can no longer be disabled.

    (@balloob - #36587) (default_config docs) (前端 docs) (safe_mode docs)

  • Homematic IP Cloud

    The HMIP-MOD-TM 设备 will get a new unique ID due to a merge of the implementation with new HMIP-MOD-HO. So check your 仪表盘, 脚本, 自动化, ... and use the newly 创建 设备/实体. The old 设备 can be deleted under the 设备 section in Home Assistant.

    (@SukramJ - #36595) (homematicip_cloud docs)

  • Speedtest.net

    此integrations is now configured through the UI. To successfully import from configuration.yaml please remove monitored_conditions. If server_id is mentioned it will check against the list of servers before importing.

    (@engrbm87 - #36254) (speedtestdotnet docs)

  • ZHA

    ZHA 传感器 corresponding to AnalogInput and MultistateInput Zigbee clusters have been dropped. These are mostly seen in Aqara vibration/cube 设备 which are pretty much stateless, so remove 实体 and rely on zha_events instead.

    (@Adminiuga - #36696) (zha docs)

  • Yeelight

    It is no longer be possible to override device_type via model from the 配置, to force some supported features. For example, force ceiling 灯光 into generic 灯光, etc. Now it will only be used for Yeelight lib, to get correct color temperature ranges. It still possible to pass declared model to the Yeelight library to get correct temperature ranges support.

    (@zewelor - #36658) (yeelight docs)

  • Viessmann ViCare

    Removed existing 属性 from the 温控 实体 which are now available as separate 传感器. If you were using one of the following 属性, you must migrate to the new 传感器. The 传感器 are 创建 automatically.

    For all heating types:

    • supply_temperature
    • outside_temperature
    • circulationpump_active

    For heating type gas:

    • burner_modulation
    • boiler_temperature

    For heating type: heatpump:

    • return_temperature

(@crazyfx1 - #34385) (vicare docs) (new-platform)

  • AlarmDecoder

Previously the autobypass 配置 option only worked for home and away arming. It now works for night arming also. Review the AlarmDecoder 集成 文档 to make sure the autobypass option is configured to your preference.

(@ajschmidt8 - #36692) (alarmdecoder docs)

  • Met Office

    This is now available for 配置 via the 集成 UI. You will need to ensure you keep a copy of the DataPoint API key handy to re-enable the 集成 in your server. The location being forecast is, by default, taken as the location of the server, so again if you were forecasting other locations you will need to have those GPS co-ordinates to hand, to re-enter them when configuring new 集成 through the UI.

    (@MrHarcombe - #34900) (metoffice docs)

  • Logbook

    Changes have been made which improve db performance of 状态 change events and reduce overall db size.

    • context_id has been removed from the logbook api.

    • Remove old/new 状态 data from 状态 change event data since it can now be found by a join of the 状态 table. This change avoids duplicate storage of the 状态 in the events table.

    • Remove support for the deprecated hidden 属性 from logbook and history.

    Examples showing how to find the old and new 状态 have been provided in the 状态 and Events 文档.

    (@bdraco - #36796, #36883, #37039) (alexa docs) (自动化 docs) (homekit docs) (logbook docs) (recorder docs) (history docs) (脚本 docs)

  • Recorder

    This breaking change only applies to you if you query/work with the Home Assistant database manually.

    entity_id validation now default to on when converting 状态 to native. To disable validation when converting 状态 to native, pass validate_entity_id=False to to_native or when using execute with to_native=True, pass validate_entity_ids=False

    Context ids are no longer duplicated in the states table. Join the events table on state.event_id to events.event_id to find the context_id instead.

    更多信息 about our database structure and how to query it, check out our Data Science Portal.

    (@bdraco - #36938, #37036) (history docs) (plant docs) (recorder docs) (statistics docs)

  • Denon AVR Network Receivers

    This is now available for 配置 via the 集成 UI. Please remove the previous Denon AVR platform from your configuration.yaml file. Denon and Marantz receivers are discovered automatically and show up under "配置"-> "集成", from there, click on 配置 and go through the steps. All previous setting options are still available during this 设置.

    If your receiver does not show up automatically, go to "配置"-> "集成"-> press the "+" icon -> search for "Denon AVR" and enter the 设置.

    (@starkillerOG - #35255) (denonavr docs)

  • Smapee

    The Smappee 集成 has been completely renewed with API v3 to support all types of Smappee monitors (Energy, Solar, Pro, Plus, Genius, Connect, P1S1 module) and 开关 (Comfort plug, 开关). Existing old 实体 will still be available in this new 集成, but their unique IDs will have changed. 用户 will need to remove the old remaining entries from the 实体 registry.

    The configuration.yaml file now only requires the client_id and client_secret. The username and 密码 will be asked on 认证 when setting up the 集成 via the 前端. Please check the 文档 for the details how to set up the 集成.

    Example YAML 配置:

    smappee:
      client_id: 1234
      client_secret: 5678

    (@bsmappee - #36445) (smappee docs)

  • Awair

    The Awair 集成 is now configured from the UI, but YAML 配置 will be automatically imported for you. The 集成 no longer supports listing specific 设备 to monitor, because the Awair API rate-limits now apply on a per-设备 basis, rather than per-account. If you do not wish for a 设备 to show up in the UI, simply disable its 实体 from the 集成 page.

    Additionally, the Awair 集成 no longer sets custom "device_class" 属性 for non-standard 传感器 (such as the "Awair Score" 传感器). This does not affect the operation of the 传感器, but if you relied on these non-standard values in your 配置 you may need to make adjustments.

    (@ahayworth - #34394) (awair docs)

  • Hunter Hydrawise

    Hydrawise made an API change that removed rain 传感器 status, changed the behavior of the automatic watering 开关, and the way in which the watering schedule is reported. As a result, the following backward-incompatible changes were made.

    • The rain 传感器 is no longer available.
    • The auto_watering 开关 状态 now reports off when the corresponding watering 区域 is actively watering. If auto_watering is enabled the 开关 status will report off when watering starts and will return to on when watering stops in that 区域.
    • The next_cycle 传感器 date & time 状态 string is now reported in UTC ISO format, e.g., 2020-06-18T13:52:27+0000. Suspended 区域 no longer report not_scheduled.

    (@ptcryan - #34448) (hydrawise docs)

  • Xiaomi Gateway (Aqara)

    YAML 配置 of the Xiaomi Aqara 集成 has been deprecated, please remove the xiaomi_aqara platform from your configuration.yaml file.

    Xiaomi Aqara Gateways are discovered automatically and show up under "配置"-> "集成", from there click on 配置 and go through the steps. If your Xiaomi Aqara Gateway does not show up automatically, go to "配置"-> "集成"-> press the "+" icon -> search for "xiaomi_aqara" and enter the 设置. If no key is provided during 设置, only the binary_sensor and 传感器 platforms will be available. A key is required to activate the other platforms.

    (@starkillerOG - #35595) (discovery docs) (xiaomi_aqara docs)

  • Withings

    Withings "profiles" in YAML 配置 is no longer supported and has been moved into UI-based 配置.

    (@vangorra - #36864) (withings docs)

  • Toon

    The Toon 集成 has been rewritten to support the new 认证 methods from Eneco/Electrabel and Viesgo. After upgrading, go to the 集成 面板, to re-authenticate the 集成. Please note, that you might need to 更新 your Toon App with a new redirect URL in the Toon Developer portal. Make sure to check the Toon 集成 文档 for information about the URL to use.

    The scan_interval YAML 配置 option has been deprecated. It is no longer used, as 此integrations is now push-based. If you have it configured, please remove it from your 配置.

    The "Holiday Mode" & "Toon Program" 二元sensor have been replaced by a "Holiday Mode" and "Thermostat Program" 开关, thus having new 实体. You may need to adjust your 自动化 if you used those in that.

    服务 toon.update has been removed, it is no longer needed as this is now a push-based 集成. Please make sure you remove those from your 自动化.

    (@frenck - #36952) (toon docs) (new-platform)

  • Translations

    This breaking change applies to maintainers and 用户 of custom 集成 (custom_components) that have used the .translations directory for translations, as previously warned that directory is no longer loaded.

    The new name for this directory is translations (without the . prefix), for Home Assistant to be able to load your files from this directory, simply remove the . from the name of it.

    If you publish your custom 集成 to GitHub, you should enable the hassfest 动作, this would have warned you about this change in the previous 3 releases.

    (@ludeeus - #37021)

  • MQTT

    • The embedded MQTT broker, which has been marked as deprecated for the past year, has now been removed.

    • Remove MQTT broker tls_version parameter from your 配置 and instead rely on auto negotiation.

    (@emontnemery - #37032, #37033) (MQTT docs)

  • Squeezebox

    This is now available for 配置 via the 集成 UI, and 配置 of the Squeezebox 集成 through configuration.yaml is now deprecated. Please consider using the 前端 to 配置 the Squeezebox 集成 instead. Servers will automatically be discovered by the "discovery" 集成, or by 此integrations once it is loaded. If the 用户 adds 此integrations from 前端, it will attempt to automatically discover the server as well.

    The Squeezebox 集成 will now handle individual players coming online or going offline while Home Assistant is running. Previously, the 集成 would only detect players that were present during startup.

    (@rajlaud - #35669) (squeezebox docs)

  • Alexa

    Alexa Flash Briefings 用户 must now set a 配置 option called password, like this:

    alexa:
      flash_briefings:
        password: YOUR_PASSWORD
        whoishome:
          - title: Who's at home?
            # ...

    If you had configured a flash briefing with the name password before, you have to rename it. It is not required anymore to use the legacy api_password 认证 to use Alexa Flash Briefings.

    You also have to change the endpoint in the Alexa Developer Console to include this 密码 in your URL, like this: https://YOUR_HOST/api/alexa/flash_briefings/BRIEFING_ID?password=YOUR_PASSWORD.

    (@Tho85 - #36789) (alexa docs)

  • remote_rpi_gpio

    A double inversion happening on the remote_rpi_gpio platform has been removed. This might inverse your 开关 behavior for this platform.

    (@auchter - #34390) (remote_rpi_gpio docs)

  • Custom 集成/components

    This is more a breaking change for 开发者 of custom 集成 for Home Assistant.

    Custom components depending on helpers.entityfilter for filtering may need an adjustment. Imports of FILTER_SCHEMA or BASE_FILTER_SCHEMA will be fine but any components directly depending on the convert_filter method will need to ensure the dictionary they are passing in has include_entity_globs or exclude_entity_globs fields specified.

    (@mdegat01 - #36913) (logbook docs) (recorder docs)

告别以下内容

The 集成 below have been removed:

发布 0.112.1 - July 2

发布 0.112.2 - July 3

发布 0.112.3 - July 6

发布 0.112.4 - July 9

发布 0.112.5 - July 14

所有变更

点击查看所有变更!