Skip to content

Commit 614ceaf

Browse files
T3m3zfabaff
authored andcommitted
Add example of tag usage inside yaml (home-assistant#1210)
* Add example of tag usage inside yaml This helps users to see how extra information passed to notification shuld be placed under data->data. In this case it's data->data->tag. * Added raw/endraw to message template.
1 parent 103baf2 commit 614ceaf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

source/_components/notify.html5.markdown

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@ By default, every notification sent has a randomly generated UUID (v4) set as it
111111
}
112112
```
113113

114+
Example of adding a tag to your configuration. This won't create new notification if there already exists one with the same tag.
115+
116+
```yaml
117+
- alias: Push/update notification of sensor state with tag
118+
trigger:
119+
- platform: state
120+
entity_id: sensor.sensor
121+
action:
122+
service: notify.html5
123+
data_template:
124+
message: "Last known sensor state is {% raw %}{{ states('sensor.sensor') }}{% endraw %}."
125+
data:
126+
data:
127+
tag: 'notification-about-sensor'
128+
```
129+
114130
#### {% linkable_title Targets %}
115131

116132
If you do not provide a `target` parameter in the notify payload a notification will be sent to all registered targets as listed in `html5_push_registrations.conf`. You can provide a `target` parameter like so:

0 commit comments

Comments
 (0)