Command_line error

Can anyone give me a clue as to why this will not work using command_line. This executes on another Pi running KODI. ssh keys are set up and I can ssh to my hass.io Pi and execute it from the command line and it works fine. But when calling from HA it fails. Any ideas? I have tried various ways of escaping combinations of single quotes and double quotes. The only thing I can get to work correctly on the hass.io command line is the command as it is shown below. But when executing using single quotes from within HA using command_line it fails. Thank you.

Command failed: ssh [email protected] "kodi-send -a \"SlideShow(/storage/pictures/hawaii)\"

Copy and paste it at the command prompt on my hass.io Pi and it does what it is supposed to do on the Kodi Pi.

Config in configuration.yaml

switch:
  - platform: command_line
    switches:
      hawaii:
        command_on: 'ssh [email protected] "kodi-send -a \"SlideShow(/storage/pictures/hawaii)\""'
        friendly_name: Hawaii

The keys you set up - was that by SSHing on? If so you’re in a different container than the one that Hass.io runs in. You need to put the keys in /config and specify them on the command line.

It was by ssh on. I wondered if that could be a problem. I’ll give it a try. Thanks