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.
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:
And to call my code (toggle of power object):
I keep getting the following error:
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