Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
bker 0
Hi All,
I am trying to get a understanding of creating VD's for control of my TV's and projector. I was able to download a VD from the Fibaro Market Place for my Panasonic TV which works. I am currently running v4.580
I have spent the last 2 days trying all sorts of different LUA codes to try and control my JVC projector which I can control via telnet from my laptop though I am stuck trying to do this from a VD. Below is what I have tried and the projector requires the following TCP/IP command PJREQ first then it leaves the socket open for 5 secs so you can send the next command. I am only looking to be able to turn it on & off. In the example below is the HEX string to turn the projector ON............apologies this is all new to me so any help would be very much appreciated
I have already assigned the correct IP address and Port in the advanced section of the VD..........I just can't workout how to sent the actual command strings
local device = fibaro:getSelfId();
local ipaddress = fibaro:getValue(device, "IPAddress");
local port = fibaro:getValue(device, "TCPPort");
FIBARO = Net.FHttp(ipaddress, port)
tcpSocket:write(string.char(PJREQ))
tcpSocket:setReadTimeout(5000);
tcpSocket:write(string.char(PJREQ));
tcpSocket:write(string.char(21 89 01 50 57 31 0A));
tcpSocket = Net.FTcpSocket(ip, port);
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.