Skip to content

linux2z/TuyaSmarthomeApi

Repository files navigation

Tuya Smart Home Banner

🏠 Tuya Smart Home Web Dashboard

A premium, high-performance web interface for your Tuya IoT ecosystem.

Next.js TypeScript Tuya

🚀 Features📦 Installation⚙️ Configuration📸 Screenshots👤 Author


✨ Features

  • 💎 Modern Aesthetics: Sleek dark-mode interface using Glassmorphism and Outfit typography.
  • 📡 Real-time Control: Instant toggle for switches and plugs.
  • 📺 Advanced TV Remote: Special Infrared (IR) interface for volume, channel, and power control.
  • 🎚️ Dynamic Sliders: Built-in support for brightness, volume, and temperature adjustments.
  • Auto-Discovery: Automatically fetches and categorizes your entire device list.
  • 🛡️ Reliable Connection: Built-in retry logic to handle cloud-side connection blips gracefully.

📸 Screenshots

Dashboard Preview

Live Dashboard featuring Infrared TV controls and lighting switches.


📋 Prerequisites

Before you begin, ensure you have the following:

  • Node.js 18.x or higher.
  • A Tuya Developer Account (create one at developer.tuya.com).
  • At least one Tuya-compatible device linked to your account.

🚀 Installation

1. Clone & Install

git clone https://github.com/linux2z/tuya-smart-home.git
cd tuya-smart-home
npm install

2. Configuration

The project includes a .env file with placeholders. Open it and fill in your Tuya Developer credentials:

TUYA_ACCESS_ID=your_id
TUYA_ACCESS_SECRET=your_secret
TUYA_UID=your_uid
TUYA_API_ENDPOINT=https://openapi.tuyaeu.com

Tip

Pro Tip: For local development, you can create a .env.local file. Settings in .local will override the main .env and are automatically ignored by Git to keep your keys safe.

Tip

Endpoint Guide:

  • Western America: https://openapi.tuyas.com
  • Central Europe: https://openapi.tuyaeu.com
  • China: https://openapi.tuyacn.com

3. Start Development

npm run dev

Visit localhost:3000 to start controlling your home!


📂 Architecture

  • /src/app: Next.js App Router providing a dynamic, responsive dashboard.
  • /src/lib: Core logic including Tuya SDK initialization and API wrappers.
  • /scripts: Utility scripts for system health and device inspection:
    • test-connection.ts: Validate your Tuya API credentials.
    • inspect-devices.js: Detailed dump of all connected device capabilities.
    • inspect-tv.js: Specific diagnosis for Infrared (IR) remote functionalities.

📜 License

This project is licensed under the MIT License.

Built by linux2z

Made with ❤️ for the Smart Home Community

About

A professional web dashboard leveraging the Tuya Open API to seamlessly control and monitor your home IoT ecosystem. Built with Next.js 16 for high performance and real-time responsiveness.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors