CMR-500
Intertechno ITGW-433 Gateway Control Codes for CMR-500 Radio-controlled shutter switch.
Ever wanted to control your ITGW-433 Gateway with your own code? Now you can using this sweet little library.
Usage
Just add the IntertechnoGateway.cs file to your c# project and it is as easy like this to get started:
Add using:
using Intertechno.ITGW433Gateway;
// ...
Write code:
// create gateway connection instance
var gateway = new CMR500("192.168.1.101"); // create gateway connection instance
// send DOWN to CMR-500 with code M1
gateway.Send(LetterCodes.LetterM, NumberCodes.Number1, ControlCodes.ControlDown);
Hacking the Codes
How to create such a lib? I have used wireshark and spent 10mins to record a bunch of messages. I then pasted its content to a texteditor and tried decoding the messages.
Thats what i got:
Codes for A1 - P1
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,4,12,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,12,4,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,12,4,4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
TXP:0,0,5,11125,89,26,0,4,12,12,4,4,12,12,4,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
M1
UP:
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4,4,125,0
DOWN: XXXX changed control code
TXP:0,0,5,11125,89,26,0,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12,4,125,0
Split messages into parts:
START PART | 16 BIT LETTER CODE A-P | | 16 BIT NUMBER CODE 1-16 | | 16 BIT CONTROL CODE A B C| LAST PASRT
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,4,12,4,12,12,4,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,4,12,4,12,12,4,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,12,4,4,12,12,4,4,12,4,12, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,4,12,4,12,4,12,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,12,4,4,12,4,12,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,12,4,4,12,4,12,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,4,12,4,12,12,4,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TXP:0,0,5,11125,89,26,0, 4,12,12,4,4,12,12,4,4,12,12,4,4,12,12,4, 4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, 4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, 4,125,0
TRANSMITTED CODE STRING: HEX VALUE
4,12,4,12,4,12,4,12,4,12,4,12,4,12,4,12, = 0
4,12,12,4,4,12,4,12,4,12,4,12,4,12,4,12, = 1
4,12,4,12,4,12,12,4,4,12,4,12,4,12,4,12, = 2
4,12,12,4,4,12,12,4,4,12,4,12,4,12,4,12, = 3
4,12,4,12,4,12,4,12,4,12,12,4,4,12,4,12, = 4
4,12,12,4,4,12,4,12,4,12,12,4,4,12,4,12, = 5
4,12,4,12,4,12,12,4,4,12,12,4,4,12,4,12, = 6
4,12,12,4,4,12,12,4,4,12,12,4,4,12,4,12, = 7
4,12,4,12,4,12,4,12,4,12,4,12,4,12,12,4, = 8
4,12,12,4,4,12,4,12,4,12,4,12,4,12,12,4, = 9
4,12,4,12,4,12,12,4,4,12,4,12,4,12,12,4, = A
4,12,12,4,4,12,12,4,4,12,4,12,4,12,12,4, = B
4,12,4,12,4,12,4,12,4,12,12,4,4,12,12,4, = C
4,12,12,4,4,12,4,12,4,12,12,4,4,12,12,4, = D
4,12,4,12,4,12,12,4,4,12,12,4,4,12,12,4, = E
4,12,12,4,4,12,12,4,4,12,12,4,4,12,12,4, = F
DECODE INFORMATION:
LETTER CODE A-P NUMBER CODE 1-16 CONTROL CODE
always 1
10 10 10 10 10 10 10 10 10 10 10 10 <--- repeating columns are redundant
1010101010101010 1010101010101010 1010100110011001 UP
1001101010101010 1010101010101010 1010100110011010 DOWN (control code changed for demo)
1010100110101010 1010101010101010 1010100110011001
1001100110101010 1010101010101010 1010100110011001
1010101010011010 1010101010101010 1010100110011001
1001101010011010 1010101010101010 1010100110011001
1010100110011010 1010101010101010 1010100110011001
1001100110011010 1010101010101010 1010100110011001
1010101010101001 1010101010101010 1010100110011001
1001101010101001 1010101010101010 1010100110011001
1010100110101001 1010101010101010 1010100110011001
1001100110101001 1010101010101010 1010100110011001
1010101010011001 1010101010101010 1010100110011001
1001101010011001 1010101010101010 1010100110011001
1010100110011001 1010101010101010 1010100110011001
1001100110011001 1010101010101010 1010100110011001
removed repeating columns:
reverse-> maybe: 10 = 0 , 01 = 1
10 10 10 10 10101010
01 10 10 10 10101001
10 01 10 10 10100110
01 01 10 10 10100101
10 10 01 10 10011010
01 10 01 10 10011001
10 01 01 10 10010110
01 01 01 10 10010101
10 10 10 01 01101010
01 10 10 01 01101001
10 01 10 01 01100110
01 01 10 01 01100101
10 10 01 01 01011010
01 10 01 01 01011001
10 01 01 01 01010110
01 01 01 01 01010101
reverse->
10 10 10 10
10 10 10 01
10 10 01 10
10 10 01 01
10 01 10 10
10 01 10 01
10 01 01 10
10 01 01 01
01 10 10 10
01 10 10 01
01 10 01 10
01 10 01 01
01 01 10 10
01 01 10 01
01 01 01 10
01 01 01 01
replaced: " 10" -> 0, " 01" -> 1
0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9
1010 = A
1011 = B
1100 = C
1101 = D
1110 = E
1111 = F