I’m playing a bit with telegram notifications, and my aim is to prepare some automations that will trigger some scripts, based on the agument given. all looks kinda easy, but I’m hitting a wall now, probably just because additional ‘’ which I can’t remove…
this is my automation:
alias: test_automation
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/hello'
action:
- service: script.test_notify
data_template:
var_text: >
{% if is_state('{{ trigger.event.data.args }}', "keyword") %}
you've entered the keyword!
{% else %}
{{ trigger.event.data.args }}
{% endif %}
my test_notify script is as follows:
sequence:
- service: notify.my_telegram_bot
data_template:
message: "{{ var_text }}"
now, whatever I enter after /hello my bot send a message like this:
'<text string>'
so even if I enter /hello keyword [while the “keyword” should match the if condition] it still runs the “else” condition and outputs
'keyword'
instead of you’ve entered the keyword!
what I did wrong here?