Notifications for Android TV / Fire TV
Notification integration for Notifications for Android TV
The notifications are in the global scope of your Android TV device. They will be displayed regardless of which application is running.
When setting this up be aware, that there are two apps: one for your smartphone to send notifications (not required for this platform) and one for your Android TV device to receive the notifications. The app available in the store of your Android TV device is the one that is needed to display notifications sent from Home Assistant. The In-App purchases only apply to the client for Android smartphones, so there isn’t any limit when pushing notifications from Home Assistant.
配置
要将 Notifications for Android TV / Fire TV service 添加到您的 Home Assistant 实例中,请使用此 My 按钮:
手动配置步骤
如果上述 My 按钮不起作用,您也可以手动执行以下步骤:
-
浏览到您的 Home Assistant 实例。
-
转到
设置 > 设备与服务。 -
在右下角,选择
Add Integration 按钮。 -
从列表中选择 Notifications for Android TV / Fire TV。
-
按照屏幕上的说明完成设置。
Actions
The following options can be specified inside the data field for the notify action:
Action notify.[name_of_your_tv]
This is a fully customized YAML you can use inside data
to test how the final notification will look like (for using this inside an action look at the example at the end of this page):
fontsize: "large"
position: "center"
duration: 2
transparency: "0%"
color: "red"
interrupt: 1
Action data for sending images and icons
Data attribute | Optional | Description |
---|---|---|
image |
yes | Groups the attributes for image upload. It can take a url or path . It is optional unless you use authentication options. Then, either url or path has to be provided. |
icon |
yes | Groups the attributes for icon upload. It can take a url or path . It is optional unless you use authentication options. Then, either url or path has to be provided. |
path |
yes | Local path of an image file. Is placed inside image , icon , or both. |
url |
yes | URL of an image file. Is placed inside image , icon or both. |
username |
yes | Username if the URL requires authentication. Is placed inside image , icon or both`. |
password |
yes | Password if the URL requires authentication. Is placed inside image , icon or both. |
auth |
yes | If set to digest HTTP-Digest-Authentication is used. If missing, HTTP-BASIC-Authentication is used and is placed inside image , icon or both. |
Example action data for both image and icons:
# If your urls do not require extra authentication
icon: "http://[url to image file]"
image: "http://[url to image file]"
# Paths in most cases
icon: "/you/path/location"
image: "/you/path/location"
# Or alternatively
icon:
path: "/you/path/location"
image:
path: "/you/path/location"
# If your urls require extra authentication
image:
url: "http://[url to image file]"
username: "optional user, if necessary" # Optional
password: "optional password, if necessary" # Optional
auth: "digest" # Optional
icon:
url: "http://[url to image file]"
username: "optional user, if necessary" # Optional
password: "optional password, if necessary" # Optional
auth: "digest" # Optional
Example of an automation with an action, full configuration:
action: notify.living_room_tv
data:
title: "Thanks for the water!"
message: "Nigel is {{ states('sensor.nigel_moisture') }}% moisture"
data:
duration: 4
position: "bottom-left"
fontsize: "medium"
transparency: "75%"
color: "teal"
interrupt: 0
Please note that path
is validated against the allowlist_external_dirs
in the configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more].