JSON code for simple turnOff

I have a new 50UQ75 LG television and want to power it off using curl and JSON.

I have managed to communicate with the TV to get a client-key by other means and it seems that the key does not change, so I believe that I should be able to use this in my json code.

Port 8080 is refused, but port 3000 simply replies with “Hello World”, so I presume that this is the correct port to use.

This is the code that I currently have, but I cannot trouble shoot it as the only response I get is “Hello World”…

curl --header 'Content-Type: application/atom+xml' --data-binary '{"type":"request","id":"register_13","uri":"ssap://system/turnOff","payload":{"client-key":"52032a20df1764f90e02cc43165c66d6"}}}' ''

If I enter any folder, the TV does not respond with anything. Perhaps I have not found the correct api folder where the index.html resides. I have tried a suggested’ but that did not respond either.

Where would I find info on the paths or versions? I only want this one simple solution and do not really want to go too deep into development.

Many thanks, from an utter noob!

Currently, no APs for turning the webOS TV off are provided. Sorry for not being helpful.

The protocol you’re trying out is the SSAP over port 3000. It’s not documented (?) but the source code of Connect SDK — connectSDK documentation shows how to do what you want and more. But beware, it’s a Websocket protocol which requires you to do an individual pairing with each TV and client (to get the key you saw above) So in short, this will take you some time to implement. But there are some simpler source codes for various remote control script that might be of use too