I built a custom web-based remote to control my Havells smart bulb, which is powered by Tuya. The official app works fine, but I wanted the flexibility of controlling my bulb through a browser — so I made one.
- Backend: Node.js + Express
- Frontend: Vanilla JavaScript, HTML, CSS
- Power on/off control
- Brightness adjustment
- White temperature control (0–1000 scale)
- HSV color picker for full RGB spectrum
- Responsive UI that works across desktop and mobile
- Visual slider-based controls with real-time feedback
To communicate with the bulb, I used Tuya’s Cloud APIs. The setup involved:
- Registering a cloud project at Tuya IoT Console
- Linking my smart bulb to the project using the Tuya Smart app
- Using the following credentials:
access_keysecret_keydevice_id
Once configured, my backend authenticated with Tuya and sent device commands using Tuya's standard data point (DP) codes like:
switch_ledbright_value_v2temp_value_v2work_modecolour_data(HSV)
- Clone the repo
- Install dependencies
npm install - Create a .env file with your Tuya credentials: ACCESS_ID=your_access_key ACCESS_SECRET=your_secret_key DEVICE_ID=your_device_id 4.Start the server node index.js 5.Open the browser and go to http://localhost:3000
