mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 01:37:23 +00:00
Add templating to notify
This commit is contained in:
parent
c36914e687
commit
3110bd5a03
@ -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`.
|
| `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.
|
| `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 %}
|
### {% 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**.
|
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
|
```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 %}!"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user