Automating the home with the Raspberry Pi

Wireless Communication Outlets

In my test, I used a wireless outlet set with three outlets and a remote control that is compatible with my home in Germany [3], but you should be able to find outlets that are compatible with the system in your country from other manufacturers via a web search.

For the 433MHz transmitter module to talk to the wireless communication outlets, you have to figure out their preset house code and change it. To find and set the code, open the back cover on the outlet with a small screwdriver and set the respective code (Figure  3). A row of binary numbers stands for the house code, and letters of the alphabet identify an individual outlet. It is a good idea to change the default code so your neighbors won't inadvertently control your outlets.

Figure 3: Setting the code for a wireless communication outlet.

In my case, I used 11010 as the house code. To enter this code, I flipped the 1, 2, and 4 switches on the DIP switch up and the others down. Next, you can configure the identifiers for the outlets.

For example, you can configure the first outlet by setting the A switch in the up position; for the next outlet, set the B switch up, so on. By means of this configuration process, you provide an ID for each outlet to which the transmitter module can then talk. If you want to use one command to control several devices at once, you should allocate identical letters to every outlet.


To test the outlets, you should use the same code on the remote control as you did on an outlet and then try to control it. If this works, it is time to control the wireless communication outlets with the Raspberry  Pi. To do so, you use the send tool you compiled from the raspberry-remote library:

$ sudo ~/raspberry-remote/send <housecode> <outlet-ID> <state>

Therefore, here, the command used to turn on outlet  A is:

sudo ./send 11010 1 1

To deactivate it again, I would replace the last number with 0. This is the pattern for controlling the lamp and the coffee machine with the communication outlets that have been installed. Of course, the lamp has to be turned on and connected to the communication outlet, as does the coffee machine, which should start brewing the coffee as soon as the electricity starts flowing.

To play videos via the Raspberry  Pi, the Raspbian operating system has OMXPlayer as part of its offerings. Typically, you only need one command line to transfer a file via HDMI to the TV:

$ sudo omxplayer -o hdmi /home/pi/Motivation/video.mp4

This requires the TV to be connected via the HDMI cable to the Raspberry  Pi. You should also plug the TV in to a wireless communication outlet to avoid leaving the TV on the entire night. Then, the Rasp Pi can turn on the TV, start the desired video, and cut the power connection after a certain amount of time has passed.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content