Executing shell comand not possable

Hey guy,
I wrote my own python script (copying an Intertechno 433Mhz remote control). Now I want to run the commands like it is working in the shell “python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on”. So I followed the official hass instruction

shell_command:
  a_on: python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on

and

tried to integrate the command as a switch like here

switch:
  - platform: command_line
    switches:
      kitchen_light:
        a_on: switch_command on kitchen
        a_off: switch_command off kitchen

I get this error:

Invalid config for [switch.command_line]: [a_on] is an invalid option for [switch.command_line]. Check: switch.command_line->switches->kitchen_light->a_on. (See ?, line ?).

I also tried to execute the shell command “python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on” in the hass-file-editor and got “error 2: no such a file or directory python”

What did I wrong here?

Thanks for your help.

Should it not be command_on and command_off

thanks for your reply. I changed it as follows

shell_command:
  a_on: python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on
  a_off: python /usr/share/hassio/homeassistant/scripts/send_Int.py a_off

and

# Intertechno Shell command
  - platform: a_on
    switches:
      kitchen_light:
        command_on: switch_command on kitchen

  - platform: a_off
    switches:
      kitchen_light:
        command_off: switch_command on kitchen

But switch.a_on and switch.a_off wasn’t found:


Platform error switch.a_on - Integration 'a_on' not found.
Platform error switch.a_off - Integration 'a_off' not found.
switch:
  - platform: command_line
    switches:
      kitchen_light:
        command_on: switch_command on kitchen
        command_off: switch_command off kitchen
…

Try this

Just a wild guess: single/double quotes?

same problem. Just to get it right:

  1. shell command is
    python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on

  2. installed shell command
    a_on

  3. installed switch (so the new service/entity name)

switch:
  - a_on

I’m I right?

EDIT: I also tried via the HassIO Terminal to hand over the shell command (user core-ssh). But I got an bash error that python command wasn’t found. In my Putty (user: root) the command is working. Could it be that the hassio-user hasn’t the rights to execute Python?

If I read the docs regarding command line switch it says you need to set the scripts for command_on and command_off

Not sure where you got a_on and a_off from

It should be something like this

command_on: shell_command.a_on