From 3110bd5a037cbd846122003344ec251debcdab69 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 20 Dec 2015 00:08:38 -0800 Subject: [PATCH] Add templating to notify --- source/_components/notify.markdown | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/_components/notify.markdown b/source/_components/notify.markdown index 7082d2f4b37..ed8f64c4d7d 100644 --- a/source/_components/notify.markdown +++ b/source/_components/notify.markdown @@ -35,12 +35,16 @@ Once loaded, the `notify` platform will expose a service that can be called to s | `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. +The notification component supports specifying [templates] for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications. + +[templates]: /getting-started/templating/ + ### {% linkable_title Test if it works %} A simple way to test if you have set up your notify platform correctly is to use **Call Service** from the **Developer Tools** to call your notify service. Choose your service (*notify/xyz*) from the list of **Available services:** and enter something like the sample below into the **Service Data** field and hit **CALL SERVICE**. ```json { - "message": "A simple test message from HA." + "message": "The sun is {% raw %}{% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}{% endraw %}!" } ```