Fix Syntax Error

This commit is contained in:
2022-05-28 10:36:34 -07:00
parent 13751ee291
commit b0d8c661ef

View File

@@ -124,6 +124,12 @@ automation:
- service: notify.telegram_home - service: notify.telegram_home
data: data:
message: > message: >
Alarm changed to {{ trigger.to_state.state|replace('_', ' ')|capfirst }} by {% {%
set username = states.person|selectattr('attributes.user_id', 'eq', trigger.to_state.context.user_id)|first|default('Automation')) set person = states.person
%}{{ username }} |selectattr('attributes.user_id', 'eq', trigger.to_state.context.user_id)
|first|default({'attributes':{'friendly_name':'Automation'}})
%}Alarm changed to {{
trigger.to_state.state|replace('_', ' ')|title
}} by {{
person.attributes.friendly_name
}}