Third party cookies may be stored when visiting this site. Please see the cookie information.
PenguinTutor YouTube Channel


Hack an Infrared Smart Light Bulb with a Raspberry Pi

This project controls an infrared smart light bulb using a Raspberry Pi to capture the signals and replay them back to the light. Designed for use with the Diall 3-in-one light this also works with other makes such as Crystalite and Magic Lighting.

Hack an infrared light using a Raspberry Pi

The light bulb has an E27 Edison Screw fitting (ES). The lamp used for this is an Ikea Skurp table / wall uplighter.

How this works

The light used is a Diall Infrared 3-in-1 light. These are available from DIY and hardware stores, in the UK through B&Q. These come with a simple infrared remote control. Using a Raspberry Pi to capture and reply the infrared signals opens up lots of opportunities for controlling the light through program code.

A small electronic circuit provides a way for the Raspberry Pi to capture the signals from the infrared remote control. This is captured using gpiod which saves the signal from the IR remote as a hash entry. This can then be played back to send the same infrared signals to the light. The signals can be sent from the command line or can be controlled using Python code.

Circuit Diagram

The circuit diagram for both the infrared receiver and the infrared transmitter is shown below. The receiver is only needed for capturing the codes from the infrared remote control

Circuit diagram for a Raspberry Pi infrared receiver and transmitter

This is a simple circuit which can be built on a breadboard, on a circuit board (such as the perma prototyping HAT) or can be bought as a pre-built module such as the Engergenie infrared controller.


The Pigpio libraries are installed by default on the Raspberry Pi Raspbian image. The pigpiod daemon needs to be started first and then that can be accessed using the program or from your own Python code.

To start the daemon run:
sudo pigpiod
or to set it to start automatically run:
sudo systemctl enable pigpiod.service

You will also need to download the program

Capturing the infrared codes from a remote control

To capture the signals use:
./ -r -g18 diall_codes power brighter dimmer red green blue white flame party
You will be prompted to press each of the listed buttons twice to capture the code.

Note: This only captures a sub-set of the buttons on the remote control. You can capture the remaining buttons by including them on the command line.

Sending signals on the command line

You can then send one of the codes to the light using the following
./ -p -g17 -f diall_codes blue

This sends the code to change the colour to blue, you can use other codes and combine codes onto the command line.

Python code

The Python code use a module called which needs to be in the same directory as the rest of the code. The following files are included in the download.

  • - Python module
  • - Example code for the Diall light
  • - Example code for the Crystalite light
  • dial_codes - Codes for the Diall light (or create your own using instructions above)
  • cryst_light_codes - Codes for the Crystalite light (or create your own using instructions above)

How to Use for Home Automation

See the following for ideas of how this could be included in your home automation.

Future projects

I'm always working on new projects
To find out about the updates please:
Subscribe to the PenguinTutor YouTube Channel
Follow @penguintutor on Twitter

Previous Raspberry PI PixelStrip / NeoPixel GUI
Raspberry PI PixelStrip / NeoPixel GUI
Next Raspberry Pi Outdoor display and NeoPixels
Raspberry Pi Outdoor display and NeoPixels