Lidl SilverCrest Remote Electrical Sockets 91210 RCS AAA3680 A IP20

Spent a week or so trying to control the Lidl Remote Sockets I bought with pre-written code found on the net but to no avail. Eventually worked it out for myself. If anybody else is wondering how to do it I've posted an example below. A fair chunk of it has been taken from other examples, so I can't take complete credit for it. Either way, an Uno, an Ethernet Shield and a set of 433Mhz Transmitter/Receivers are definitely cheaper than http://www.steckerchecker.com/ which SilverCrest recommend. Instructions on setup contained in commented code. Hopefully somebody will find it of use!

/*
SilverCrest 91210 RCS AAA3680 - A IP20
Below code will transmit on and off signals to SilverCrest 91210 Remote Electrical Sockets
I've taken some bits of code from various websites (mostly from rayshobby.net and randysimons.com)
Recorded the wave signatures (instructions taken from those websites) 
Cut the end off an old sent of headphones and plugged into Line-In on PC.  Recorded with Audacity on 48000Hz Sampling Freq.
Receiver set up to +5 and GND on Arduino and Rec pin sent to 39K Resistor (I only had a 47K resistor but worked ok).  
39 K resistor sent to Headphone (left or right) and 10K resistor.  10K resistor sent to Gnd Arduino and Gnd from Headphone.
Recorded wave signature defined as Long (1) and Short (0), the shortest worked out at roughly 18 samples at 48000Hz 18/48000=375ns (found 373 worked better).  
Each Long signal was about 3 times the length of the Short and the delay between sequences was rougly 6 times the short length.
Sequence had two distinct sub sequences - 
1. 4x with an another Short and a Short delay 
2. 4x with and another Long (extra long) and an extra long delay
Below setup as two Button Pins (each button pin 1 is sent to arduino pins 5 and 8 and pin 4 sent to ground)
Button 1 sends the signal
Button 2 cycles through the functions (A, B, C, D and Master)
433Mhz Transmitter set up on pin 3
LED on pin 13 flashes while sending signal
*/

#define BUTTON_PIN1  5
#define BUTTON_PIN2  8
#define RF_DATA_PIN 3
 
#define SHORT_DELAY 373
#define LONG_DELAY  (3*SHORT_DELAY)
#define TOTAL_DELAY (SHORT_DELAY + LONG_DELAY)
#define SYNC_DELAY  (6*SHORT_DELAY)
#define EXTRALONG_DELAY (3*LONG_DELAY)
unsigned long signal;
unsigned long signalA1 = 0b110101100100001101110000;
unsigned long signalA0 = 0b110111001010000100010000;
unsigned long signalB1 = 0b110101100100001101110100;
unsigned long signalB0 = 0b110111001010000100010100;
unsigned long signalC1 = 0b110101100100001101111100;
unsigned long signalC0 = 0b110111001010000100011100;
unsigned long signalD1 = 0b110111001010000100010010;
unsigned long signalD0 = 0b110101100100001101110010;
unsigned long signalM1 = 0b110111001010000100011010;
unsigned long signalM0 = 0b110101100100001101111010;
boolean onOff;
int Plug;
 
 
void setup() {                
  pinMode(RF_DATA_PIN, OUTPUT);
  pinMode(BUTTON_PIN1, INPUT_PULLUP);
  pinMode(BUTTON_PIN2, INPUT_PULLUP);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("Ready");
  onOff=0;
  
}
 
void loop() {
  if (digitalRead(BUTTON_PIN2) == LOW) {
    Plug = Plug + 1;
    if (Plug == 5){
      Plug = 0;
    }
    Serial.println(Plug);
  }
  
  if (digitalRead(BUTTON_PIN1) == LOW) {
    
    onOff = !onOff;
   
    ActivatePlug();
  }
}
void ActivatePlug() {
  
  
  unsigned long signal0 = 0;
  unsigned long signal1 = 1;
  if (Plug == 0){
    if (onOff == 0) {
      signal = signalA1;
      
    }
    else if (onOff == 1) {
      signal = signalA0;
      
    }
    Serial.print("A ");
    Serial.println(onOff);
  }
  if (Plug == 4){
    if (onOff == 0) {
      signal = signalM1;
    }
    else if (onOff == 1) {
      signal = signalM0;
      
    }
    Serial.print("Master ");
    Serial.println(onOff);
  }
  if (Plug == 1){
    if (onOff == 0) {
      signal = signalB1;
    }
    else if (onOff == 1) {
      signal = signalB0;
      
    }
    Serial.print("B ");
    Serial.println(onOff);
  }
  if (Plug == 2){
    if (onOff == 0) {
      signal = signalC1;
      
    }
    else if (onOff == 1) {
      signal = signalC0;
      
    }
    Serial.print("C ");
    Serial.println(onOff);
  }
  if (Plug == 3){
    if (onOff == 0) {
      signal = signalD1;
      
    }
    else if (onOff == 1) {
      signal = signalD0;
      
    }
    Serial.print("D ");
    Serial.println(onOff);
  }
  Serial.print(Plug);
  Serial.print(" ");
  Serial.println(onOff);
  Serial.println(signal, BIN);
 // for (unsigned char j=0; j<5; j++) { //repeat the whole thing 5 times
    for (unsigned char i=0; i<3; i++) { // repeat 1st signal sequence 3 times
      for (unsigned char k=0; k<24; k++) { //as 24 long and short signals, this loop sends each one and if it is long, it takes it away from total delay so that there is a short between it and the next signal and viceversa
        unsigned long d = ((bitRead(signal, 23-k)) == 1 ? LONG_DELAY : SHORT_DELAY);
        digitalWrite(13, HIGH);
        digitalWrite(RF_DATA_PIN, HIGH);
        delayMicroseconds(d);
        digitalWrite(RF_DATA_PIN, LOW);
        digitalWrite(13, LOW);    
        delayMicroseconds(TOTAL_DELAY - d);
        }
      //send the short 0 signal in the 1st sequence and the pause between repeats
      unsigned long d = (SHORT_DELAY);
      digitalWrite(13, HIGH);
      digitalWrite(RF_DATA_PIN, HIGH);
      delayMicroseconds(d);
      digitalWrite(RF_DATA_PIN, LOW);
      digitalWrite(13, LOW);    
      delayMicroseconds(SYNC_DELAY);  
   
    
    }
    for (unsigned char i=0; i<3; i++) { // repeat 2nd signal sequence 3 times
      for (unsigned char k=0; k<24; k++) {
        unsigned long d = ((bitRead(signal, 23-k)) == 1 ? LONG_DELAY : SHORT_DELAY);
        digitalWrite(13, HIGH);
        digitalWrite(RF_DATA_PIN, HIGH);
        delayMicroseconds(d);
        digitalWrite(RF_DATA_PIN, LOW);
        digitalWrite(13, LOW);    
        delayMicroseconds(TOTAL_DELAY - d);
        }
      // send the extra long 1 signal in the 2nd sequence and long pause between repeats
      unsigned long d = EXTRALONG_DELAY;
      digitalWrite(13, HIGH);
      digitalWrite(RF_DATA_PIN, HIGH);
      delayMicroseconds(EXTRALONG_DELAY);
      digitalWrite(RF_DATA_PIN, LOW);
      digitalWrite(13, LOW);    
      delayMicroseconds(EXTRALONG_DELAY);
   
      delayMicroseconds(SYNC_DELAY);
      }
 // }
 onOff != onOff;
}

Hi have the same set of switches, but am having zero success with them, either with your code, or using the RFSwitch library.

The RF switch can deliver me the codes from the remote,at least in theory, as when I then try to send them to the switch from the arduino, i have nothing happening. Plugging the values into your code has no effect either. The other thing is that any given button appears to cycle through about 4 or 5 different codes, one per press.

What's interesting is that the RCSwitch library seems to think that the relationship between high and low changes for "1s" and "0s" whereas yours seems to maintain a constant ratio.

I wonder if it's possible that even though they have the same model number they are different internally?

Have you tried listening for your remotecontrol using the RC Switch Recieve Demo (simple or advanced) at all? If so, does it give you the same values as you determined with audacity?

I attempted to use audacity but on a laptop, there's no line-in, only mic, so the background noise makes the signal appear too noisy really.

Cheers
Kenmc

Just for fun, I connected the RF433 receiver up to my Raspberry Pi and got it to sniff the codes sent by the RC unit; same behaviour, a repeating cycle of codes per button.

So fecking annoying, as my Energenie set just worked out of the box, and I've had an ATTiny powered room heat sensor-switch in my daughters bedroom for a month or so. I just wanted to get the xmas tree lights working from the web :frowning:
Grrr

Here are the results from lay with my set of Lidl outlets:

/*
SilverCrest 91210 RCS AAA3680 - A IP20
Below code will transmit on and off signals to SilverCrest 91210 Remote Electrical Sockets

Based on code from http://forum.arduino.cc/index.php?topic=202556.msg1492685#msg1492685
Modifed by Poopi, Tested on Teensy 2.0++

Sequence had two distinct sub sequences - 
1. 4x with short sync and short '1's 
2. 4x with long sync and longer '1's

Codes were cycled - 4 different codes per each plug but you can choose any of these codes - I used all to mimic original RCU
Seems that 4 last bits are a PLUG identifier and first 4 bits are a remote identifier

Remaining 16 bits seems to be common for all plugs ( Plug C have reverted On/Off sequences sic! )
All codes captured from original RCU usin logic analyzer


Below setup as two Button Pins (each button pin 1 is sent to arduino pins 5 and 8 and pin 4 sent to ground)
Button 1 sends the signal
Button 2 cycles through the functions (A, B, C, D and Master)
433Mhz Transmitter set up on pins 27 and 24
Pin 27 - transmit
Pin 24 - VCC of the transmitter

LED on pin 6 flashes while sending signal
*/

#define DEBUG

/*Setup*/
#define BUTTON_PIN1    26
#define BUTTON_PIN2    25

#define RF_DATA_PIN    27
#define RF_ENABLE_PIN  24
#define BLINK_LED_PIN  6
 
#define MAX_CODE_CYCLES 4

#define SHORT_DELAY       380
#define NORMAL_DELAY      500
#define SIGNAL_DELAY     1500

#define SYNC_DELAY       2650
#define EXTRASHORT_DELAY 3000
#define EXTRA_DELAY     10000

enum {
  PLUG_A = 0,
  PLUG_B,
  PLUG_C,
  PLUG_D,
  PLUG_MASTER,
  PLUG_LAST
};

unsigned long signals[PLUG_LAST][2][MAX_CODE_CYCLES] = {
  { /*A*/
    {0b010000110001000000110000, 0b010001011000011101000000, 0b010000010111111001110000, 0b010010110101111110110000}, 
    {0b010011010100101000100000, 0b010001100010110000010000, 0b010000001110110110010000, 0b010010101111000110100000}
  },  
  { /*B*/
    {0b010000110001000000110100, 0b010001011000011101000100, 0b010000010111111001110100, 0b010010110101111110110100}, 
    {0b010011010100101000100100, 0b010001100010110000010100, 0b010000001110110110010100, 0b010010101111000110100100}
  },  
  { /*C*/
    {0b010011010100101000101100, 0b010001100010110000011100, 0b010000001110110110011100, 0b010010101111000110101100},
    {0b010000110001000000111100, 0b010001011000011101001100, 0b010000010111111001111100, 0b010010110101111110111100} 
  },  
  { /*D*/
    {0b010000110001000000110010, 0b010001011000011101000010, 0b010000010111111001110010, 0b010010110101111110110010}, 
    {0b010011010100101000100010, 0b010001100010110000010010, 0b010000001110110110010010, 0b010010101111000110100010}
  },  
  { /*MASTER*/
    {0b010000110001000000111010, 0b010001011000011101001010, 0b010000010111111001111010, 0b010010110101111110111010}, 
    {0b010011010100101000101010, 0b010001100010110000011010, 0b010000001110110110011010, 0b010010101111000110101010}
  },  
};

boolean       onOff;
unsigned char plug;
unsigned char swap;
 
void setup() {                
  pinMode(BLINK_LED_PIN, OUTPUT);
  pinMode(RF_DATA_PIN, OUTPUT);
  pinMode(RF_ENABLE_PIN, OUTPUT);
  digitalWrite(RF_ENABLE_PIN,LOW);
  pinMode(BUTTON_PIN1, INPUT_PULLUP);
  pinMode(BUTTON_PIN2, INPUT_PULLUP);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("Ready");
  onOff = 1;
  swap  = 0;
  plug  = PLUG_C;
}
 
void loop() {
  if (digitalRead(BUTTON_PIN2) == LOW) {
    plug++;
    plug%=PLUG_LAST;
    Serial.print("PLUG_");
    Serial.print(plug == PLUG_MASTER?'M':(char)('A'+plug));
    Serial.println(" activated");
    delay(1000);
  }
  
  if (digitalRead(BUTTON_PIN1) == LOW) {
    digitalWrite(BLINK_LED_PIN,HIGH);
    ActivatePlug(plug,onOff);
    digitalWrite(BLINK_LED_PIN,LOW);

    onOff = !onOff;
    delay(500);
  }
}


void sendSync(){
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(SHORT_DELAY);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(SYNC_DELAY - SHORT_DELAY);  
}

void sendValue(boolean value, unsigned int base_delay){
  unsigned long d = value? SIGNAL_DELAY - base_delay : base_delay;
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(d);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(SIGNAL_DELAY - d);
}

void longSync(){
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(EXTRASHORT_DELAY);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(EXTRA_DELAY - EXTRASHORT_DELAY);  
}

void ActivatePlug(unsigned char PlugNo, boolean On) {
  if( PlugNo < PLUG_LAST ) {

    digitalWrite(RF_DATA_PIN,LOW);
    digitalWrite(RF_ENABLE_PIN,HIGH);
    delayMicroseconds(1000);

    unsigned long signal = signals[PlugNo][On][swap];
    
    swap++;
    swap%=MAX_CODE_CYCLES;
    
 #ifdef DEBUG
    Serial.print("PLUG_");
    Serial.print(plug == PLUG_MASTER?'M':(char)('A'+plug));
    Serial.print(" ");
    Serial.println(onOff?"On":"Off");
    Serial.println(signal, BIN);
 #endif
 
    for (unsigned char i=0; i<4; i++) { // repeat 1st signal sequence 4 times
      sendSync();
      for (unsigned char k=0; k<24; k++) { //as 24 long and short signals, this loop sends each one and if it is long, it takes it away from total delay so that there is a short between it and the next signal and viceversa
        sendValue(bitRead(signal, 23-k),SHORT_DELAY);
      }    
    }
    for (unsigned char i=0; i<4; i++) { // repeat 2nd signal sequence 4 times with NORMAL DELAY
      longSync();  
      for (unsigned char k=0; k<24; k++) {
        sendValue(bitRead(signal, 23-k),NORMAL_DELAY);
      }
    }
    digitalWrite(RF_ENABLE_PIN,LOW);
  }
}

Interesting, that you get 4 codes per button also. Although for some reason I was not always able to see the codes on every button press, like there was some small timing issues when receiving the data.

will give that a blast tonight hopefully. Did your plugs work ok with Collie147s original code?

Just out of curiosity, where did ye all buy your plugs? Mine were bought in Ireland, but I highly doubt that that would make any much of a difference

Interesting, that you get 4 codes per button also. Although for some reason I was not always able to see the codes on every button press, like there was some small timing issues when receiving the data.

Maybe you have problem with your audio card capture methods. I used cheap usb logic analyzer.

will give that a blast tonight hopefully. Did your plugs work ok with Collie147s original code?

Nope. Different codes. Looks like they have different identifiers ( i.e. see first 4 bits ). I would need more transmitters to compare.

Just out of curiosity, where did ye all buy your plugs?

Poland. I think that as long as yours have a "www.stackerchecker.de" logo on the box they should be the same.

I didn't use audio analyzer, rather rc-switch library (github somewhere, can't find it now). This works 100% reliably with my energenie remotes. Box is in the bin, so dunno about the logo on the box :frowning:
Will see how i go.
K

Wheeeee signs of life!!!! starting to control the silvercrest controls with this code, when I insert the correct rf codes for my RCU.
What's even MORE interesting though is that this code ALSO drives my Energenie plugs with the correct codes from THAT RCU.
Must have been a timing thing or something, which might explain why the protocol was coming through as a "3" for the silvercrests vs a 1 for the energenies.
Thanks a million!

Please give me source code, to control these sockets in all functions,
Thank you very much.
Pepi

Hi, created an account just to post this. I recorded the codes from my remote with the rc-switch library's advanced receive example. I used them with Poopi's code (prefixed with 0b) and they work with my switches. Maybe someone else can use them:

A on codes:

100000011101011001110000
100001110011001101000000
100000000100111100110000
100011000110000010110000

A off codes:

100011100000110010010000
100010100101101010100000
100010001010110100010000
100010011001000100100000

B on codes:

100010001010110100010100
100010011001000100100100
100010100101101010100100
100011100000110010010100

B off codes:

100011000110000010110100
100000011101011001110100
100001110011001101000100
100000000100111100110100

C on codes:

100000011101011001111100
100001110011001101001100
100000000100111100111100
100011000110000010111100

C off codes:

100010100101101010101100
100011100000110010011100
100010001010110100011100
100010011001000100101100

D on codes:

100010001010110100010010
100011100000110010010010
100010100101101010100010
100010011001000100100010

D off codes:

100011000110000010110010
100000000100111100110010
100001110011001101000010
100000011101011001110010

MASTER on codes:

100010100101101010101010
100010011001000100101010
100010001010110100011010
100011100000110010011010

MASTER off codes:

100001110011001101001010
100000011101011001111010
100011000110000010111010
100000000100111100111010

Hi !

I got also the SilverCrest from Lidl (Holland). It works for me as well.

I get the codes first using the RCSwitch Library with the example code "receive advanced". I test all 4 set of codes for each button. The reception is a bit unstable and I find it works better with the arduino conected to a 9V battery instead of the noisy USB port.

Once I have all 4 codes for each button I paste them into the code from Poopi. And works!

here my codes:

A on codes:
101100010110110110101100	
101110101110010001101100
101111000001000101011100
101101000101010100011100

B off codes:
101101010010011101111100
101111100011110000101100	
101111110111001110001100	
101110111000101110111100	

B on codes:
101101110100001000110101	
101101101010100111100101	
101110011101111000000101	
101100100000100011110101

B off codes:
101111011001101011010101
101100111011111101000101
101110001100011010010101
101100001111000011000101

C on codes:
101101010010011101111110
101111100011110000101110
101111110111001110001110
101110111000101110111110

C off codes:
101110101110010001101110
101101000101010100011110
101111000001000101011110
101100010110110110101110

D on codes:
101111011001101011010111
101100111011111101000111
101100001111000011000111
101110001100011010010111

D off codes:
101101110100001000110111
101100100000100011110111
101101101010100111100111
101110011101111000000111

MASTER on codes:
101111100011110000100010
101110111000101110110010
101101010010011101110010
101111110111001110000010

MASTER off codes:
101111000001000101010010
101101000101010100010010
101110101110010001100010
101100010110110110100010

Here is a slightly changed version of the code for testing all switches in series.

/*
SilverCrest 91210 RCS AAA3680 - A IP20
Below code will transmit on and off signals to SilverCrest 91210 Remote Electrical Sockets

Based on code from http://forum.arduino.cc/index.php?topic=202556.msg1492685#msg1492685
Modifed by Poopi, Tested on Teensy 2.0++

Sequence had two distinct sub sequences - 
1. 4x with short sync and short '1's 
2. 4x with long sync and longer '1's

Codes were cycled - 4 different codes per each plug but you can choose any of these codes - I used all to mimic original RCU
Seems that 4 last bits are a PLUG identifier and first 4 bits are a remote identifier

Remaining 16 bits seems to be common for all plugs ( Plug C have reverted On/Off sequences sic! )
All codes captured from original RCU usin logic analyzer


Below setup as two Button Pins (each button pin 1 is sent to arduino pins 5 and 8 and pin 4 sent to ground)
Button 1 sends the signal
Button 2 cycles through the functions (A, B, C, D and Master)
433Mhz Transmitter set up on pins 27 and 24
Pin 27 - transmit
Pin 24 - VCC of the transmitter

LED on pin 6 flashes while sending signal
*/

#define DEBUG

/*Setup*/
#define BUTTON_PIN1    26
#define BUTTON_PIN2    25

#define RF_DATA_PIN    10
#define RF_ENABLE_PIN  24
#define BLINK_LED_PIN  6
 
#define MAX_CODE_CYCLES 4

#define SHORT_DELAY       380
#define NORMAL_DELAY      500
#define SIGNAL_DELAY     1500

#define SYNC_DELAY       2650
#define EXTRASHORT_DELAY 3000
#define EXTRA_DELAY     10000

enum {
  PLUG_A = 0,
  PLUG_B,
  PLUG_C,
  PLUG_D,
  PLUG_MASTER,
  PLUG_LAST
};

unsigned long signals[PLUG_LAST][2][MAX_CODE_CYCLES] = {
  { /*A*/
    {0b101111000001000101011100, 0b101100010110110110101100, 0b101110101110010001101100, 0b101101000101010100011100}, 
    {0b101101010010011101111100, 0b101111100011110000101100, 0b101111110111001110001100, 0b101110111000101110111100}
  },  
  { /*B*/
    {0b101101110100001000110101, 0b101101101010100111100101, 0b101110011101111000000101, 0b101100100000100011110101}, 
    {0b101111011001101011010101, 0b101100111011111101000101, 0b101110001100011010010101, 0b101100001111000011000101}
  },  
  { /*C*/
    {0b101101010010011101111110, 0b101111100011110000101110, 0b101111110111001110001110, 0b101110111000101110111110},
    {0b101110101110010001101110, 0b101101000101010100011110, 0b101111000001000101011110, 0b101100010110110110101110} 
  },  
  { /*D*/
    {0b101111011001101011010111, 0b101100111011111101000111, 0b101100001111000011000111, 0b101110001100011010010111}, 
    {0b101101110100001000110111, 0b101100100000100011110111, 0b101101101010100111100111, 0b101110011101111000000111}
  },  
  { /*MASTER*/
    {0b101111100011110000100010, 0b101110111000101110110010, 0b101101010010011101110010, 0b101111110111001110000010}, 
    {0b101111000001000101010010, 0b101101000101010100010010, 0b101110101110010001100010, 0b101100010110110110100010}
  },  
};

boolean       onOff;
unsigned char plug;
unsigned char swap;
 
void setup() {

  pinMode(RF_DATA_PIN, OUTPUT);
  pinMode(RF_ENABLE_PIN, OUTPUT);
  digitalWrite(RF_ENABLE_PIN,LOW);

  pinMode(BUTTON_PIN1, INPUT_PULLUP);
  pinMode(BUTTON_PIN2, INPUT_PULLUP);
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  Serial.println("Ready");
  swap  = 0;
  plug  = PLUG_C;
}
 
void loop() {

    plug++;
    plug%=PLUG_LAST;
    for (byte a=0; a<=1; a++) {
      onOff = a;
      digitalWrite(BLINK_LED_PIN,HIGH);
      ActivatePlug(plug,onOff);
      digitalWrite(BLINK_LED_PIN,LOW);
      #ifdef DEBUG
      Serial.print("PLUG_");
      Serial.print(plug == PLUG_MASTER?'M':(char)('A'+plug));
      Serial.print(" ");
      Serial.println(onOff?"Off":"On");
      //Serial.println(signal, BIN);
      #endif
      delay(1000);
    }
    Serial.println("===========");
    delay(500);
}


void sendSync(){
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(SHORT_DELAY);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(SYNC_DELAY - SHORT_DELAY);  
}

void sendValue(boolean value, unsigned int base_delay){
  unsigned long d = value? SIGNAL_DELAY - base_delay : base_delay;
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(d);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(SIGNAL_DELAY - d);
}

void longSync(){
  digitalWrite(RF_DATA_PIN, HIGH);
  delayMicroseconds(EXTRASHORT_DELAY);
  digitalWrite(RF_DATA_PIN, LOW);
  delayMicroseconds(EXTRA_DELAY - EXTRASHORT_DELAY);  
}

void ActivatePlug(unsigned char PlugNo, boolean On) {
  if( PlugNo < PLUG_LAST ) {

    digitalWrite(RF_DATA_PIN,LOW);
    digitalWrite(RF_ENABLE_PIN,HIGH);
    delayMicroseconds(1000);

    unsigned long signal = signals[PlugNo][On][swap];
    
    swap++;
    swap%=MAX_CODE_CYCLES;
 
    for (unsigned char i=0; i<4; i++) { // repeat 1st signal sequence 4 times
      sendSync();
      for (unsigned char k=0; k<24; k++) { //as 24 long and short signals, this loop sends each one and if it is long, it takes it away from total delay so that there is a short between it and the next signal and viceversa
        sendValue(bitRead(signal, 23-k),SHORT_DELAY);
      }    
    }
    for (unsigned char i=0; i<4; i++) { // repeat 2nd signal sequence 4 times with NORMAL DELAY
      longSync();  
      for (unsigned char k=0; k<24; k++) {
        sendValue(bitRead(signal, 23-k),NORMAL_DELAY);
      }
    }
    digitalWrite(RF_ENABLE_PIN,LOW);
  }
}

Just to add - I have had success with this sketch with similar sockets under the "Delta" brand. Other Electronics for Sale in Ireland | Adverts.ie

Support for these sockets based on this thread has been merged into rc-switch. Thank you for this work.

Sorry to be thick. I'm trying to understand how this code relates to my standard UNO pinouts and the various pins mentioned in the code as repeated below. For example what is "button pin 1"? Also, what is meant by "Transmitter set up on pins 27 and 24". Where are pins 27 and 24 on the UNO?

This is probably all obvious to the experienced but to a newbie it is confusing. Has anyone posted a definitive hardware setup? Appreciate any help.

Below setup as two Button Pins (each button pin 1 is sent to arduino pins 5 and 8 and pin 4 sent to ground)
Button 1 sends the signal
Button 2 cycles through the functions (A, B, C, D and Master)
433Mhz Transmitter set up on pins 27 and 24
Pin 27 - transmit
Pin 24 - VCC of the transmitter
LED on pin 6 flashes while sending signal
*/
#define DEBUG
/Setup/
#define BUTTON_PIN1 26
#define BUTTON_PIN2 25
#define RF_DATA_PIN 10
#define RF_ENABLE_PIN 24
#define BLINK_LED_PIN 6

Just to add to this, in case anyone else looks for it, I found this works the same on my Bauhn Indoor Remote Controlled Powerpoints I got from Aldi in Australia.

I know this is an old thread, but I couldn't find any other relevant references to Bauhn/Aldi Australian power point switches.

For the people who have a newer version of the silvercrest switches.

unsigned long signals[PLUG_LAST][2][MAX_CODE_CYCLES] = {
  { /*A*/
    {0b111110001100010110101100, 0b111101101010101001101100, 0b111110011101110100011100, 0b111111011001100101011100}, 
    {0b111101000101011000101100, 0b111111110111000001111100, 0b111100010110111010111100, 0b111111000001001010001100}
  },  
  { /*B*/
    {0b111111100011111111110101, 0b111100001111001100110101, 0b111100100000101100000101, 0b111101110100000111100101}, 
    {0b111101010010010011010101, 0b111100111011110010010101, 0b111110101110011111000101, 0b111110111000100001000101}
  },  
  { /*C*/
    {0b111111110111000001111110, 0b111100010110111010111110, 0b111111000001001010001110, 0b111101000101011000101110},
    {0b111110011101110100011110, 0b111101101010101001101110, 0b111110001100010110101110, 0b111111011001100101011110} 
  },  
  { /*D*/
    {0b111101010010010011010111, 0b111100111011110010010111, 0b111110101110011111000111, 0b111110111000100001000111}, 
    {0b111100100000101100000111, 0b111101110100000111100111, 0b111111100011111111110111, 0b111100001111001100110111}
  },  
  { /*MASTER*/
    {0b111111110111000001110010, 0b111101000101011000100010, 0b111111000001001010000010, 0b111100010110111010110010}, 
    {0b111101101010101001100010, 0b111110011101110100010010, 0b111111011001100101010010, 0b111110001100010110100010}
  },  
};

I have a similar SilverCrest remote control socket set from Lidl: RC DS2 0201-A FR 3726 and have been investigating the possibility of replacing the supplied remote with eBay purchased 433.92MHz transmitter with Arduino UNO. To deduce the code that the remote/socket use I used an eBay purchased 433.92MHz receiver and a DSO to monitor the data output. Like Collie147 I was able to deduce the 24bit binary codes and the repeating transmit sequence but never got round to implementing an Arduino solution. It was only recently that I revived interest in pursuing this and happened to stumble on this thread. Happy to report that substituting the 24bit binary codes for my SilverCrest remote worked fine. Great work!

Since this thread is already necro-bumped I thought I'd just chime in.

Has anyone tried to find the system behind the codes?
As far as I see there are always 4 ON-codes and 4 OFF-codes belonging together.
If I program a socket to one ON code it automatically knows the other 7 belonging codes. So either all the sockets contain huge lists of randomly generated codes (which I doubt) or they can be calculated from each other.

I tried lots of ideas but can't seem to find the system. Any ideas?

These are the codes from my two remotes (uniTEC 48111, model 50028):

//
// // Remote ID: 232215
//

0000 0011 1000 1011 0001 0111  = 232215

// A on
0000 0010 1101 1101 0111 0000  = 187760
0000 1001 0101 0001 0100 0000  = 610624
0000 1011 0011 1000 0011 0000  = 735280
0000 1110 1100 0101 1011 0000  = 968112

// A off
0000 0001 0001 1110 1001 0000  = 073360
0000 0101 1110 0011 0010 0000  = 385824
0000 1100 1010 0110 0001 0000  = 828944
0000 1111 0000 0111 1010 0000  = 984992

// B on ( A on + 4)
0000 0010 1101 1101 0111 0100  = 187764
0000 1001 0101 0001 0100 0100  = 610628
0000 1011 0011 1000 0011 0100  = 735284
0000 1110 1100 0101 1011 0100  = 968116

// B off ( A off + 4)
0000 0001 0001 1110 1001 0100  = 073364
0000 0101 1110 0011 0010 0100  = 385828
0000 1100 1010 0110 0001 0100  = 828948
0000 1111 0000 0111 1010 0100  = 984996

// C on (B on + 8)
0000 0010 1101 1101 0111 1100  = 187772
0000 1001 0101 0001 0100 1100  = 610636
0000 1011 0011 1000 0011 1100  = 735292
0000 1110 1100 0101 1011 1100  = 968124

// C off (B off + 8)
0000 0001 0001 1110 1001 1100  = 073372
0000 0101 1110 0011 0010 1100  = 385836
0000 1100 1010 0110 0001 1100  = 828956
0000 1111 0000 0111 1010 1100  = 985004

// D on (C off - 10)
0000 0001 0001 1110 1001 0010  = 073362
0000 0101 1110 0011 0010 0010  = 385826
0000 1100 1010 0110 0001 0010  = 828946
0000 1111 0000 0111 1010 0010  = 984994

// D off ( C on - 10)
0000 0010 1101 1101 0111 0010  = 187762
0000 1001 0101 0001 0100 0010  = 610626
0000 1011 0011 1000 0011 0010  = 735282
0000 1110 1100 0101 1011 0010  = 968114
//
// // Remote ID: 512214
//

0000 0111 1101 0000 1101 0110  = 512214

// A on
0101 0001 1111 1110 0111 0000  = 5373552
0101 0100 0101 0000 0011 0000  = 5525552
0101 0110 1010 0111 0100 0000  = 5678912
0101 0111 0001 1111 1011 0000  = 5709744

// A off
0101 0000 0110 1010 0010 0000  = 5270048
0101 1001 1011 1101 1001 0000  = 5881232
0101 1010 0111 0001 1010 0000  = 5927328
0101 1011 1101 1100 0001 0000  = 6020112

// B on ( A on + 4)
0101 0001 1111 1110 0111 0100  = 5373556
0101 0100 0101 0000 0011 0100  = 5525556
0101 0110 1010 0111 0100 0100  = 5678916
0101 0111 0001 1111 1011 0100  = 5709748

// B off
0101 0000 0110 1010 0010 0100  = 5270052
0101 1001 1011 1101 1001 0100  = 5881236
0101 1010 0111 0001 1010 0100  = 5927332
0101 1011 1101 1100 0001 0100  = 6020116

// C on
0101 0001 1111 1110 0111 1100  = 5373564
0101 0100 0101 0000 0011 1100  = 5525564
0101 0110 1010 0111 0100 1100  = 5678924
0101 0111 0001 1111 1011 1100  = 5709756

// C off
0101 0000 0110 1010 0010 1100  = 5270060
0101 1001 1011 1101 1001 1100  = 5881244
0101 1010 0111 0001 1010 1100  = 5927340
0101 1011 1101 1100 0001 1100  = 6020124

// D on
0101 0000 0110 1010 0010 0010  = 5270050
0101 1001 1011 1101 1001 0010  = 5881234
0101 1010 0111 0001 1010 0010  = 5927330
0101 1011 1101 1100 0001 0010  = 6020114

// D off
0101 0001 1111 1110 0111 0010  = 5373554
0101 0100 0101 0000 0011 0010  = 5525554
0101 0110 1010 0111 0100 0010  = 5678914
0101 0111 0001 1111 1011 0010  = 5709746

SilverCrest 303937 / RCR DP3 3011-A
Bought from LIDL (UK) today. Seems to work well.

Using Poopi's code.

unsigned long signals[PLUG_LAST][2][MAX_CODE_CYCLES] = {
  { /*A*/
    {0b110000010011001100010000, 0b110010101011011110010000, 0b110001011100111010100000, 0b110001110000000000000000},
    {0b110011001000001010110000, 0b110011110010100100110000, 0b110000001010110100000000, 0b110001001001000101110000}
  },
  { /*B*/
    {0b110010101011011110010100, 0b110000010011001100010100, 0b110001111101011000100100, 0b110001011100111010100100},
    {0b110011110010100100110100, 0b110011001000001010110100, 0b110001001001000101110100, 0b110000001010110101000100}
  },
  { /*C*/
    {0b110001111101011000101100, 0b110001011100111010101100, 0b110010101011011110011100, 0b110000010011001100011100},
    {0b110001001001000101111100, 0b110000001010110101001100, 0b110011110010100100111100, 0b110011001000001010111100}
  },
  { /*D*/
    {0b110011001000001010110010, 0b110011110010100100110010, 0b110000001010110101000010, 0b110001001001000101110010},
    {0b110000010011001100010010, 0b110010101011011110010010, 0b110001011100111010100010, 0b110001111101011000100010}
  },
  { /*Master*/
    {0b110000001010110101001010, 0b110001001001000101111010, 0b110011001000001010111010, 0b110011110010100100111010},
    {0b110001011100111010101010, 0b110001111101011000101010, 0b110000010011001100011010, 0b110010101011011110011010}
  },
};