Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
IP Control of Sky HD+ & Sky Q
This thread has 5 replies. Displaying all posts.
Post 1 made on Thursday December 21, 2017 at 13:07
peteS
Long Time Member
Joined:
Posts:
June 2003
20
Hi All

With lots of help from people here and Liam Gladdy's brilliant original decoding of the Sky protocols, I've got working control going of Sky HD+ and apparently SkyQ uses the same setup.

It's pretty straightforward - I create an Activity Script which connects to the Sky box

var IPAddress="192.168.3.60";
var Port=49160;
var Timeout=100;
var str = "";
var receivedText = "";
var len;
var command="";


function ConnecttoSky()
{
socket = new TCPSocket(false);
socket.onConnect = onConnect;
socket.onData = onData;
socket.onClose = onClose;
socket.onIOError = onIOError;
socket.connect(IPAddress, Port, Timeout);

Then the only callback we really need is OnData

function onData(){
var code;
var writeText;

// System.print("Ondata.");
receivedText = socket.read();
//System.print(receivedText.length)

if (receivedText.length < 24){
socket.write(receivedText.slice(0,len));
len = 1;
}
else {
//System.print("Writing Data");
code = SkyRemoteCommands[command];
// System.print ("Hex is " + showHEX(String.fromCharCode(code & 0xff)));
writeText = "\x04\x01\x00\x00\x00\x00"+chr[Math.floor(224 + (code/16))]+chr[code % 16];
socket.write (writeText);
writeText = "\x04\x00\x00\x00\x00\x00"+chr[Math.floor(224 + (code/16))]+chr[code % 16];
socket.write (writeText);

// socket.write (ArrayToString([0x04,0x01,0x00,0x00,0x00,0x00,Math.floor(224 + (code/16)),code % 16]));
// socket.write (ArrayToString([0x04,0x00,0x00,0x00,0x00,0x00,Math.floor(224 + (code/16)),code % 16]));

socket.close();
socket=null;
}

}

and this uses two fixed arrays

ar SkyRemoteCommands = new Array()

SkyRemoteCommands = {
power: 0,
select: 1,
backup: 2,
dismiss: 2,
channelup: 6,
channeldown: 7,
interactive: 8,
sidebar: 8,
help: 9,
services: 10,
search: 10,
tvguide: 11,
home: 11,
i: 14,
text: 15,
up: 16,
down: 17,
left: 18,
right: 19,
red: 32,
green: 33,
yellow: 34,
blue: 35,
0: 48,
1: 49,
2: 50,
3: 51,
4: 52,
5: 53,
6: 54,
7: 55,
8: 56,
9: 57,
play: 64,
pause: 65,
stop: 66,
record: 67,
fastforward: 69,
rewind: 71,
boxoffice: 240,
sky: 241
}

var chr=new Array()
chr=[
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\x09", "\x0A", "\x0B", "\x0C", "\x0D", "\x0E", "\x0F",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F",
"\x20", "\x21", "\x22", "\x23", "\x24", "\x25", "\x26", "\x27", "\x28", "\x29", "\x2A", "\x2B", "\x2C", "\x2D", "\x2E", "\x2F",
"\x30", "\x31", "\x32", "\x33", "\x34", "\x35", "\x36", "\x37", "\x38", "\x39", "\x3A", "\x3B", "\x3C", "\x3D", "\x3E", "\x3F",
"\x40", "\x41", "\x42", "\x43", "\x44", "\x45", "\x46", "\x47", "\x48", "\x49", "\x4A", "\x4B", "\x4C", "\x4D", "\x4E", "\x4F",
"\x50", "\x51", "\x52", "\x53", "\x54", "\x55", "\x56", "\x57", "\x58", "\x59", "\x5A", "\x5B", "\x5C", "\x5D", "\x5E", "\x5F",
"\x60", "\x61", "\x62", "\x63", "\x64", "\x65", "\x66", "\x67", "\x68", "\x69", "\x6A", "\x6B", "\x6C", "\x6D", "\x6E", "\x6F",
"\x70", "\x71", "\x72", "\x73", "\x74", "\x75", "\x76", "\x77", "\x78", "\x79", "\x7A", "\x7B", "\x7C", "\x7D", "\x7E", "\x7F",
"\x80", "\x81", "\x82", "\x83", "\x84", "\x85", "\x86", "\x87", "\x88", "\x89", "\x8A", "\x8B", "\x8C", "\x8D", "\x8E", "\x8F",
"\x90", "\x91", "\x92", "\x93", "\x94", "\x95", "\x96", "\x97", "\x98", "\x99", "\x9A", "\x9B", "\x9C", "\x9D", "\x9E", "\x9F",
"\xA0", "\xA1", "\xA2", "\xA3", "\xA4", "\xA5", "\xA6", "\xA7", "\xA8", "\xA9", "\xAA", "\xAB", "\xAC", "\xAD", "\xAE", "\xAF",
"\xB0", "\xB1", "\xB2", "\xB3", "\xB4", "\xB5", "\xB6", "\xB7", "\xB8", "\xB9", "\xBA", "\xBB", "\xBC", "\xBD", "\xBE", "\xBF",
"\xC0", "\xC1", "\xC2", "\xC3", "\xC4", "\xC5", "\xC6", "\xC7", "\xC8", "\xC9", "\xCA", "\xCB", "\xCC", "\xCD", "\xCE", "\xCF",
"\xD0", "\xD1", "\xD2", "\xD3", "\xD4", "\xD5", "\xD6", "\xD7", "\xD8", "\xD9", "\xDA", "\xDB", "\xDC", "\xDD", "\xDE", "\xDF",
"\xE0", "\xE1", "\xE2", "\xE3", "\xE4", "\xE5", "\xE6", "\xE7", "\xE8", "\xE9", "\xEA", "\xEB", "\xEC", "\xED", "\xEE", "\xEF",
"\xF0", "\xF1", "\xF2", "\xF3", "\xF4", "\xF5", "\xF6", "\xF7", "\xF8", "\xF9", "\xFA", "\xFB", "\xFC", "\xFD", "\xFE", "\xFF"]


Then, when I want to use one, I just set the global variable command, and then call ConnectToSky()

command="services";
ConnecttoSky();

That's it - really simple and very reliable.

pete S
Post 2 made on Wednesday June 14, 2023 at 15:21
allisong
Lurking Member
Joined:
Posts:
January 2013
5
Hello,

I am not sure how to use this in practice, I edited the IP address to suit my Sky Q box and placed the Activity Script in the Advanced Tab for the Activity Properties, minus the text comments and with out the

command="services";
ConnecttoSky();

part.

I then placed this to test the script

command="power";
ConnecttoSky();

under the required button as a "use prontoscript" action item, but cannot get it to work, what am I doing wrong??

Any help most appreciated!

Best regards, Geoff,
OP | Post 3 made on Wednesday June 14, 2023 at 18:09
peteS
Long Time Member
Joined:
Posts:
June 2003
20
On June 14, 2023 at 15:21, allisong said...
Hello,

I am not sure how to use this in practice, I edited the IP address to suit my Sky Q box and placed the Activity Script in the Advanced Tab for the Activity Properties, minus the text comments and with out the

command="services";
ConnecttoSky();

part.

I then placed this to test the script

command="power";
ConnecttoSky();

under the required button as a "use prontoscript" action item, but cannot get it to work, what am I doing wrong??

Any help most appreciated!

Best regards, Geoff,

Hi Geoff. Well, there's a co-incidence - I was just looking here for the first time in many months for something completely different (RFX9600 protocol, which sadly doesn't really seem to exist) and happened to see this.

Anyway, I can't actually remember how that stuff worked as I moved it all to a library to make it much easier to reuse across my various different remotes. I'm happy to send you the library - I think all you need to tweak would be the ip addresses as I ended up hardcoding these in the library for some reason I can't remember.
Post 4 made on Thursday June 15, 2023 at 18:18
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Pete,

Regarding that protocol, have you seen this?

[Link: gist.github.com]

or this thread?
[Link: remotecentral.com]
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Wednesday September 6, 2023 at 12:30
allisong
Lurking Member
Joined:
Posts:
January 2013
5
Pete, I would appreciate a copy of the Sky Q library, not sure if this can be sent via RC Mail or not? If not I can provide my direct email address, best regards, Geoff.
Post 6 made on Thursday September 7, 2023 at 22:14
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Geoff,

Send Pete an RC Mail and hopefully he will respond. Exchange email addresses there as you cannot send files via RC Mail.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse