Franck Nijhof 1833c32a2c Cleans up front matter (#9835)
* Sets front matter defaults

* Removes default front matter from section templates/pages

* Removes default front matter from addon pages

* Removes default front matter from integration pages

* Removes default front matter from posts

* Removes default front matter from docs pages

* Removes default front matter from other pages

* Fixes blog category pages
2019-07-11 14:35:08 -07:00

3.2 KiB

title, description, logo, ha_category, ha_qa_scale, ha_release
title description logo ha_category ha_qa_scale ha_release
Notifications Instructions on how to add user notifications to Home Assistant. home-assistant.png
Notifications
internal 0.7

The notify integration makes it possible to send notifications to a wide variety of platforms. Please check the sidebar for a full list of platforms that are supported.

If you want to send notifications to the Home Assistant Web Interface you may use the Persistent Notification Component.

Service

Once loaded, the notify platform will expose a service that can be called to send notifications.

Service data attribute Optional Description
message no Body of the notification.
title yes Title of the notification. Default is Home Assistant.
target yes Some platforms will allow specifying a recipient that will receive the notification. See your platform page if it is supported.
data yes On platforms who have extended functionality. See your platform page if it is supported.

The notification integration supports specifying templates with data_template. This will allow you to use the current state of Home Assistant in your notifications.

In an action of your automation setup it could look like this with a customized subject.

action:
  service: notify.notify
  data:
    message: "Your message goes here"
    title: "Custom subject"

Test if it works

A simple way to test if you have set up your notify platform correctly, is to use service developer tool icon Services from the Developer Tools. Choose your service from the dropdown menu Service, enter something like the sample below into the Service Data field, and hit CALL SERVICE.

{
  "message": "The sun is {% raw %}{% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}{% endraw %}!"
}

The automation equivalent would be:

action:
  service: notify.notify
  data:
    message: "The sun is {% raw %}{% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}{% endraw %}!"

For services which have support for sending images.

{ "message": "Test plugin",
  "data": {
    "photo": {
        "url": "http://www.gbsun.de/gbpics/berge/berge106.jpg"
    }
  }
}

The automation equivalent would be:

action:
  service: notify.notify
  data:
    message: "Test plugin"
    data:
      photo:
        url: "http://www.gbsun.de/gbpics/berge/berge106.jpg"

If the service support sending the location, the data from this sample can be used.

{ "message": "Test plugin",
  "data": {
    "location": {
      "latitude": 7.3284,
      "longitude": 46.38234
    }
  }
}

The automation equivalent would be:

action:
  service: notify.notify
  data:
    message: "Test plugin"
    data:
      location:
        latitude: 7.3284
        longitude: 46.38234