This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Sony Bravia Authentication
#1
Is there anybody who got the IP Control function of the more recent Sony Bravia TV working? I'm able to post a HTTP request trough my phone, only after pairing the device with the TV first with the default sony app. On my PC this is a little more complicated, but after following this guide (post Jul 08, 2015) this seems to work correctly. The PC appears on my TV in the list of trusted devices, along with my phone. The POST request requires to input a pincode visualized on the screen after starting the request.


Quote:1. Install Google Chrome
2. Install Simple Rest Client (https://chrome.google.com/webstore/detail/simple-rest-client/fhjcajmcbmldlhcimfajhfbgofnpcjmb)
3. Once Simple Rest Client is installed you should see a blue globe looking icon to the right of the URL field in Chrome. Click on that icon.
4. In the URL field of the REST Client, type in http://192.168.168.198/sony/accessControl
where you replace 192.168.168.198 with IP address of your TV.
5. Click on POST.
6. In the DATA field paste:

{"id":13,"method":"actRegister","version":"1.0","params":[{"clientid":"iRule:1","nickname":"iRule"},[{"clientid":"iRule:1","value":"yes","nickname":"iRule","function":"WOL"}]]}


7. Hit SEND. You should see a message on TV pop-up with PIN code and a Username and Password message pop-up in the Browser.
Leave Username blank and in password field put in the PIN code that is displayed on TV.

It seems the TV needs to trust the device sending requests. Is there a way to enable this with the logicmachine? Previous threads don't seem to work in my case (Sony Bravia script and Sony Simple IP Protocol).


This is the code I tried to use:
Code:
function ipControlTV(service, cmd)   
 
  require('socket')
 
  ip = "192.168.1.135"
  port = 80
 
  host = "http://" .. ip .. "/sony/" .. service
  reqs = "POST /sony/" .. service .. " HTTP/1.1 \r\n" ..
            "HOST: " .. ip .. " \r\n" ..
            "X-Auth-PSK: **** \r\n" ..
            "Content-Type: application/json; charset=UTF-8 \r\n " ..
            "\r\n" .. cmd .. "\r\n\r\n"
 
  sock = socket.tcp()
  sock:settimeout(3)

  res, err = sock:connect(ip, port)
  if res then
    res, err = sock:send(reqs)

    if res then
      log(res,err)
    else
      log('send failed: ' .. tostring(err))
    end
  else
    log('connect failed: ' .. tostring(err))
  end

  sock:close()
end

And to call my code (toggle of power object):
Code:
power = event.getvalue()
command = ""

if (power) then
  command =  '{ \\"method\\": \\"setPowerStatus\\", \\"id\\": 55, \\"params\\": [{\\"status\\": true}], \\"version\\": \\"1.0\\" }'
else
  command = '{ \\"method\\": \\"setPowerStatus\\", \\"id\\": 55, \\"params\\": [{\\"status\\": false}], \\"version\\": \\"1.0\\" }'
end

ipControlTV("system", command)

I keep getting the following error:
Code:
* arg: 1
  * string: JSON Format Error
* arg: 2
  * number: 400
Reply


Messages In This Thread
Sony Bravia Authentication - by arnocl - 17.02.2020, 09:58
RE: Sony Bravia Authentication - by admin - 17.02.2020, 10:14
RE: Sony Bravia Authentication - by arnocl - 21.02.2020, 21:08
RE: Sony Bravia Authentication - by arnocl - 22.02.2020, 09:29

Forum Jump: