(25.02.2016, 09:37)admin Wrote: You have to send enquiry command, then you can parse the response to get status info.
Code:require('socket') -- bravia IP ip = '192.168.1.23' -- power-status cmd = '*SEPOWR################\n' sock = socket.tcp() sock:settimeout(3) res, err = sock:connect(ip, 20060) if res then res, err = sock:send(cmd) if res then res, err = sock:receive() if res then alert('receive OK: ' .. tostring(res)) else alert('receive failed: ' .. tostring(err)) end else alert('send failed: ' .. tostring(err)) end else alert('connect failed: ' .. tostring(err)) end sock:close()
Hi, I'm trying this but doesn't work. Appears a error like that:
"attempt to call method 'revieve' ( anil value)"
I have two more questions,
first. It's possible to extract volume value from TCP response of TV and convert this value to a KNX 1 byte value?
and the second question, if the tv awnser automactilly the status when you send 'power on', for example, it's possible to read this value without force the status query, and can I read the responses separately by \n?
Thank you very much.