From 614ceaf735a870dc359dd945e680af1d00d95381 Mon Sep 17 00:00:00 2001 From: Teemu Mikkonen Date: Tue, 11 Oct 2016 13:21:38 +0300 Subject: [PATCH] Add example of tag usage inside yaml (#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. --- source/_components/notify.html5.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/_components/notify.html5.markdown b/source/_components/notify.html5.markdown index 3f35924e1e1..6fa51e4417d 100644 --- a/source/_components/notify.html5.markdown +++ b/source/_components/notify.html5.markdown @@ -111,6 +111,22 @@ By default, every notification sent has a randomly generated UUID (v4) set as it } ``` +Example of adding a tag to your configuration. This won't create new notification if there already exists one with the same tag. + +```yaml + - alias: Push/update notification of sensor state with tag + trigger: + - platform: state + entity_id: sensor.sensor + action: + service: notify.html5 + data_template: + message: "Last known sensor state is {% raw %}{{ states('sensor.sensor') }}{% endraw %}." + data: + data: + tag: 'notification-about-sensor' +``` + #### {% linkable_title Targets %} 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: