Launch a python script on Kodi with Homeassistant

Just curious if it’s possible to launch one of my python scripts from home assistant?

Or to send a command, for example:


Kodi may well have an api that you can call directly, which will be a better solution, but you can use ssh from a command line switch, or anywhere you can use the command line to run your python script on the remote machine.

First, you have to set up ssh with keys so that there is not login prompt for the user that is running HA - see

Then something like

# Example configuration.yaml entry
  platform: command_line
      command_on: "ssh kodi_username@kodimachine python your_on_script"
      command_off: "ssh kodi_username@kodimachine python your_off_script"


1 Like

This is great. Would like to find a kodi way but this will work for now (and for other things as well!) Thank you!

1 Like