v18 POST request to turn off
#16
it doesn't work
is there a replacement for the link like this
getURL('http://IP:8080/jsonrpc?request={"jsonrpc":"2.0","method":"System.Shutdown","id":1}')
PS. every update to complicate life, for both raspberry and Android
Reply
#17
I couldn't get a banal Kodi shutdown.
Reply
#18
how to replace this string
getURL('http://IP:PORT/jsonrpc?request={"jsonrpc":"2.0","method":"System.Shutdown","id":1}');

or maybe there's a way to turn it off libreelec?
Reply
#19
Can you please tell me at which version it worked and at which version it doesn't anymore? As HTTP post requests do not work since 2017 anymore: https://forum.kodi.tv/showthread.php?tid=324598

Not sure what your home-automation script is capable of or not, but "curl" commands from the bash-commandline are working properly for post-requests:

curl -s -u kodi:1234 -X POST http://127.0.0.1:8080/jsonrpc -H 'Content-Type: application/json' --data '{"jsonrpc": "2.0", "method": "Input.Down", "id":1}'

^^ for example works fine from command-line. Please note that the -u kodi:1234 is only needed if you have set a username and a password at the web server settings. In case you are running Kodi 19, setting a username and a password for the web server is a requirement and the web server you might have enabled before might be disabled until you set a username and a password for it after an update. 

So for Kodi 18 use:
curl -s -X POST http://127.0.0.1:8080/jsonrpc -H 'Content-Type: application/json' --data '{"jsonrpc": "2.0", "method": "Input.Down", "id":1}'

and for Kodi 19 use the line I mentioned first and change username and password accordingly. 

If you can't use "curl" on your home-automation system (and I expect that this system is running on a linux-basis-os) but if it can trigger bash-scripts you can write a little script which is triggered then, which does the login via SSH and then runs a shotdown command. For example:

sshpass -p "libreelec" ssh root@<ip> shutdown -h now

this requires that the machine you send the command from knows the LE machine as a known-host. So you have to ssh into the libreelec machine from that home-automation machine first to add that LE machine to the known-hosts file (that's automatically done by logging in via command line).
Reply

Logout Mark Read Team Forum Stats Members Help
POST request to turn off0