Hi, I’ve been trying to figure out how to adapt some code I had found to use for a different automation, but it isn’t working right for my adaptation. Help, please.
With the below example, it’s the notification icon part that isn’t working. I added the “else” part at the end just to see if that would work and it does, so I’m just not getting the icon to be correct when the trigger ID is actually one of those 2 things, as the above message part works fine. The Trigger ID does not include quotations for what it’s worth. Thanks.
action: notify.mobile_app_phone
metadata: {}
data:
message: The {{ trigger.id }} has finished.
data:
notification_icon: >-
{% if "{{ trigger.id }}" == "On" -%} mdi:vibrate {%- elif
"{{ trigger.id }}" == "Off" -%} mdi:vibrate-off {%- else -%}
mdi:cctv {%- endif %}
ttl: 0
priority: high
title: Alert