I have tried this script but it doesn’t work for me. Using Home Assistant V.63.3
msg_who_is_home:
sequence:
- service: notify.notify
message: >
{% if is_state(‘device_tracker.paulus’, ‘home’) %}
Ha, Paulus is home!
{% else %}
Paulus is at {{ states(‘device_tracker.paulus’) }}.
{% endif %}
What is the right syntax for this version of Home Assistant?
Please see the large blue box at the top about correctly formatting your post
You need to put the message under data: to use fixed messages, and data_template: for template use. Look at the documentation
msg_who_is_home:
sequence:
- service: notify.notify
data_template
message: >
{% if is_state('device_tracker.paulus', 'home') %}
Ha, Paulus is home!
{% else %}
Paulus is at {{ states('device_tracker.paulus') }}.
{% endif %}
I’ve found the example that you copied and I’ll arrange for it to be corrected.
Thank you sir, i didn’t see the blue blox above. Thanks for pointing it out. By the way you missed the semi column at the end of data template, but that worked perfectly.