as always, when working on one thing, the second one pops up as an idea BTW, that “just can’t wait”…
this time I thought that something like “a script console” in Telegram could be usefull/fun while debugging and testing, so my plan is to make an automation that is triggered by TG command, it takes the first argument and uses it as script name that should be run next, but - as you probably already guessed - I’m stuck
here’s what I’ve got:
automation:
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/runscript'
action:
- service: template
value_template: script.{{ trigger.event.data.args[0] }}
data_template:
var_message: "testing the *{{ trigger.event.data.args[0] }}* script"
script:
sequence:
- service: notify.my_telegram_bot
data_template:
message: "OUTPUT: {{ var_message }}"
so as you can see, I want to have an option, that I write to my bot:
/runscript here_is_the_name_of_script
and then hass.io runs the script.here_is_the_name_of_script
while checking the configuration in dashboard - it fails hard (I can’t even give you the error message, as the whole configuration is printed out as the error output - it is way too long (that’s what she said ))
I’m guessing, that my service: template (and the whole construction after that) isn’t something that is correct, but here’s the place for my question:
is there any actual way to use variable as the script- [or even entity-] name?