Notify.Events

Description

The Notify.Events service is an integration for the notify integration.

该平台允许您快速配置不同收件人之间的消息分发,无论他们习惯如何接收通知:

您可以在此处找到完整支持的信使列表。

Setting up

To start getting notifications, you need to follow those simple steps:

  1. Sign up to Notify.Events and create a Channel
  2. Add Home Assistant source to this channel and get your token
  3. Add the Notify.Events integration to your installation by adding the following to your configuration.yaml file:
notify_events:
  token: YOUR_TOKEN
token:
  description: Your channel source token.
  required: true
  type: string

Now you can use notify_events integration as a platform for your notify service, add the following to your configuration.yaml file. After changing the configuration.yaml file, restart Home Assistant to apply the changes. The integration is shown on the integrations page under Settings > Devices & services. Its entities are listed on the integration card itself and on the Entities tab.:

# Example configuration.yaml entry

notify:
  - name: NOTIFIER_NAME (e.g. "events")
    platform: notify_events
name:
  description: "The optional parameter `name` allows multiple notifiers to be created. The notifier will bind to the `notify.NOTIFIER_NAME` action."
  required: false
  type: string
  default: notify

That's it!

现在,您可以使用 Home Assistant 中的“notify.events”操作来:

  • 发送任何通知或警报
  • 按“级别”和“优先级”分配事件
  • 附加文件图像(本地或远程)
  • ..并继续使用您最喜欢的信使来接收它们!

Example action

- action: notify.events
  data:
    message: "Backyard motion detected!"
    data:
      level: "warning"
      priority: "high"
      images:
        - name: "local_photo.jpg"
          path: "/tmp/backyard_cam/motion.jpg"
        - name: "remote_photo.jpg"
          url: "https://i.ibb.co/Jt1845X/motion.jpg"

消息可选参数

以下属性可以放置在“data”中以实现扩展功能。

AttributeDescription
titleMessage title.
levelFor recipients who have differences in the display of messages at different levels, this level will be applied.
Available values: verbose, info, notice, warning, error, success.
priorityFor recipients which supports priority, the message will be highlighted accordingly.
Available values: lowest, low, normal, high, highest.
imagesArray of images to attach (see item properties below).
filesArray of files to attach (see item properties below).
tokenNotify.Events channel token (in case you want to override the channel to get this message to).

每一项图像和文件都具有以下属性:

PropertyRequiredDescription
path or url or contentTrueFile source.
nameFalseResult file name
mime_typeFalseFile MIME-type

要有效地使用通知,请参阅自动化入门页面