This project is mostly intended for personal use and is specifically tailored to my setup, but with very little modification, it is easy to personalize all the features you need.
This project requires that you make (somewhat) irreversible changes to your IKEA Dioder light control unit and you also run the risk of accidentally permanently damaging your control unit.
- A soldering iron
- Solder and flux
- Wire (I used 22 gauge standard breadboard wire, but almost any small kind will work)
- IKEA Dioder LED Light Kit
- Raspberry Pi w/internet connection (I used the Raspberry Pi 2, but any Pi with GPIO pins will work)
Wiring diagram (source: ffraenz/redoid)
- Open the plastic casing of the Dioder control unit to access the PCB
- Solder a wire to connect terminal "2" to a ground pin on the GPIO port
- Solder wires between "R", "G", "B" and
GPIO_4
,GPIO_17
andGPIO_18
respectively - Install dependencies on your Pi:
apt install nodejs && apt install npm
, and install pi-blaster with your preferred build method - Clone this repository:
git clone https://github.com/alec-chan/raspberrypi-dioder-server.git
cd raspberrypi-dioder-server && npm install
nodejs app.js
to start the server
Now you should be able to connect to your Raspberry Pi's ip address through your browser and be presented with this page:
The raspberry pi dioder server hosts an API for controlling the lights. The API can be interfaced with through HTTP GET
and POST
requests. Currently there are only two endpoints for this API:
The /submit
endpoint listens for a POST
request with a body containing a JSON object formatted like so: {"off": boolean, "color": string}
the off property tells the server to turn off the light and the color property tells the server what color to transition the lights to. If off is true, the color property will be disregarded.
The /status
endpoint allows clients to query the current state of the lights. /status
listens for a GET
request and responds with a JSON object: {"off": boolean, "color": string}
.