User Tools

Site Tools


rsl366_v7_0

RSL366

Feature Support

FeatureSupport
Sending
Receiving
Config

Supported Brands

BrandProtocol
Rising Sun RSL366rsl366
PROmaxpromax

Sender Arguments

-s --systemcode=systemcode    control a device with this systemcode
-u --programcode=programcode  control a device with this programcode
-t --on                       send an on signal
-f --off                      send an off signal

Config

"devices": {
	"Lamp": {
		"protocol": [ "promax" ],
		"id": [{
			"systemcode": 4,
			"programcode": 1
		}],
		"state": "off"
	}
}
"gui": {
	"Lamp": {
		"name": "TV Backlit",
		"group": [ "Lamps" ],
		"media": [ "all" ]
	}
}

Optional Settings

GUI Settings

SettingDefaultFormatDescription
readonly01 or 0Disable controlling this device from the GUIs
confirm01 or 0Ask for confirmation when switching device

Notes

The RSL366 switches come with two dials, one selecting the Systemcode (1 to 4) and the Programcode (1 to 4). The systemcode allows one remote to control up to 16 switches. The systemcode parameter designates the dial on top of the back side of the switch, and the small lever on the back of the remote. The programcode parameter designates the lower dial on the back of the switch, and the individual buttons on the face of the remote. So if your switch has the higher dial set to 4, and the lower one set to 1, you should use:

systemcode: 4
programcode: 1

Protocol

This protocol sends 50 pulses like this

390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 390 1170
390 1170 390 1170
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 13260

It has no header and the last 2 pulses are the footer. The footer is not used for further processing. The next step is to transform this output into 12 groups of 4 pulses (and thereby dropping the footer pulses).

390 1170 1170 390
390 1170 1170 390
390 1170 1170 390
390 1170 390 1170

390 1170 390 1170
390 1170 1170 390
390 1170 1170 390
390 1170 1170 390

390 1170 1170 390
390 1170 1170 390
390 1170 1170 390

390 1170 1170 390

If we now look at carefully at these groups you can distinguish two types of groups:

  1. 390 1170 1170 390
  2. 390 1170 390 1170
  1. The first group is defined by a low 1st and low 4th pulse, and we call it low.
  2. The second group has a high 2nd and 4th pulse, and we call it high.

We then get the following output:

LLLH HLLL LL LL

All H's can be translated to 1. All L's can be translated to 0.

Each (group) of numbers has a specific meaning:

  • Systemcode: 1 till 4
  • Programcode: 5 till 8
  • 9 to 11 are always low and don't convey any information
  • State: 12 (state)
0001 1000 000 0
  • The SystemCode is defined as position of the pulse group that bears the high signal in the first grouping (i.e. if the third pulse group is high then systemcode is 3)
  • The ProgramCode is defined as the position of the pulse group that bears the high signal in the second grouping (i.e. if the second pulse group is high then systemcode is 2)
  • The State defines whether a devices needs to be turned On or Off. If it bears the high pulse group - the device must be turned off, if it bears the low pulse group it must be turned on

So this code represents:

  • SystemCode: 4
  • ProgramCode: 1
  • State: On

Another example:

  • Unit: 1
  • ID: 3
  • State: Off
1000 0010 000 1

Miscellaneous

These are the same switches that can be controlled using rc-switch, which Pi-port is here: https://github.com/r10r/rcswitch-pi.

Although out of scope for the pilight project, the following may be useful if you are starting with controlling RF switches with a Pi, and want a simple and small program to test your transmitter and RS366 hardware, before directly diving into pilight.

Both above mentioned projects seem to be inactive, but the Pi version can be handy because it is very small and easy to compile and test. RCSwitch supports three kind of switches. Luckily, RSL366 switches are supported and referred to as 'Type B' (in the nomenclatura of RCSwitch).

The RCSwitch software seems to be working, but the accompanying test program 'send.cpp', which was written with Type B switches in mind, has a programming error. It will always yield a segmentation fault ('fuck it, ship it'). You can easily correct this flaw if you change the data type from variable 'systemCode' from string to integer.

The send.cpp test program uses GPIO0 (header pin 11) for the output to the transmitter (hardcoded into variable PIN). Many RF443 tutorials use the RxD pin (header 6), which seems to be more conveniently placed, close to header pins 2 (5V) and header pin 4 (GND). Since RCSwitch uses the wiringPi library, header pin number '4' needs to be converted to '15'. Details about that are here http://wiringpi.com/pins/.

For a flexible pin solution for the test program it suffices to read the PIN variable from the input line too. Both mentioned changes are reflected below:

Original code:

    int PIN = 0;
    char* systemCode = argv[1];

Fixed code:

    int PIN = atoi(argv[4]);
    int systemCode = atoi(argv[1]);

Example of calling the altered test program:

./send 1 4 1 15 

Once you have established with this program that your hardware is able to send commands to the switch, and you want to do something more than just schedule on/off jobs (in crontab), you are ready to explore pilight.

rsl366_v7_0.txt · Last modified: 2015/11/27 22:09 (external edit)