mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 21:36:52 +00:00
Add screenshot and more details
This commit is contained in:
parent
c4ff46d743
commit
c4dc276e77
@ -14,4 +14,41 @@ ha_release: 0.23
|
||||
|
||||
The `persistant_notification` can be used to show a message on the frontend that has to be dismissed by the user.
|
||||
|
||||
The service `persistent_notification/create`. Takes in `message`, `title`, and `notification_id`. If `notification_id` is given, it will overwrite the notification if there already was a notification with that id.
|
||||
<p class='img'>
|
||||
<img src='/images/screenshots/persistant-notification.png' />
|
||||
</p>
|
||||
|
||||
### {% linkable_title Service %}
|
||||
|
||||
The service `persistent_notification/create` takes in `message`, `title`, and `notification_id`.
|
||||
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `message` | no | Body of the notification.
|
||||
| `title` | yes | Title of the notification.
|
||||
| `notification_id` | yes | If `notification_id` is given, it will overwrite the notification if there already was a notification with that ID.
|
||||
|
||||
The `persistant_notification` component supports specifying [templates](/topics/templating/) for both the `message` and the `title`. This will allow you to use the current state of Home Assistant in your notifications.
|
||||
|
||||
In an [action](https://home-assistant.io/getting-started/automation-action/) of your [automation setup](/getting-started/automation/) it could look like this with a customized subject.
|
||||
|
||||
```yaml
|
||||
action:
|
||||
service: persistant_notification.create
|
||||
data:
|
||||
message: "Your message goes here"
|
||||
title: "Custom subject"
|
||||
```
|
||||
|
||||
### {% linkable_title Create a perstistant notification %}
|
||||
|
||||
Use **Call Service** from the **Developer Tools** to call the `persistant_notification` service. Choose `persistant_notification/create` from the list of **Available services:** and enter something like the sample below into the **Service Data** field and hit **CALL SERVICE**.
|
||||
|
||||
```json
|
||||
{
|
||||
"notification_id": "1234",
|
||||
"title": "Sample notification",
|
||||
"message": "This is a sample text"
|
||||
}
|
||||
```
|
||||
This will create the notification entry shown above.
|
||||
|
BIN
source/images/screenshots/persistant-notification.png
Normal file
BIN
source/images/screenshots/persistant-notification.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
Loading…
x
Reference in New Issue
Block a user