Script error? (this is too simple to be true..)

hi,
trying my first script, copied it from the example, and only changed to real device name… still log give this error:
Invalid config for [script]: [message] is an invalid option for [script]. Check: script->script->msg_who_is_home->sequence->0->message.

script (in scripts.yaml) is:
msg_who_is_home:
sequence:
- service: notify.ios_telefoonmhb
message: >
{% if is_state(‘device_tracker.telefoon_marijn’, ‘home’) %}
Ha, Marijn is home!
{% else %}
Marijn is at {{ states(‘device_tracker.telefoon_marijn’) }}.
{% endif %}

if i put a hyphen in front of th script, the error reads:

ERROR (MainThread) [homeassistant.config] Invalid config for [script]: expected a dictionary for dictionary value @ data['script']. Got [OrderedDict([('msg_who_is_home', None), ('sequence', [OrderedDict([('service', 'notify.ios_telefoonmhb'), ('message', "{% if is_state('device_tracker.telefoon_marijn', 'home') %}\n  Ha, Marijn is home!\n{% else %}\n  Marijn is at {{ states('device_tracker.telefoon_marijn') }}.\n{% endif %}")])])])]. (See /config/configuration.yaml, line 97). Please check the docs at https://home-assistant.io/components/script/

what is keeping it from executing ??
sorry if this is too stupid for words, might be the time of day…
Marius

Can you use code blocks in your script in your post? Can’t tell but am guessing it’s an indentation issue.

i did…
maybe that’s it :wink:
will have another try:
msg_who_is_home:
sequence:
- service: notify.ios_telefoonmhb
message: >
{% if is_state(‘device_tracker.telefoon_marijn’, ‘home’) %}
Ha, Marijn is home!
{% else %}
Marijn is at {{ states(‘device_tracker.telefoon_marijn’) }}.
{% endif %}

don’t know why this won’t show as it’s supposed to.

this is what it looks like in my editor:

54

The sequence is incorrect. message should be under data…see docs.

‘data_template’ in this case

thanks,

one might consider changing the example on https://home-assistant.io/docs/configuration/templating/ then…

though being correct Yaml (according to Yamllint.com, it isn’t a correct script :-)(
Cheers!
Marius