From: Giorgio Ravera Date: Fri, 23 Oct 2020 09:31:46 +0000 (+0200) Subject: Improved notification with variables X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=911d34d9988a88f2a8b3be6e0c9e15fea6e8aec7;p=homeassistant.git Improved notification with variables --- diff --git a/scripts/notify.yaml b/scripts/notify.yaml index 35504431..0391b2fc 100644 --- a/scripts/notify.yaml +++ b/scripts/notify.yaml @@ -12,9 +12,21 @@ # - persistent_notification.create (if enable_persistent) ###################################################################### -notify_text_internal: +notify_text: alias: Notifiche testuali + variables: + title: >- + {# Check Null Input #} + {% if title | length == 0 %} + {% set title = 'Home Assistant' %} + {% endif %} + {{ title }} + sequence: + - condition: state + entity_id: input_boolean.text_notifications + state: 'on' + - service: notify.mail data_template: title: "{{ title }}" @@ -48,25 +60,6 @@ notify_text_internal: {% endif %} {{ notification_id }} -notify_text: - alias: Notifiche testuali - sequence: - - condition: state - entity_id: input_boolean.text_notifications - state: 'on' - - - service: script.notify_text_internal - data_template: - title: >- - {# Check Null Input #} - {% if title | length == 0 %} - {% set title = 'Home Assistant' %} - {% endif %} - {{ title }} - message: "{{ message }}" - notification_id: "{{ notification_id }}" - enable_persistent: "{{ enable_persistent }}" - ###################################################################### # Script: Volume Manager # Input: