From 663d5617c7c01a3e97ce786295a46af78eae62f8 Mon Sep 17 00:00:00 2001 From: Carlo Costanzo Date: Mon, 27 Apr 2020 10:13:32 -0400 Subject: [PATCH] Moved merge to a Comment in the YAML I LIKE THE ALTERNATIVE WAY OF DOING IT. Thanks for submitting! --- config/automation/Speech/announcements.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/automation/Speech/announcements.yaml b/config/automation/Speech/announcements.yaml index 9948d8dc..69be6ab4 100755 --- a/config/automation/Speech/announcements.yaml +++ b/config/automation/Speech/announcements.yaml @@ -20,8 +20,9 @@ {{ states.binary_sensor.kitchen_door.state == 'on' }} - service: script.speech_engine data_template: +# {% set person = state_attr(trigger.entity_id, "friendly_name")%} This is another way to do it. personarriving: > - {% set person = state_attr(trigger.entity_id, "friendly_name")%} + {% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%} {%- macro greeting_sentence(person) -%} {{ [ "Welcome back home " ~ person,