@prasad-edlabadkar/homebridge-tuya
v3.1.3
Published
Homebridge plugin for local Tuya devices
Downloads
326
Maintainers
Readme
Homebridge-Tuya
Control your supported Tuya accessories locally in HomeKit
This fork includes Homebridge 2 compatibility fixes for cached accessories, malformed Tuya LAN discovery payloads, automatic sanitizing of invalid HomeKit accessory names, and Tuya 3.3 Outlet startup/write-state handling.
Fork transparency: the palasinio/homebridge-tuya fork maintenance and compatibility fixes in versions 3.1.2 through 3.1.5 were developed with Codex assistance and reviewed in the local repository before release.
- Supported Device Types
- Installation Instructions
- Configuration
- Known Issues
- Troubleshooting
- Credits
- License
- Donating
Supported Device Types
Click the number next to your device to find the possible DataPoint "DP" values, then add as needed to your config.
- Air Conditioner1
- Air Purifiers2
- Convectors3
- Dehumidifers4
- Dimmers5
- Fan6
- Fan v27
- Garages8
- Heaters9
- Lights
- Oil Diffusers13
- Outlets14
- Switches15
Note: Motion, and other sensor types don't behave well with responce requests, so they will not be added.
Installation Instructions
Option 1: Install via Homebridge Config UI X:
Search for "Tuya" in homebridge-config-ui-x and install homebridge-tuya.
Option 2: Manually Install:
sudo npm install -g homebridge-tuyaCompatibility
- Homebridge
^1.8.0 || ^2.0.0-beta.0 - Node.js
>=18 - Node.js 22 LTS is recommended for Homebridge 2.x installs. Node.js 24 is not explicitly tested by this fork.
- Tuya 3.3 devices with malformed UDP discovery payloads are handled more defensively than in the upstream 3.1.1 release.
- Version 3.1.3 specifically targets a Homebridge 2.1.x / HAP 2.x behavior issue observed with Tuya 3.3 Outlets where discovery succeeded but cached Outlet controls could remain unavailable or non-writable.
Configuration
UI
- Navigate to the Plugins page in homebridge-config-ui-x.
- Click the Settings button for the Tuya plugin.
- Add your device types
- Add device parameters10
- Restart Homebridge for the changes to take effect.
Manual
- Edit the config.json file to add your device types, and parameters.
- Restart Homebridge
Known Issues
- If your devices add, but you can't control them, make sure you entered the DataPoint "DP" values for your device.
Troubleshooting
- Make sure the plugin is up-to date
- Check for existing issues
Homebridge 2.x Tuya 3.3 Outlet startup
For a healthy Tuya 3.3 Outlet startup, the log should progress through these markers:
Discovered ... identified as Outlet (3.3)
Discovery ended.
Connected to ...
Ready to handle ... (Outlet:3.3) with signature ...If you see:
Recovered malformed discovery payload ...without later Connected to ... and Ready to handle ... lines, the device was discovered but did not complete the connect/state path. Check the configured device IP, local key, network reachability from the Homebridge host, and whether the device is already holding another local LAN connection.
Socket messages such as ECONNRESET, ERR_PING_TIMED_OUT, ENETUNREACH, EHOSTUNREACH, or ERR_CONNECTION_TIMED_OUT indicate the plugin is retrying the Tuya LAN socket after discovery. These are connect-path failures, not HomeKit name or cached-accessory restore failures.
For Homebridge 2.x child bridges, a cached accessory may first be marked unreachable during restore. Version 3.1.4 registers Outlet handlers from the base socket connect path, before _connect() can emit, and normalizes the initial On / OutletInUse state to booleans so the Outlet can recover once the Tuya device connects and reports state.
Contributing
If you have new accessory logic for a new device, please add a function defined by manufacturer, and describe your changes in the readME file.
Credits
- AMoo-Miki - developer of the Tuya-Lan plugin which this plugin is based off.
- mxDanger - Plugin branding.
- CodeTheWeb - developer of TuyaApi, who gratiously provided this repo's name.
- Oznu - developer of Homebridge, added
config.schema.json, fixed dependencies, and helped inspire this readME off his gsh plugin.
License
Donating
Please donate to a local pet shelter, or food pantry. It's been a wild time, but we can do our part by helping others.
