Shell command problem turning on Kodi

Hi everyone. I have an strange behaviour turning on Kodi with Google Assistant.

I have defined these two shell commands:

shell_command:
  kodi_on: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa pi@private_ip '/usr/bin/kodi &'
  kodi_off: ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa pi@private_ip '/usr/bin/killall -9 kodi.bin_v8'

The problem is that turning on Kodi via Google Home, Google says that there is a problem turning on Kodi, but Kodi starts without problem.

Turning off Kodi works perfectly.

I suppose the problem is ‘kodi’ command to start Kodi doesn’t finish, and the killall command to turn off kodi finalize, so Google undestand everything has gone well.

Do you know if there is a better way to start Kodi, or if there is other better way to do this?

Thanks

How about these options? https://www.home-assistant.io/integrations/kodi/#kodi-turn-onoff-samples

@tom_l it does not work because Kodi is installed in the same server as Home Assistant, The server is always on, but Kodi is not always on.

You can add your Kodi via intergration:

Keep your kodi active. Then you also can use the mediaplayer info “play” “pause” and “idle” in some automations if you want.

@poudenes I have got it, define in this way:

  - platform: kodi
    name: Kodi Living Room
    host: !secret home_internal_ip
    turn_on_action:
      - service: shell_command.kodi_on
    turn_off_action:
      - service: shell_command.kodi_off

But the problem remains. As I said, it works, but Google don’t think so…

if you want close the application total then yes you need this.
I’ll keep kodi alive always. :slight_smile:

Does not anyone know how to execute a prompted shell command with succeed?