From 8a0dff1ff281c7739553cc86ebbf4d0df29581bf Mon Sep 17 00:00:00 2001 From: mbo18 Date: Thu, 8 Aug 2019 20:28:12 +0200 Subject: [PATCH] Update example following #9957 (#10086) Update example following updater changes in Home-Assistant #25418 --- .../notify_if__new_ha_release.markdown | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/source/_cookbook/notify_if__new_ha_release.markdown b/source/_cookbook/notify_if__new_ha_release.markdown index bf02f857a8b..771693bdd37 100644 --- a/source/_cookbook/notify_if__new_ha_release.markdown +++ b/source/_cookbook/notify_if__new_ha_release.markdown @@ -15,34 +15,38 @@ notify: recipient: recipient@jabber.org automation: - - alias: Update notifications + - alias: Update notification trigger: - platform: state - entity_id: updater.updater + entity_id: binary_sensor.updater + from: 'off' + to: 'on' action: - service: notify.jabber - data: - message: 'There is a new Home Assistant release available.' + - service: notify.jabber + data: + message: 'There is a new Home Assistant release available.' ``` You can use [templates](/topics/templating/) to include the release number of Home Assistant if you prefer. The following example sends a notification via [Pushbullet](/components/notify.pushbullet/) with the Home Assistant version in the message. ```yaml notify: - platform: pushbullet - api_key: 'YOUR_KEY_HERE' - name: pushbullet + - platform: pushbullet + api_key: 'YOUR_KEY_HERE' + name: pushbullet automation: - - alias: Update notifications - trigger: - - platform: state - entity_id: updater.updater - action: - service: notify.pushbullet - data_template: - title: 'New Home Assistant Release' - target: 'YOUR_TARGET_HERE' #See Pushbullet integration for usage - message: "Home Assistant {% raw %} {{ states('updater.updater') }} {% endraw %} is now available." + - alias: Update notification + trigger: + - platform: state + entity_id: binary_sensor.updater + from: 'off' + to: 'on' + action: + - service: notify.pushbullet + data_template: + title: 'New Home Assistant Release' + target: 'YOUR_TARGET_HERE' #See Pushbullet integration for usage + message: "Home Assistant {% raw %} {{ state_attr('binary_sensor.updater', 'newest_version') }} {% endraw %} is now available." ```