I got a Panasonic TXL37E30B TV which has Internet connection and can run Viera Connect Apps (see http://developer.vieraconnect.com/). These apps are written in JavaScript and I thought it should be possible to develop an UI for vera running on my Panasonic TV. Then I could use the remote to switch on devices on vera (There is no generic web browser on the TV which would have been an option to run UI4 directly).
My Questions
Anyone done that already?
Is there already JavaScript code that could be re-used (similar to UI_Simple_Sample code in C)
Anyone experience with writing apps for panasonic tvs?
Thanks, I have seen this. However, it is the other way around (controlling the TV via vera instead of controlling vera via the TV; and the new Panasonic TV do not have a serial port anymore)
I found the following code online ages back to try, and now can’t find the source, however I’m now trying to run it via Lua Test, but keep getting this error which I’m stuck on - any ideas what the cause is?
Code error: Line 21: unexpected symbol near ‘&’
function request(host, url, urn, action, args)
local body, http, ltn12, sink, res, err
ltn12 = require('ltn12')
http = require('socket.http')
body = [[<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body><u:]] .. action .. [[ xmlns:u="urn:]] .. urn .. [[">]] .. args .. [[</u:]] .. action .. [[></s:Body>
</s:Envelope>]]
sink = {}
res, err = http.request({
url = 'http://' .. host .. ':55000/' .. url,
method = 'POST',
headers = {
['soapaction'] = '"urn:' .. urn .. '#' .. action .. '"',
['Content-Length'] = #body,
},
sink = ltn12.sink.table(sink),
source = ltn12.source.string(body),
})
if res then
return table.concat(sink)
else
return nil, err
end
end
function sendkey(host, code)
local args = '<X_KeyEvent>' .. code .. '</X_KeyEvent>'
return request(host, 'nrc/control_0', 'panasonic-com:service:p00NetworkControl:1', 'X_SendKey', args)
end
function getmute(host)
return request(host, 'dmr/control_0', 'schemas-upnp-org:service:RenderingControl:1', 'GetMute', '<InstanceID>0</InstanceID><Channel>Master</Channel>')
end
IP = '192.168.1.200'
print(getmute(IP))
Best Home Automation shopping experience. Shop at Ezlo!