I have a set of SilverCrest IP20 remote controlled sockets purchased in LIDL.

Remote: SilverCrest 113854 RCT DS1 AAA-A 3726
4x Switches: SilverCrest 113854 RCR DS1 3711-A IP20 FR 3726

These work on 433Mhz radio frequency, so the switches can be controlled using my Raspberry Pi instead of the remote control which came with the set.

Check the pictures how the set looks like here

The sockets can be turned on/off using a remote controller (SilverCrest 113854, RCT DS1 AAA-A 3726) device included in the package. Each button on the remote control sends an RF (radio frequency) signal which is learned by the sockets during the initial first setup.
After using the 4 sockets to remotely control lights in my apartment with the remote control, I thought it would be fun to control via terminal, and eventually an android app on my phone.

Hardware:

Raspberry Pi 2 (GPIO interface)
RF Transmitter: FS-1000A
RF Receiver: XY-MK-5V

We need to install the WiringPi library (official tutorial here)

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core
cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
git pull origin
./build

WiringPi is now installed, test it with the following commands:

gpio -v
gpio readall

Then install Pilight, not the stable but the development build (official guide here)

We won’t use the apt repository, instead we’ll compile our own, since we want the development branch:

sudo apt-get update
sudo apt-get install build-essential cmake git dialog libunwind-dev libpcap-dev

We will clone pilight from git:

cd /home/pi
git clone --depth 5 -b development https://github.com/pilight/pilight.git
cd pilight

You need to adjust a variable in the file:

https://forum.pilight.org/Thread-QUIGG-GT9000-Globaltronics-ALDI?pid=18528#pid18528

Then you make the setup script executable, and run it

chmod +x setup.sh
sudo ./setup.sh

All is selected by default, so “Save and Install”. This begins the compling which takes some time.

Don’t forget to run this command after the compiling has finished:

sudo ldconfig

Then we check if pilight is running:

pi@pilight:~/pilight $ service pilight status
● pilight.service - LSB: Starts pilight-daemon
   Loaded: loaded (/etc/init.d/pilight)
   Active: inactive (dead)

We see that even it’s loaded, it’s inactive. We can try starting it:

pi@pilight:~/pilight $ sudo service pilight start

(There is no output.)

Let’s run another status check:

pi@pilight:~/pilight $ service pilight status
● pilight.service - LSB: Starts pilight-daemon
   Loaded: loaded (/etc/init.d/pilight)
   Active: active (exited) since Sun 2016-10-23 21:50:43 CEST; 31s ago
  Process: 5127 ExecStart=/etc/init.d/pilight start (code=exited, status=0/SUCCESS)

We see the status is active (exited), which means that it started running, but it has failed. Why would that be?
It’s because there is some issue with the config file.

Let’s check pilight-debug, but that needs the pilight-daemon to be in a stopped state, so we do that first.

sudo service pilight stop

(Again, no output.)

Check the status again, it should now be inactive:

pi@pilight:~/pilight $ service pilight status
● pilight.service - LSB: Starts pilight-daemon
   Loaded: loaded (/etc/init.d/pilight)
   Active: inactive (dead) since Sun 2016-10-23 21:54:22 CEST; 15s ago
  Process: 5170 ExecStop=/etc/init.d/pilight stop (code=exited, status=0/SUCCESS)
  Process: 5127 ExecStart=/etc/init.d/pilight start (code=exited, status=0/SUCCESS)

Now let’s start pilight-debug, to see what’s the issue with the config.

pi@pilight:~/pilight $ sudo pilight-debug
[Oct 23 19:55:46:508150] pilight-debug: ERROR: config setting "webserver-https-port" is invalid

We have to open the configuration file, and remove the line regarding the HTTPS server. Reason for this is that we didn’t compile the SSL webserver part of pilight. (Always stop the pilight service before editing that file, but we have already did that)

sudo nano /etc/pilight/config.json

Remove the following line and save the file:

"webserver-https-port": 5002,

After that we run pilight-debug again, now it runs fine:

pi@pi3pimatic:~/pilight $ sudo pilight-debug
Press and hold one of the buttons on your remote or wait until
another device such as a weather station has sent new codes
The debugger will automatically reset itself after one second of
failed leads. It will keep running until you explicitly stop it.
This is done by pressing both the [CTRL] and C buttons on your keyboard.

Stop it with CTRL+C. Now we will know that the pilight-daemon will start.

pi@pilight:~/pilight $ sudo service pilight start
pi@pilight:~/pilight $ service pilight status
● pilight.service - LSB: Starts pilight-daemon
   Loaded: loaded (/etc/init.d/pilight)
   Active: active (running) since Sun 2016-10-23 21:59:14 CEST; 6s ago
  Process: 5273 ExecStop=/etc/init.d/pilight stop (code=exited, status=0/SUCCESS)
  Process: 5338 ExecStart=/etc/init.d/pilight start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/pilight.service
           └─5349 /usr/local/sbin/pilight-daemon

We are done with the pilight software setup!

Now, let’s shutdown the Pi for the wiring part. You shouldn’t tinker with the GPIO pins while the Pi is on. (You won’t harm yourself, but you can harm the Pi.)

sudo shutdown -t now

Wait until the SSH session breaks, that means that the Pi has shut down correctly.

Now we need to do the wiring of the receiver and transmitter chip to the GPIO pins.

Wire up the pins on the XY-MK-5V receiver and the FS-1000A transmitter to the GPIO pins on the Raspberry using the pinout below.

Note that pilight uses WiringPi GPIO numbering:


"hardware": {
                "433gpio": {
                        "sender": 0,
                        "receiver": 1
                }
        },

Transmitter:

Purple cable - RPi PIN 2 (5V) -> FS1000A VCC (tested and working on PIN 1 3.3V too)
Blue cable - RPi PIN 9 (GND) –> FS1000A GND
Green cable - RPi PIN 11 (GPIO 17/WiringPi Pin 0 - as this is the sender in pilight) –> FS1000A DATA

Receiver:

Yellow cable - RPi PIN 4 (5V) -> XY-MK-5V VCC
Orange cable - RPi PIN 12 (GPIO 18/WiringPi Pin 1 - as this is the receiver in pilight) –> XY-MK-5V DATA
Red cable - RPi PIN 14 (GND) –> XY-MK-5V GND

You can find the GPIO layout here.

When we have wired up the GPIOs, we power up the Pi again, and log in. We can check if pilight runs (remember, we are not root anymore, after the restart we log into the “pi” user)

[Zsiti.n003sc] ➤ ssh pi@192.168.1.113
pi@192.168.1.113's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun May 22 08:26:31 2016 from 192.168.1.1
pi@443v3:~ $ sudo service pilight status
● pilight.service - LSB: Starts pilight-daemon
   Loaded: loaded (/etc/init.d/pilight)
   Active: active (running) since Sun 2016-05-22 09:18:37 UTC; 14s ago
  Process: 678 ExecStart=/etc/init.d/pilight start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/pilight.service
           └─708 /usr/local/sbin/pilight-daemon

May 22 09:18:36 443v3 systemd[1]: Starting LSB: Starts pilight-daemon...
May 22 09:18:37 443v3 pilight[678]: Starting : pilight.
May 22 09:18:37 443v3 systemd[1]: Started LSB: Starts pilight-daemon.

First we needed to “sniff” out the RF codes which are sent out by the SilverCrest 113854 RCT DS1 AAA-A 3726 RF remote control, when we push each button on it.
I’ve pushed them one by one, it’s important to push them for a short period, so it’s not sending repeated signals. (This is pointed out here by forum user “dominik.” who has implemented the Quigg GT-9000 protocol to pilight, for which I’m very grateful).

On the Raspberry Pi, please run pilight-receive which will give you the necessary data for the signal replication by the quigg_gt9000 protocol.

sudo pilight-receive

I’ve pushed the buttons in a sequence:

A ON
A OFF
B ON
B OFF
C ON
C OFF
D ON
D OFF
ALL ON
ALL OFF

And pushing the buttons should show something like this:

{
        "message": {
                "binary": "111110011110000111100101",
                "id": 986327,
                "unit": 10,
                "state": "on"
        },
        "origin": "receiver",
        "protocol": "quigg_gt9000",
        "uuid": "0000-b8-27-eb-a222d1",
        "repeats": 1
}

If you wish to replicate and send these signal out, use the following command:

pi@433v4:~ $ pilight-send -p quigg_gt9000 -i 986327 -u 10 --on
pi@433v4:~ $ pilight-send -p quigg_gt9000 -i 986327 -u 10 --off

As of 2016-06-04 this doesn’t work out of the box in pilight (development branch):

See the discussion here: pilight protocol development > QUIGG GT9000 (Globaltronics/ALDI)

To make sending work, you need to change the following from 300 to 400 (as suggested by Puuu on the forum)

pi@433v4:~/pilight/libs/pilight/protocols/433.92 $ grep "define PULSE_QUIGG_SHORT" quigg_gt9000.c
#define PULSE_QUIGG_SHORT       400

You need to open the file for editing, look for the line define PULSE_QUIGG_SHORT and change the number:

sudo vim /home/pi/pilight/libs/pilight/protocols/433.92/quigg_gt9000.c

You need to build pilight again:

sudo su
cd /home/pi/pilight
./setup.sh

This will take less time than for the first time.

Exit the root shell by typing:

exit

Then restart the service.

sudo service pilight restart

And try the sending code again.

pi@433v4:~ $ pilight-send -p quigg_gt9000 -i 986327 -u 10 --on
pi@433v4:~ $ pilight-send -p quigg_gt9000 -i 986327 -u 10 --off

We should apply the setting we need, but for that the pilight service must be stopped.

sudo service pilight stop

Now you can replace the /etc/pilight/config.json with
my config.json if you wish.

After starting the pilight service again

sudo service pilight start

the Pilight GUI should be reachable on the :80 port of your Pi’s IP address in a browser, and also using the Pilight Android App.

Hope it worked!