homebridge-localtuya
v0.0.2
Published
Homebridge plugin for local control of Tuya devices
Maintainers
Readme
homebridge-localtuya
A Homebridge plugin for controlling Tuya devices locally without cloud dependencies. Currently optimized for fan/light combination devices, specifically Designers Fountain ceiling fans.
Features
- Local control of Tuya devices without cloud dependency
- Real-time status updates
- Support for fan and light combination devices
- HomeKit integration for:
- Fan on/off state and speed control
- Light on/off state and brightness control
Prerequisites
- Homebridge installed and running
- Tuya device(s) set up and connected to your local network
- Device local keys (see Obtaining Device Keys)
Installation
npm install -g homebridge-localtuya@betaConfiguration
Configure through Homebridge UI or by editing config.json:
{
"platforms": [
{
"platform": "LocalTuya",
"devices": [
{
"name": "Living Room Fan",
"id": "device_id",
"key": "local_key",
"ip": "device_ip",
"type": "fanLight"
}
]
}
]
}Required Device Parameters
name: Display name in HomeKitid: Device ID from Tuyakey: Local encryption keyip: Device's local IP addresstype: Device type (currently only "fanLight" supported)
Obtaining Device Keys
Method 1: Smart Life App (Recommended)
- Install Smart Life app and add your devices
- Use third-party tools to extract local keys from the app
- Note down device IDs and local keys
Method 2: IoT Platform
Create Account:
- Visit iot.tuya.com
- Register for a developer account
- Select your data center based on location
Create Cloud Project:
- Go to Cloud > Development
- Create new project
- Select "Smart Home" industry and development method
Configure API Access:
- Enable required services:
- Industry Basic Service
- Smart Home Basic Service
- Device Status Notification APIs
- Note your Access ID and Secret
- Enable required services:
Link Devices:
- Navigate to Cloud > Your Project > Devices
- Click "Link Tuya App Account"
- Use Smart Life app to scan QR code
- Authorize connection
Get Device Information:
- Device IDs and local keys will be visible in the linked devices section
- Note: IoT platform access to local keys is limited and may not work for all devices
Supported Devices
Currently optimized for:
- Fan/light combination devices (Designers Fountain ceiling fans)
- Devices using Tuya protocol version 3.3
Troubleshooting
- Ensure device is connected to local network
- Verify device IP address is correct and static
- Confirm local key is correct
- Check device is using compatible protocol version (3.3)
Contributing
This is a beta version focused on fan/light combination devices. Please report issues on GitHub.
License
MIT
For more information about Homebridge, visit the Homebridge documentation.
