Shutdown remote computer (libreelec)

Hi guys,

i am looking for a solution to shutdown my htpc (running libreelec/kodi) with openhab/alexa. I found that i can shutdown the htpc with this url

http://192.168.0.26/jsonrpc?request={“jsonrpc”:“2.0”,“method”:“System.Shutdown”,“id”:1}

Works pretty well, now my thought was to use the http binding and item

Switch WOL_HTPC “Computer aus” [ “Lighting” ] { http="<[http://192.168.0.26/jsonrpc?request={“jsonrpc”:“2.0”,“method”:“System.Shutdown”,“id”:1}] }

But this wont work, any idea how i can manage this?

Looking forward for any comments.

Tom

You could try using a sendHttpGetRequest() in a rule:

Item:

Switch WOL_HTPC "Computer aus"

rule:

when 
       Item WOL_HTPC received command ON
then
     sendHttpGetRequest("http://192.168.0.26/jsonrpc?request={""jsonrpc"":""2.0"",""method"":""System.Shutdown"",""id"":1}")
end

sitemap:

Switch item=WOL_HTPC mappings=[ON="AUS"]

I not 100% sure about the double quotes, but it should work.

will try it out thx.

Should escape the quotes instead of doubling them:

"http://192.168.0.26/jsonrpc?request={\"jsonrpc\":\"2.0\",\"method"\:\"System.Shutdown\",\"id\":1}"