Alias for a Shell_command.How?

Hi,

what would be the correct syntax for an alias for a shell_command, mentioned on https://home-assistant.io/components/shell_command/ unfortunately there;s no example ?

i have tried like this, bit this error out:

sw_tester_state_cl:
  alias: Tester State (cl)
  tester_state: >-
    curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"58ab8595", "prop":"state"}}' http://192.168.xxx.xxx/iungo/api_request

error:

Error running command: OrderedDict([(‘alias’, ‘Tester State (cl)’), (‘tester_state’, ‘curl -X POST -d ‘{“seq”:1, “method”:“object_prop_get”, “arguments”:{“oid”:“58ab8595”, “prop”:“state”}}’ http://192.168.xxx.xxx8/iungo/api_request’)]), return code: 2

Cheers,
Marius

I haven’t had a need for alias on shell commands because I can’t show them on the front end. To execute them, I need to put them in a automation or template switch.

yes, i understand that, but since the documentation mentions an alias configurable option, i would like to know how…always easier to use a nice alias

The shell_command does nothing other than register a service. There is no component to give an alias to. When the docs talk about the alias then they can only be talking about the shell command name.

i.e. in the example

shell_command:
  restart_pow: touch ~/.pow/restart.txt

Then restart_pow is the alias

ok thanks, I’ve changed accordingly, saves a lot of code…:wink:

maybe the docs should be updated to reflect that, and take out the alias bit, cause thats incorrect as is stands.