Salam Waddah Uses PlayStation4 Gamepad to Control Smart Lights

The Raspberry Pi-powered project shows how to operate Xiaomi Mi home devices using a PlayStation4 controller.

Maker Salam Waddah has come up with a unique way to control his Xiaomi Mi home devices using a PlayStation4 gamepad, as a demonstration of how different technologies can work together. This open source project is based on the Raspberry Pi 4 that connects the Bluetooth device and Node.js server.

The project utilizes only three components β€” the PS4 controller, Xiaomi MI smart lights, and a Raspberry Pi 4. The basic concept was to make a Bluetooth device that tells the Raspberry Pi to do something, which in this case happens to be the gamepad.

The build process is fairly straightforward, starting with obtaining the Xiaomi device tokens for which the steps are available on the GitHub repository. Then, set up a Node.js server on Raspberry Pi, write an API to adjust the lights, and connect the controller to the Pi via Bluetooth and Python. This works on the Python code that enables the PS4 controller to talk with the APIs. Waddah has provided all the code on GitHub.

If you find this interesting, more details are available in Waddah's blog and over on Reddit.

Abhishek Jadhav
Abhishek Jadhav is an engineering student, freelance tech writer, RISC-V Ambassador, and leader of the Open Hardware Developer Community.
Related articles
Sponsored articles
Related articles