Switching 433MHz sockets via Shell_Command

Hallo fellows,
I wrote my own python script switching my 433MHz sockets from Intertechno using the cheap 433MHz transmitter. In the Putty-Terminal it works great using the following shell commands:

#on 
python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on
#off
python /usr/share/hassio/homeassistant/scripts/send_Int.py a_off

Now I want to integrate the script as an device via shell command. I know its also possible using the Python-Script-Documentation of Hass but I also want to integrate my IR-remotes using LIRC-send via shell Command with irsend later on.

Could you tell me my programmer mistakes please? Or could you give me a hint in case I follow a wrong approach?

My configuration.yaml looks like:

shell_command:
  a_on: 'ssh [email protected] python /usr/share/hassio/homeassistant/scripts/send_Int.py a_on'
  a_off: ssh [email protected] python /usr/share/hassio/homeassistant/scripts/send_Int.py a_off
  #set_JVC: irsend SEND_ONCE av KEY_VOLUMEUP

@PaFcio summarized the SSH shell commands here
There is a discussion of setting the permissions here. The script has the execution rights for Linux root user. Do I really need the ssh [email protected] prefix?

Also I’m not sure about the quotation marks in the shell_command. Do I need to enclose everything with --> ’ <–?

  1. First try using a switch: the dashboard switch in the Lovelace looks like (doesn’t work):
name: light on
show_icon: true
show_name: true
tap_action:
  action:
    service: shell_command.a_on
type: button
show_state: false
  1. Second try - using a automation
    I also tried to setup an automation in automation.yaml hoping the automation works (it isn’t). It is not even listed in the automations.
- id: '1234' #random
  trigger:
   platform: homeassistant
   alias: 433MHZ-Dimmer
   description: Dimmer an
   event: start
  action:
  service: shell_command.a_on

- id: '1235' #random
  trigger:
   platform: homeassistant
   alias: 433MHZ-Dimmer
   description: Dimmer aus
   event: start
  action:
  service: shell_command.a_off

My System

version core-2021.3.4
installation_type Home Assistant Supervised
dev false
hassio true
docker true
virtualenv false
python_version 3.8.7
os_name Linux
os_version 5.10.17-v7+
arch armv7l
timezone UTC
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Hass.io
host_os Raspbian GNU/Linux 10 (buster)
update_channel stable
supervisor_version supervisor-2021.03.6
docker_version 20.10.5
disk_total 58.2 GB
disk_used 8.1 GB
healthy true
supported failed to load: Unsupported
supervisor_api ok
version_api ok
installed_addons File editor (5.2.0), Spotify Connect (0.8.2), Let’s Encrypt (4.11.0), NGINX Home Assistant SSL proxy (3.0.1), Mosquitto broker (5.1.1), Zigbee2mqtt (1.18.2-1), Hey Ada! (1.1.1), Terminal & SSH (9.1.0), AirCast (3.0.0), Portainer (1.4.0)
Lovelace
dashboards 1
resources 0
views 1
mode storage

Is the script on the ha machine or some other machine?

Well good question.

I use a dockerized HA-Core (supervized) on a Linux system and didn’t install any VM.
The directory is /usr/share/hassio/homeassistant/scripts/ (from root).
I assume the script isn’t on a virtual machine. Any hint to find out?

Still struggeling. Any hints?