Launch a remote python command on a different Rpi3

Hi !

I’m trying for few days to launch a python command on a remote raspberry pi.
It keeps not working.

This is my both configuration I tried :slight_smile:

shell_command:
  matrix_led_demo: ssh -o StrictHostKeyChecking=no [email protected] 'python3 /home/pi/luma.led_matrix/examples/matrix_demo.py'

and

switch:
  - platform: command_line
    switches:
      matrix_led:
        command_on: ssh -o StrictHostKeyChecking=no [email protected] 'python3 /home/pi/luma.led_matrix/examples/matrix_demo.py'

I tried many explanation found in different topics, but it keeps failing :frowning:

Do you have any idea ?
Thanks !
Andy
(excuse my english, I’m french).

Does the command work on the remote pi?

Yes it does!
It also does remotely from the shell of HA
:wink:

Anything in the HA log, or the receiving pi ssh log?

Did you copy the public SSH keys to the remote machine?

Sorry guys,
It took me a long time to answer the question : I did have a lot of work because of the pandemic :frowning:
Meanwhile, the pi crashed out and I have to reinstall it.
So, I’ll be back to you when it’s time.
Thank you by the way for your answers.
Andy