Send text to kodi

  • I am running latest stable version of LibreElec, sending text to Kodi does not work from the web interface or by using Kore remote.

    I have also tried running this command:

    curl -v -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"Input.SendText","params":{"text":"<text to send>","done":false},"id":1}' http://<host>:<port>/jsonrpc

    it says it sent ok, but nothing is displayed?

  • Use GUI.ShowNotification:

    Code
    curl -fs -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"'"<TITLE>"'","message":"'"<MESSAGE>"'","image":"'"info"'","displaytime":'"10000"'},"id":1}' http://<HOST>:8080/jsonrpc

    Read here for info about params. It works for me.

  • Use GUI.ShowNotification:

    Code
    curl -fs -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"'"<TITLE>"'","message":"'"<MESSAGE>"'","image":"'"info"'","displaytime":'"10000"'},"id":1}' http://<HOST>:8080/jsonrpc

    Read here for info about params. It works for me.

    I was able to build this script into my shell script but i failed with the image. I could replace <MESSAGE> with my message text. When i do the same with the image path the notification doesn't work. i tried:

    Code
    "image":"'"/path/to/image.png"'"

    What is wrong here? In terminal (SSH) there is the error

    Code
    syntax error: unterminated quoted string
  • Just in case that could be helpful to anyone stumbling upon this post.

    This code shown below worked in kodi 18.2 and before, and sort of still works with current kodi versions if the message is a single line.

    Also, long ago there was an attempt to allow base64 encoded images but it seems that was abandoned and so only the pre-defined keywords or files stored in some path that kodi can access can be used.

    Don't forget to enable the remote control options.