Use gammu commandline with some input_text from home assistant

Hello guys.

It’s my first post.
I’ve made some scripts to automate heating im house ( still in test ) and some integrations.

Im working with home assistant since 6 month’s and im impressed what it can do !!!

Right now im trying integrate gammu with home assistant

I’ve made some scipt with commandline and it’s working.

sms_test: "sudo echo 'test1' | sudo gammu sendsms TEXT 123456789"

its working fine but without any success when im trying like this

sms_test: 'sudo echo 'test1' | sudo gammu sendsms TEXT {{ states.input_text.sms_nr1.state }}'

Ive made a include in config file so in this folder i have a file with various commads

shell_command: !include_dir_merge_named _ha_shell_command

It would be great to have input text fields where You can make any configurations.

The idea is to create script to send sms with gammu with number or text from input_text.

I hope somebody will solve this issue or its not issue because im stupid ?

I don’t know if you can use the template there or not, but it looks like you have nested ' characters, which won’t work.

Yes of course Youre right but because it ovious its not the point
sms_test: 'sudo echo "Test GSM" | sudo gammu sendsms TEXT 123456789'
In this configuration its working. When im executing the script theres no issues in dev-info logs.
Im using many input_number fields in scripts and automations with success. But here no luck.

I think {{ states.input_text.sms_nr1.state }} does not give you 123456789 as you would expect. Try {{ states(‘input_text.sms_nr1’) }}.

Sorry, no. First i got unexpected char ’ but changed to ’ and also " and made a lot’s of variants but no luck. When i put a dot before bracket i had that expect a text or number.
In this variant {{ states(‘input_text.sms_nr1’) }} no errors but also no effect :frowning:
It’s so annoying. Seems to be very simple…