使用 TTS 发送通知

notify TTS 平台让您可以使用 TTS 集成 speak 或传统 say 动作和 media_player 来提醒您重要事件。该集成为您的自动化和警报提供了简单的接口。

要使用此集成,您必须已经安装和配置了 TTS 平台,并且有一个与 TTS 平台配合使用的 media_player。

要在您的安装中启用此平台,请考虑以下使用 google_translate 和示例 media_player.living_room 的示例。

在您的 configuration.yamlconfiguration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] 文件中输入:

notify:
  - platform: tts
    name: in_the_living_room
    entity_id: tts.google_en_com
    media_player: media_player.living_room

Configuration Variables

name string Required

通知动作的名称。

entity_id string (Exclusive)

要定位的 TTS 实体的 entity_id。可以使用 entity_idtts_service 来定位 TTS 平台。

tts_service string (Exclusive)

TTS 平台的 service_name。可以使用 entity_idtts_service 来定位 TTS 平台。

media_player string Required

media_player 的 entity_id

language string (Optional)

要传递给 TTS speaksay 动作的 language