Install Tim Leland’s web-manager code (which includes a modified version of 433Utils for using the RF hardware). Note, Tim’s code is a part of a web-based project that he maintains. I’m not going into details on setting up the web server, but if you would like to have the option of controlling the plugs from a web app, check out Tim’s excellent blog post

Figure out what RF codes are used by the power outlet remote control and receiver:

Run: sudo/var/www/rfoutlet/RFSniffer

Press each button on the remote control and take note of the 6-digit code as well as the pulse that shows on the screen – for both ON and OFF.

Note, you may need to hold the remote control RIGHT next to the receiver on your breadboard – nearly touching, it doesn’t have much range.

Create the python script that will control the clapper and ties everything together.There are several ways you can accomplish this:

Download it straight to the Pi with the command:wget-O~/clapper.pyhttps://gist.githubusercontent.com/aplocher/e83fdc72e705c099936cc187cee74768/raw(NOTE #1 – that’s an uppercase -O, NOTE #2 – if you’re typing this out by hand, there’s a tinyurl you can use instead: http://tinyurl.com/bc-clapper)

Or, edit a new file and paste the contents into that file:

nano~/clapper.py

Copy the script (above) and paste it into your terminal window

Press CTRL+o to SAVE, and hit ENTER

Press CTRL+x to EXIT

Configure the Python script if necessary. Lines 20 – 40 can be tweaked to adjust the RF codes, the path to the codesend bin, and sensitivity of the clap detection.

nano~/clapper.py

Change any necessary config variables between lines 20 and 40

When done, press CTRL+o to SAVE, and hit ENTER

Press CTRL+x to EXIT

Test it by running:

python~/clapper.py-h – should show help info

python~/clapper.py--on – should activate the power (and exit)

python~/clapper.py--off – should deactivate the power (and exit)

python~/clapper.py – should listen for claps to toggle power on and off (will remain running)