[Appendix] Programming the KlikAanKlikUit

Using the https://github.com/vdwel/switchKaKu/blob/master/README.md you can program or erase codes from your KlikAanKlikUit socket.

Code for programming a new code (replace 123456 with your own code)

#include <Arduino.h>

#include "switchKaKu.h"
#define TRANSMITTERID1 123456
#define rfPin 25
void setup() {
  
}

void loop() {
  switchKaku(rfPin, TRANSMITTERID1, 1, 1, true, 3);
  delay(500);
}

Example code for erasing a code:

#include <Arduino.h>

#include "switchKaKu.h"
#define TRANSMITTERID1 123456
#define rfPin 25

void setup() {
  
}

void loop() {
  switchKaku(rfPin, TRANSMITTERID1, 1, 1, false, 3);
  delay(500);
}

Be aware! There is no way to know what codes are on your socket.

@Mathijs
Does the code refer to the ID of the klickaanklickuit client? Meaning the client ID needs to be found out by trail and error?

Let’s get the terms straight here. The KlikAanKlikUit is not a client, the KaKu is a device that listens for a signal all the time.

The ID it listens to needs to be programmed, and it can be a number between 1 and 67108863 (28 bits).

Since I am revising some parts of the documentation the part about RF communication isn’t ready yet.

The KaKu socket you got has an ID preprogrammed by me, and it should be the bottom part of the serial number without the leading zero(s).

But you can program any number on it you want!

If you have a socket and you want to know which ID’s are programmed on it, you need to find them out by trial and error indeed. But it is just easier to reprogram it :slight_smile:

Could I maybe have future reference on how to reprogram the ID? That would be easier then my automated ID brute force idea using a 230 V AC relays

You have to send the code for ON right after plugging in the socket. If the code gets programmed it will click a few times.

Ah, so it works the same way as the remote controlls work, that also means you can manually set multiple codes by pressing the set controll button. The larger versions of these sockets have a rather large button for this, but i see on the smaller ones you have an small hole for setting the code near one of the earthing contactors

Nope, you don’t have to press any buttons at all (there are none). Just plug in the socket and it will enter program mode by default for a few seconds.