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"}}}' 'http://192.168.0.33:3000/'

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
http://192.168.0.33:3000/api/v2/commands/’ 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

Connect SDK is only for android and iphone? What about control from say a Windows PC or MacOS? There has to be a way to use something direct like curl no? Also why do you say SSAP is not documented, is it not used by many devices? So where would one find the SSAP documentation?

1 Like