@homebridge-plugins/homebridge-tuya 3.0.0-beta.2 → 3.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +354 -142
- package/config.schema.json +1221 -893
- package/dist/cloud/api/TuyaOpenAPI.js +108 -60
- package/dist/cloud/api/TuyaOpenAPI.js.map +1 -1
- package/dist/cloud/api/TuyaOpenMQ.js +45 -22
- package/dist/cloud/api/TuyaOpenMQ.js.map +1 -1
- package/dist/cloud/device/{TuyaDeviceManager.js → TuyaCloudDeviceManager.js} +146 -96
- package/dist/cloud/device/TuyaCloudDeviceManager.js.map +1 -0
- package/dist/cloud/device/TuyaCustomDeviceManager.js +75 -5
- package/dist/cloud/device/TuyaCustomDeviceManager.js.map +1 -1
- package/dist/cloud/device/TuyaDevice.js.map +1 -1
- package/dist/cloud/device/TuyaHomeDeviceManager.js +81 -13
- package/dist/cloud/device/TuyaHomeDeviceManager.js.map +1 -1
- package/dist/config.js +26 -5
- package/dist/config.js.map +1 -1
- package/dist/local/DynamicChildDiscovery.js +2 -1
- package/dist/local/DynamicChildDiscovery.js.map +1 -1
- package/dist/local/LocalDevice.js +16 -3
- package/dist/local/LocalDevice.js.map +1 -1
- package/dist/local/LocalDeviceManager.js +361 -164
- package/dist/local/LocalDeviceManager.js.map +1 -1
- package/dist/local/TuyaDiscovery.js +16 -7
- package/dist/local/TuyaDiscovery.js.map +1 -1
- package/dist/local/ZigbeeGatewayDetection.js +7 -4
- package/dist/local/ZigbeeGatewayDetection.js.map +1 -1
- package/dist/local/protocol/ProtocolUtilities.js +34 -17
- package/dist/local/protocol/ProtocolUtilities.js.map +1 -1
- package/dist/local/protocol/ProtocolV31V32.js +4 -2
- package/dist/local/protocol/ProtocolV31V32.js.map +1 -1
- package/dist/local/protocol/ProtocolV33.js +4 -2
- package/dist/local/protocol/ProtocolV33.js.map +1 -1
- package/dist/local/protocol/ProtocolV34.js +10 -5
- package/dist/local/protocol/ProtocolV34.js.map +1 -1
- package/dist/local/protocol/ProtocolV35.js +8 -4
- package/dist/local/protocol/ProtocolV35.js.map +1 -1
- package/dist/platform.js +253 -493
- package/dist/platform.js.map +1 -1
- package/dist/settings.js +0 -2
- package/dist/settings.js.map +1 -1
- package/dist/shared/TuyaDeviceManager.js +147 -0
- package/dist/shared/TuyaDeviceManager.js.map +1 -0
- package/dist/shared/TuyaHybridDeviceManager.js +215 -0
- package/dist/shared/TuyaHybridDeviceManager.js.map +1 -0
- package/dist/shared/accessory/AccessoryFactory.js +350 -0
- package/dist/shared/accessory/AccessoryFactory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/AirConditionerAccessory.js +21 -15
- package/dist/shared/accessory/AirConditionerAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/AirPurifierAccessory.js.map +1 -1
- package/dist/shared/accessory/AirQualitySensorAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/BaseAccessory.js +16 -95
- package/dist/shared/accessory/BaseAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/BlindsAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/CameraAccessory.js +2 -2
- package/dist/shared/accessory/CameraAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/CarbonDioxideSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/CarbonMonoxideSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/ContactSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/DehumidifierAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/DiffuserAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/DimmerAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/DoorbellAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/ExtractionHoodAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/FanAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/GarageDoorAccessory.js +19 -2
- package/dist/shared/accessory/GarageDoorAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/HeaterAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/HeaterAccessory_old.js.map +1 -1
- package/dist/shared/accessory/HumanPresenceSensorAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/HumidifierAccessory.js.map +1 -1
- package/dist/shared/accessory/IRAdapter.js +167 -0
- package/dist/shared/accessory/IRAdapter.js.map +1 -0
- package/dist/shared/accessory/IRAirConditionerAccessory.js.map +1 -0
- package/dist/shared/accessory/IRControlHubAccessory.js.map +1 -0
- package/dist/shared/accessory/IRControlHubSubAccessory.js.map +1 -0
- package/dist/shared/accessory/IRFanAccessory.js +90 -0
- package/dist/shared/accessory/IRFanAccessory.js.map +1 -0
- package/dist/shared/accessory/IRGenericAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/LeakSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/LightAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/LightSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/LocationWeatherAccessory.js +1 -1
- package/dist/shared/accessory/LocationWeatherAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/LockAccessory.js +3 -3
- package/dist/shared/{accessories → accessory}/LockAccessory.js.map +1 -1
- package/dist/shared/accessory/MotionSensorAccessory.js.map +1 -0
- package/dist/shared/accessory/OutletAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/PetFeederAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/SceneAccessory.js +1 -1
- package/dist/shared/accessory/SceneAccessory.js.map +1 -0
- package/dist/shared/accessory/SceneSwitchAccessory.js.map +1 -0
- package/dist/shared/accessory/SecuritySystemAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/SmokeSensorAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/SwitchAccessory.js +1 -45
- package/dist/shared/accessory/SwitchAccessory.js.map +1 -0
- package/dist/shared/accessory/TemperatureHumiditySensorAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/ThermostatAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/TowerRackAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/ValveAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/VibrationSensorAccessory.js.map +1 -1
- package/dist/shared/accessory/WeatherStationAccessory.js.map +1 -0
- package/dist/shared/accessory/WetBulbGlobeTemperatureAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/WhiteNoiseLightAccessory.js +1 -0
- package/dist/shared/accessory/WhiteNoiseLightAccessory.js.map +1 -0
- package/dist/shared/accessory/WindowAccessory.js.map +1 -0
- package/dist/shared/{accessories → accessory}/WindowCoveringAccessory.js.map +1 -1
- package/dist/shared/{accessories → accessory}/WirelessSwitchAccessory.js.map +1 -1
- package/dist/shared/accessory/characteristic/Active.js.map +1 -0
- package/dist/shared/accessory/characteristic/AirQuality.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/CurrentRelativeHumidity.js +3 -0
- package/dist/shared/accessory/characteristic/CurrentRelativeHumidity.js.map +1 -0
- package/dist/shared/accessory/characteristic/CurrentTemperature.js.map +1 -0
- package/dist/shared/accessory/characteristic/CurrentWeather.js.map +1 -0
- package/dist/shared/accessory/characteristic/CurrentWeatherByOpenMeteo.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/CurrentWetBulbGlobeTemperature.js +3 -2
- package/dist/shared/accessory/characteristic/CurrentWetBulbGlobeTemperature.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/EnergyUsage.js +0 -5
- package/dist/shared/accessory/characteristic/EnergyUsage.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/Light.js +28 -5
- package/dist/shared/accessory/characteristic/Light.js.map +1 -0
- package/dist/shared/accessory/characteristic/LightSensor.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/LockPhysicalControls.js +3 -0
- package/dist/shared/accessory/characteristic/LockPhysicalControls.js.map +1 -0
- package/dist/shared/accessory/characteristic/MotionDetected.js.map +1 -0
- package/dist/shared/accessory/characteristic/Name.js.map +1 -0
- package/dist/shared/accessory/characteristic/OccupancyDetected.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/On.js +1 -0
- package/dist/shared/accessory/characteristic/On.js.map +1 -0
- package/dist/shared/accessory/characteristic/OutletInUse.js.map +1 -0
- package/dist/shared/accessory/characteristic/ProgrammableSwitchEvent.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/RelativeHumidityDehumidifierThreshold.js +3 -0
- package/dist/shared/accessory/characteristic/RelativeHumidityDehumidifierThreshold.js.map +1 -0
- package/dist/shared/accessory/characteristic/RotationSpeed.js.map +1 -0
- package/dist/shared/accessory/characteristic/SecuritySystemState.js.map +1 -0
- package/dist/shared/{accessories → accessory}/characteristic/SwingMode.js +3 -0
- package/dist/shared/accessory/characteristic/SwingMode.js.map +1 -0
- package/dist/shared/accessory/characteristic/TargetTemperature.js.map +1 -0
- package/dist/shared/accessory/characteristic/TemperatureDisplayUnits.js.map +1 -0
- package/dist/shared/util/ConfigHash.js +2 -2
- package/dist/shared/util/ConfigHash.js.map +1 -1
- package/dist/shared/util/ConfigMigrator.js +222 -0
- package/dist/shared/util/ConfigMigrator.js.map +1 -0
- package/dist/shared/util/FfmpegStreamingProcess.js +62 -0
- package/dist/shared/util/FfmpegStreamingProcess.js.map +1 -1
- package/dist/shared/util/InfraredTool.js +0 -2
- package/dist/shared/util/InfraredTool.js.map +1 -1
- package/dist/shared/util/Logger.js +85 -10
- package/dist/shared/util/Logger.js.map +1 -1
- package/dist/shared/util/TuyaStreamDelegate.js +194 -97
- package/dist/shared/util/TuyaStreamDelegate.js.map +1 -1
- package/dist/shared/util/util.js +59 -4
- package/dist/shared/util/util.js.map +1 -1
- package/docs/ADVANCED_OPTIONS.md +603 -0
- package/docs/CONFIG_GUIDE.md +616 -0
- package/docs/Get-Local-Keys-for-Your-Devices.md +246 -0
- package/{SUPPORTED_DEVICES.md → docs/SUPPORTED_DEVICES.md} +24 -3
- package/eslint.config.mjs +0 -1
- package/{jest.config.js → jest.config.ts} +5 -2
- package/package.json +12 -9
- package/test/ConfigMigrator.test.ts +1060 -0
- package/test/Logger.test.ts +482 -0
- package/test/accessoryFactory.data.test.ts +172 -0
- package/test/accessoryFactory.test.ts +64 -35
- package/test/airConditioner.test.ts +742 -0
- package/test/config.test.ts +17 -13
- package/test/custom.test.ts +2 -2
- package/test/errorHandling.test.ts +12 -12
- package/test/home.test.ts +1 -1
- package/test/hybridDeviceManager.test.ts +808 -0
- package/test/light.test.ts +250 -0
- package/test/localDevice.test.ts +21 -50
- package/test/localDeviceManager.behavior.test.ts +196 -31
- package/test/localDeviceManager.test.ts +124 -41
- package/test/mqttMessages.test.ts +33 -14
- package/test/platform.test.ts +337 -814
- package/test/platform.validation.local.test.ts +58 -119
- package/test/tuyaCustomDeviceManager.test.ts +106 -16
- package/test/tuyaDeviceManager.test.ts +636 -639
- package/test/tuyaDiscovery.test.ts +21 -33
- package/test/tuyaHomeDeviceManager.test.ts +109 -18
- package/test/tuyaOpenAPI.test.ts +25 -44
- package/test/tuyaOpenMQ.test.ts +15 -23
- package/test/util.test.ts +107 -7
- package/test/zigbee/LocalDevice.zigbee.test.ts +14 -18
- package/test/zigbee/LocalDeviceManager.cloud-discovery.test.ts +19 -20
- package/test/zigbee/LocalDeviceManager.zigbee.reconnect.test.ts +19 -20
- package/test/zigbee/LocalDeviceManager.zigbee.test.ts +73 -35
- package/test/zigbee/ZigbeeGatewayDetection.test.ts +2 -2
- package/ADVANCED_OPTIONS.md +0 -267
- package/dist/cloud/device/TuyaDeviceManager.js.map +0 -1
- package/dist/local/CloudLocalReconciliation.js +0 -180
- package/dist/local/CloudLocalReconciliation.js.map +0 -1
- package/dist/shared/AccessoryFactory.js +0 -276
- package/dist/shared/AccessoryFactory.js.map +0 -1
- package/dist/shared/accessories/AccessoryFactory.js +0 -305
- package/dist/shared/accessories/AccessoryFactory.js.map +0 -1
- package/dist/shared/accessories/AirConditionerAccessory.js.map +0 -1
- package/dist/shared/accessories/AirQualitySensorAccessory.js.map +0 -1
- package/dist/shared/accessories/BaseAccessory.js.map +0 -1
- package/dist/shared/accessories/CameraAccessory.js.map +0 -1
- package/dist/shared/accessories/GarageDoorAccessory.js.map +0 -1
- package/dist/shared/accessories/HumanPresenceSensorAccessory.js.map +0 -1
- package/dist/shared/accessories/IRAirConditionerAccessory.js.map +0 -1
- package/dist/shared/accessories/IRControlHubAccessory.js.map +0 -1
- package/dist/shared/accessories/IRControlHubSubAccessory.js.map +0 -1
- package/dist/shared/accessories/IRGenericAccessory.js.map +0 -1
- package/dist/shared/accessories/LocationWeatherAccessory.js.map +0 -1
- package/dist/shared/accessories/MotionSensorAccessory.js.map +0 -1
- package/dist/shared/accessories/OutletAccessory.js.map +0 -1
- package/dist/shared/accessories/SceneAccessory.js.map +0 -1
- package/dist/shared/accessories/SceneSwitchAccessory.js.map +0 -1
- package/dist/shared/accessories/SecuritySystemAccessory.js.map +0 -1
- package/dist/shared/accessories/SwitchAccessory.js.map +0 -1
- package/dist/shared/accessories/TemperatureHumiditySensorAccessory.js.map +0 -1
- package/dist/shared/accessories/WeatherStationAccessory.js.map +0 -1
- package/dist/shared/accessories/WetBulbGlobeTemperatureAccessory.js.map +0 -1
- package/dist/shared/accessories/WhiteNoiseLightAccessory.js.map +0 -1
- package/dist/shared/accessories/WindowAccessory.js.map +0 -1
- package/dist/shared/accessories/characteristic/Active.js.map +0 -1
- package/dist/shared/accessories/characteristic/AirQuality.js.map +0 -1
- package/dist/shared/accessories/characteristic/CurrentRelativeHumidity.js.map +0 -1
- package/dist/shared/accessories/characteristic/CurrentTemperature.js.map +0 -1
- package/dist/shared/accessories/characteristic/CurrentWeather.js.map +0 -1
- package/dist/shared/accessories/characteristic/CurrentWeatherByOpenMeteo.js.map +0 -1
- package/dist/shared/accessories/characteristic/CurrentWetBulbGlobeTemperature.js.map +0 -1
- package/dist/shared/accessories/characteristic/EnergyUsage.js.map +0 -1
- package/dist/shared/accessories/characteristic/Light.js.map +0 -1
- package/dist/shared/accessories/characteristic/LightSensor.js.map +0 -1
- package/dist/shared/accessories/characteristic/LockPhysicalControls.js.map +0 -1
- package/dist/shared/accessories/characteristic/MotionDetected.js.map +0 -1
- package/dist/shared/accessories/characteristic/Name.js.map +0 -1
- package/dist/shared/accessories/characteristic/OccupancyDetected.js.map +0 -1
- package/dist/shared/accessories/characteristic/On.js.map +0 -1
- package/dist/shared/accessories/characteristic/OutletInUse.js.map +0 -1
- package/dist/shared/accessories/characteristic/ProgrammableSwitchEvent.js.map +0 -1
- package/dist/shared/accessories/characteristic/RelativeHumidityDehumidifierThreshold.js.map +0 -1
- package/dist/shared/accessories/characteristic/RotationSpeed.js.map +0 -1
- package/dist/shared/accessories/characteristic/SecuritySystemState.js.map +0 -1
- package/dist/shared/accessories/characteristic/SwingMode.js.map +0 -1
- package/dist/shared/accessories/characteristic/TargetTemperature.js.map +0 -1
- package/dist/shared/accessories/characteristic/TemperatureDisplayUnits.js.map +0 -1
- package/test/zigbee/CloudLocalReconciliation.test.ts +0 -284
- package/tuya-local-configs/dev-1.hash +0 -1
- package/tuya-local-configs/device1.hash +0 -1
- package/wiki/Get-Local-Keys-for-Your-Devices.md +0 -85
- /package/dist/shared/{accessories → accessory}/AirPurifierAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/AirQualitySensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/BlindsAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/CarbonDioxideSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/CarbonMonoxideSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/ContactSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/DehumidifierAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/DiffuserAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/DimmerAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/DoorbellAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/ExtractionHoodAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/FanAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/HeaterAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/HeaterAccessory_old.js +0 -0
- /package/dist/shared/{accessories → accessory}/HumanPresenceSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/HumidifierAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/IRAirConditionerAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/IRControlHubAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/IRControlHubSubAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/IRGenericAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/LeakSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/LightAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/LightSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/MotionSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/OutletAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/PetFeederAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/SceneSwitchAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/SecuritySystemAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/SmokeSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/TemperatureHumiditySensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/ThermostatAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/TowerRackAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/ValveAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/VibrationSensorAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/WeatherStationAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/WetBulbGlobeTemperatureAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/WindowAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/WindowCoveringAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/WirelessSwitchAccessory.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/Active.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/AirQuality.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/CurrentTemperature.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/CurrentWeather.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/CurrentWeatherByOpenMeteo.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/LightSensor.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/MotionDetected.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/Name.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/OccupancyDetected.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/OutletInUse.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/ProgrammableSwitchEvent.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/RotationSpeed.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/SecuritySystemState.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/TargetTemperature.js +0 -0
- /package/dist/shared/{accessories → accessory}/characteristic/TemperatureDisplayUnits.js +0 -0
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# @homebridge-plugins/homebridge-tuya
|
|
2
2
|
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
3
5
|
[](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)
|
|
4
6
|
|
|
5
7
|

|
|
6
|
-

|
|
7
9
|
|
|
8
10
|
[](https://github.com/sponsors/tassy-h)
|
|
9
11
|
[](https://npmjs.com/package/@homebridge-plugins/homebridge-tuya)
|
|
@@ -12,106 +14,77 @@
|
|
|
12
14
|
[](https://github.com/homebridge-plugins/homebridge-tuya/blob/main/LICENSE)
|
|
13
15
|
[](https://github.com/homebridge-plugins/homebridge-tuya/actions/workflows/build.yml)
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
**A unified Homebridge plugin for Tuya smart devices**
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Supports **Tuya Cloud** (REST/MQTT) and **Tuya Local** (direct LAN/TCP) communication — or both simultaneously.
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
</div>
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
- Optimized and improved code for better readability and maintainability.
|
|
23
|
-
- Enhanced stability and reduced API errors.
|
|
24
|
-
- Local LAN communication using the Tuya local protocol (v3.1–v3.5), no cloud connection required.
|
|
25
|
-
- Automatic UDP device discovery on the local network.
|
|
26
|
-
- Supports Tuya Scenes (Tap-to-Run) in Cloud mode.
|
|
27
|
-
- Device configuration overrides for non-standard DPs.
|
|
28
|
-
- Supports 60+ device categories including lights, switches, sensors, cameras, locks, IR remotes, and more.
|
|
23
|
+
---
|
|
29
24
|
|
|
25
|
+
## Overview
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
See [SUPPORTED_DEVICES.md](./SUPPORTED_DEVICES.md)
|
|
27
|
+
This plugin integrates Tuya smart home devices with Apple HomeKit through Homebridge. Choose your connection method based on your needs:
|
|
33
28
|
|
|
29
|
+
| Mode | Features | Requirements |
|
|
30
|
+
|------|----------|--------------|
|
|
31
|
+
| **Cloud** | Full features, remote access, scenes, automations | Tuya IoT account, internet |
|
|
32
|
+
| **Local** | Fast response, no cloud dependency, privacy-focused | Devices & Homebridge on same network |
|
|
33
|
+
| **Both** | Best of both worlds — local-first with cloud fallback | Both configurations |
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
See [CHANGELOG.md](./CHANGELOG.md)
|
|
35
|
+
**Supports 60+ device categories**: Lights, switches, sockets, outlets, fans, air conditioners, thermostats, door locks, cameras, sensors, garage doors, curtains, and more.
|
|
37
36
|
|
|
37
|
+
---
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Quick Features
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
✅ **Three connection modes** — Cloud, Local, or Both simultaneously
|
|
42
|
+
✅ **60+ device categories** — Comprehensive device support
|
|
43
|
+
✅ **Automatic discovery** — UDP broadcast discovery for local devices
|
|
44
|
+
✅ **Tuya Scenes** — Support for Tap-to-Run scenes in Cloud mode
|
|
45
|
+
✅ **Protocol support** — Tuya local protocol v3.1–v3.5
|
|
46
|
+
✅ **Device overrides** — Custom schema mapping for non-standard devices
|
|
47
|
+
✅ **Adaptive Lighting** — Supported on compatible light accessories
|
|
48
|
+
✅ **Enhanced stability** — Optimized code, reduced API errors
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
npm install @homebridge-plugins/homebridge-tuya
|
|
47
|
-
```
|
|
50
|
+
---
|
|
48
51
|
|
|
52
|
+
## Installation
|
|
49
53
|
|
|
50
|
-
|
|
54
|
+
### Homebridge Web UI (Recommended)
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
1. Open Homebridge UI
|
|
57
|
+
2. Go to **Plugins** page
|
|
58
|
+
3. Search for `@homebridge-plugins/homebridge-tuya`
|
|
59
|
+
4. Click **Install**
|
|
60
|
+
5. Configure using the Settings UI
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
### Command Line
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
| `local` | Connect directly over LAN — no cloud needed |
|
|
60
|
-
| `both` | Cloud + Local simultaneously |
|
|
64
|
+
```bash
|
|
65
|
+
npm install @homebridge-plugins/homebridge-tuya
|
|
66
|
+
```
|
|
61
67
|
|
|
62
68
|
---
|
|
63
69
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Requires a [Tuya IoT Platform](https://iot.tuya.com) account and cloud project:
|
|
70
|
+
## Getting Started
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
2. On the Project Page > Devices Panel > Link Tuya App Account, link your Tuya app account.
|
|
70
|
-
3. On the Project Page > Service API > Go to Authorize, subscribe to:
|
|
71
|
-
- Authorization Token Management
|
|
72
|
-
- Device Status Notification
|
|
73
|
-
- IoT Core
|
|
74
|
-
- IoT Video Live Stream *(for cameras)*
|
|
75
|
-
- Industry Project Client Service *(Custom project only)*
|
|
76
|
-
- IR Control Hub Open Service *(for IR devices)*
|
|
77
|
-
- Smart Home Scene Linkage *(for scenes)*
|
|
78
|
-
- Smart Lock Open Service *(for locks)*
|
|
79
|
-
4. **⚠️ Extend the API trial every 6 months** at [IoT Core Cloud Services](https://iot.tuya.com/cloud/products/detail?abilityId=1442730014117204014&id=p1668587814138nv4h3n&abilityAuth=0&tab=1).
|
|
72
|
+
### Step 1: Choose Your Connection Mode
|
|
80
73
|
|
|
81
|
-
|
|
74
|
+
Decide between **Cloud**, **Local**, or **Both**:
|
|
82
75
|
|
|
83
|
-
|
|
76
|
+
- **Cloud only**: Easiest setup, works remotely, but relies on internet
|
|
77
|
+
- **Local only**: Fastest response, no cloud dependency, but limited features
|
|
78
|
+
- **Both**: Recommended — local commands first, cloud as fallback
|
|
84
79
|
|
|
85
|
-
|
|
86
|
-
|-------|----------|-------------|
|
|
87
|
-
| `options.projectType` | ✅ | `"1"` |
|
|
88
|
-
| `options.endpoint` | ✅ | Endpoint URL from [API Reference > Endpoints](https://developer.tuya.com/en/docs/iot/api-request?id=Ka4a8uuo1j4t4#title-1-Endpoints) |
|
|
89
|
-
| `options.accessId` | ✅ | Access ID from [Tuya IoT Platform](https://iot.tuya.com/cloud) |
|
|
90
|
-
| `options.accessKey` | ✅ | Access Secret from [Tuya IoT Platform](https://iot.tuya.com/cloud) |
|
|
91
|
-
| `options.debug` | ➖ | Enable debug logging (default: `false`) |
|
|
92
|
-
| `options.debugLevel` | ➖ | Comma-separated log filter: `api`, `mqtt`, or a device ID |
|
|
80
|
+
### Step 2: Configuration
|
|
93
81
|
|
|
94
|
-
|
|
82
|
+
Configuration uses the Homebridge Web UI or `config.json`. See [Configuration Guide](./docs/CONFIG_GUIDE.md) for detailed setup instructions.
|
|
95
83
|
|
|
96
|
-
|
|
97
|
-
|-------|----------|-------------|
|
|
98
|
-
| `options.projectType` | ✅ | `"2"` |
|
|
99
|
-
| `options.accessId` | ✅ | Access ID |
|
|
100
|
-
| `options.accessKey` | ✅ | Access Secret |
|
|
101
|
-
| `options.countryCode` | ✅ | Country code of your app account's region |
|
|
102
|
-
| `options.username` | ✅ | Tuya/Smart Life app username |
|
|
103
|
-
| `options.password` | ✅ | App password (MD5 salted hash also accepted) |
|
|
104
|
-
| `options.appSchema` | ✅ | `"tuyaSmart"` or `"smartlife"` |
|
|
105
|
-
| `options.endpoint` | ➖ | Override endpoint (auto-detected from countryCode) |
|
|
106
|
-
| `options.homeWhitelist` | ➖ | Array of Home IDs to include; blank = all homes |
|
|
107
|
-
| `options.debug` | ➖ | Enable debug logging (default: `false`) |
|
|
108
|
-
| `options.debugLevel` | ➖ | Comma-separated log filter |
|
|
109
|
-
|
|
110
|
-
**Example cloud config:**
|
|
84
|
+
**Quick example (Cloud mode):**
|
|
111
85
|
```json
|
|
112
86
|
{
|
|
113
87
|
"platform": "TuyaPlatform",
|
|
114
|
-
"name": "Tuya",
|
|
115
88
|
"mode": "cloud",
|
|
116
89
|
"options": {
|
|
117
90
|
"projectType": "2",
|
|
@@ -125,112 +98,351 @@ There are two project types:
|
|
|
125
98
|
}
|
|
126
99
|
```
|
|
127
100
|
|
|
101
|
+
**Quick example (Local mode):**
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"platform": "TuyaPlatform",
|
|
105
|
+
"mode": "local",
|
|
106
|
+
"local": {
|
|
107
|
+
"autoDiscoverDevices": true,
|
|
108
|
+
"discoverTimeout": 5
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
128
113
|
---
|
|
129
114
|
|
|
130
|
-
|
|
115
|
+
## Configuration Modes
|
|
116
|
+
|
|
117
|
+
### Cloud Mode
|
|
131
118
|
|
|
132
|
-
|
|
119
|
+
Connect via Tuya Cloud API with full feature support.
|
|
133
120
|
|
|
134
121
|
**Requirements:**
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
122
|
+
- Tuya IoT Platform account
|
|
123
|
+
- Cloud project setup
|
|
124
|
+
- API credentials
|
|
125
|
+
- Subscription to required services
|
|
126
|
+
|
|
127
|
+
**See:** [Cloud Setup Guide](./docs/CONFIG_GUIDE.md#cloud-setup)
|
|
128
|
+
|
|
129
|
+
### Local Mode
|
|
130
|
+
|
|
131
|
+
Direct LAN communication without cloud dependency — faster and more private.
|
|
132
|
+
|
|
133
|
+
**Requirements:**
|
|
134
|
+
- Devices and Homebridge on same network
|
|
135
|
+
- Device local keys
|
|
136
|
+
- UDP broadcast enabled on network
|
|
137
|
+
|
|
138
|
+
**See:** [Local Setup Guide](./docs/CONFIG_GUIDE.md#local-setup) and [Get Local Keys](./docs/Get-Local-Keys-for-Your-Devices.md)
|
|
139
|
+
|
|
140
|
+
### Both Mode
|
|
141
|
+
|
|
142
|
+
Hybrid mode using local commands with cloud fallback for reliability.
|
|
143
|
+
|
|
144
|
+
**See:** [Both Mode Setup](./docs/CONFIG_GUIDE.md#both-mode)
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
| Document | Purpose |
|
|
151
|
+
|----------|---------|
|
|
152
|
+
| [CONFIG_GUIDE.md](./docs/CONFIG_GUIDE.md) | **Detailed configuration reference** — all options explained |
|
|
153
|
+
| [ADVANCED_OPTIONS.md](./docs/ADVANCED_OPTIONS.md) | Device schema overrides, non-standard DPs, custom mappings |
|
|
154
|
+
| [SUPPORTED_DEVICES.md](./docs/SUPPORTED_DEVICES.md) | Complete list of 60+ supported device categories |
|
|
155
|
+
| [Get Local Keys](./docs/Get-Local-Keys-for-Your-Devices.md) | Step-by-step guide to retrieve device local keys |
|
|
156
|
+
| [CHANGELOG.md](./CHANGELOG.md) | Version history and updates |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Supported Devices
|
|
161
|
+
|
|
162
|
+
This plugin supports **60+ device categories** from Tuya's ecosystem:
|
|
163
|
+
|
|
164
|
+
**Lighting:** Lights, ceiling lights, string lights, strip lights, dimmers, motion sensor lights, solar lights, and more
|
|
165
|
+
**Electrical:** Switches, sockets, power strips, curtain switches, dimmer switches, fan switches, wireless switches
|
|
166
|
+
**Climate:** Air conditioners, heaters, thermostats, humidifiers, dehumidifiers
|
|
167
|
+
**Security:** Door locks, door/window sensors, motion sensors, smoke detectors, CO detectors
|
|
168
|
+
**Cameras & Sensors:** Video cameras (with RTSP streaming), temperature/humidity sensors, air quality sensors
|
|
169
|
+
**Other:** IR controllers, garage door openers, fans, robot vacuums, and more
|
|
170
|
+
|
|
171
|
+
**For a complete list:** See [SUPPORTED_DEVICES.md](./docs/SUPPORTED_DEVICES.md)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Troubleshooting
|
|
175
|
+
|
|
176
|
+
### Common Issues
|
|
177
|
+
|
|
178
|
+
#### 1. Authentication Errors (`1106`, `2406`)
|
|
179
|
+
|
|
180
|
+
If you receive these error codes in Cloud mode:
|
|
181
|
+
|
|
182
|
+
1. Open the Tuya app → **Me** → **Settings** → **Network Diagnosis**
|
|
183
|
+
2. Start diagnosis and upload logs
|
|
184
|
+
3. Find the line starting with `Region code:`:
|
|
185
|
+
- `AY` = China
|
|
186
|
+
- `AZ` = West US
|
|
187
|
+
- `EU` = Central Europe
|
|
188
|
+
- `IN` = India
|
|
189
|
+
4. Manually set `options.endpoint` in your config with the correct region endpoint
|
|
190
|
+
|
|
191
|
+
**For help finding your endpoint:** [Tuya API Endpoints](https://developer.tuya.com/en/docs/iot/api-request?id=Ka4a8uuo1j4t4#title-1-Endpoints)
|
|
192
|
+
|
|
193
|
+
#### 2. Device Not Showing Up
|
|
194
|
+
|
|
195
|
+
**In Cloud mode:**
|
|
196
|
+
- Verify the device is added to your Tuya app
|
|
197
|
+
- Confirm the device category is in the [supported list](./docs/SUPPORTED_DEVICES.md)
|
|
198
|
+
- Check that required APIs are subscribed on your cloud project
|
|
199
|
+
|
|
200
|
+
**In Local mode:**
|
|
201
|
+
- Ensure Homebridge and devices are on the **same network**
|
|
202
|
+
- Disable any network isolation or guest network features
|
|
203
|
+
- Enable UDP broadcast on your router/network
|
|
204
|
+
- Manually add the device with its local key if auto-discovery fails
|
|
205
|
+
|
|
206
|
+
**For both modes:**
|
|
207
|
+
- Check HomeKit accessory cache: `rm -rf ~/.homebridge/persist/AccessoryInfo.${RANDOM}.json`
|
|
208
|
+
- Review logs with `debug: true` enabled
|
|
209
|
+
|
|
210
|
+
#### 3. Non-Standard Device Properties
|
|
211
|
+
|
|
212
|
+
Some devices have non-standard Data Points (DPs) that don't map to the standard schema.
|
|
213
|
+
|
|
214
|
+
**Solution:** Use device schema overrides. See [ADVANCED_OPTIONS.md](./docs/ADVANCED_OPTIONS.md) for examples.
|
|
215
|
+
|
|
216
|
+
**Steps:**
|
|
217
|
+
1. Enable debug mode and operate the device
|
|
218
|
+
2. Find `TuyaDeviceList.{uid}.json` path from logs
|
|
219
|
+
3. Identify the non-standard DP codes
|
|
220
|
+
4. Add a `deviceOverrides` entry with custom schema mappings
|
|
221
|
+
|
|
222
|
+
#### 4. Local Connection Not Working
|
|
223
|
+
|
|
224
|
+
**Check:**
|
|
225
|
+
- ✅ Homebridge can ping device: `ping <device_ip>`
|
|
226
|
+
- ✅ Device local key is correct (16 characters)
|
|
227
|
+
- ✅ Device protocol version is correct (try auto-detect first)
|
|
228
|
+
- ✅ UDP port 6666 is open (used for discovery)
|
|
229
|
+
- ✅ Network firewall allows local communication
|
|
230
|
+
|
|
231
|
+
#### 5. Cloud API Trial Expired
|
|
232
|
+
|
|
233
|
+
**⚠️ Important:** Tuya IoT Platform API trials expire every 6 months.
|
|
234
|
+
|
|
235
|
+
**To renew:**
|
|
236
|
+
1. Log in to [Tuya IoT Platform](https://iot.tuya.com)
|
|
237
|
+
2. Go to **Cloud** → **API** → **IoT Core Cloud Services**
|
|
238
|
+
3. Click **Extend** to renew trial
|
|
239
|
+
4. **Set a calendar reminder** for 6 months later
|
|
240
|
+
|
|
241
|
+
**Without renewal,** your plugin will stop working after expiration.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Debug & Support
|
|
246
|
+
|
|
247
|
+
### Enable Debug Logging
|
|
248
|
+
|
|
249
|
+
Add to your config:
|
|
151
250
|
```json
|
|
152
251
|
{
|
|
153
252
|
"platform": "TuyaPlatform",
|
|
154
|
-
"
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"autoDiscoverDevices": true,
|
|
158
|
-
"discoverTimeout": 5,
|
|
159
|
-
"devices": [
|
|
160
|
-
{
|
|
161
|
-
"tuyaDeviceId": "abcdef1234567890",
|
|
162
|
-
"tuyaKey": "0123456789abcdef",
|
|
163
|
-
"ip": "192.168.1.100",
|
|
164
|
-
"name": "Living Room Light",
|
|
165
|
-
"category": "light"
|
|
166
|
-
}
|
|
167
|
-
]
|
|
253
|
+
"options": {
|
|
254
|
+
"debug": true,
|
|
255
|
+
"debugLevel": "api,mqtt"
|
|
168
256
|
}
|
|
169
257
|
}
|
|
170
258
|
```
|
|
171
259
|
|
|
260
|
+
**Debug levels:**
|
|
261
|
+
- `api` — API call logs
|
|
262
|
+
- `mqtt` — MQTT connection logs
|
|
263
|
+
- `{device_id}` — Specific device logs
|
|
264
|
+
|
|
265
|
+
### Getting Device Information
|
|
266
|
+
|
|
267
|
+
After a successful connection, the cloud device list is saved at the path shown in Homebridge logs:
|
|
268
|
+
```
|
|
269
|
+
[TuyaPlatform] Device list saved at /path/to/TuyaDeviceList.{uid}.json
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**⚠️ Warning:** Remove sensitive fields (`ip`, `lon`, `lat`, `local_key`) before sharing logs.
|
|
273
|
+
|
|
274
|
+
### Reporting Issues
|
|
275
|
+
|
|
276
|
+
When reporting issues, include:
|
|
277
|
+
1. Plugin version (`npm list @homebridge-plugins/homebridge-tuya`)
|
|
278
|
+
2. Homebridge version and Node version
|
|
279
|
+
3. Device category and model
|
|
280
|
+
4. Relevant debug logs (without sensitive data)
|
|
281
|
+
5. Steps to reproduce
|
|
282
|
+
|
|
283
|
+
**GitHub Issues:** [Create an issue](https://github.com/homebridge-plugins/homebridge-tuya/issues)
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## FAQ
|
|
288
|
+
|
|
289
|
+
### Connection Modes
|
|
290
|
+
|
|
291
|
+
**Q: Which mode should I use?**
|
|
292
|
+
|
|
293
|
+
- **Cloud only:** Simple setup, works remotely, but slower
|
|
294
|
+
- **Local only:** Fastest, most private, but limited features
|
|
295
|
+
- **Both (recommended):** Local commands first, cloud fallback for reliability
|
|
296
|
+
|
|
297
|
+
**Q: Can I switch modes later?**
|
|
298
|
+
|
|
299
|
+
Yes. Update the `mode` setting in your config and restart Homebridge.
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### About Devices
|
|
304
|
+
|
|
305
|
+
**Q: What devices does this plugin support?**
|
|
306
|
+
|
|
307
|
+
This plugin supports 60+ Tuya device categories. See [SUPPORTED_DEVICES.md](./docs/SUPPORTED_DEVICES.md) for the complete list.
|
|
308
|
+
|
|
309
|
+
**Q: My device isn't showing up. What do I do?**
|
|
310
|
+
|
|
311
|
+
See [Troubleshooting → Device Not Showing Up](#2-device-not-showing-up).
|
|
312
|
+
|
|
313
|
+
**Q: Can I customize how my device appears in HomeKit?**
|
|
314
|
+
|
|
315
|
+
Yes. Use device overrides to:
|
|
316
|
+
- Change category type
|
|
317
|
+
- Map non-standard DPs to standard ones
|
|
318
|
+
- Hide specific device properties
|
|
319
|
+
- Enable Adaptive Lighting
|
|
320
|
+
- And more
|
|
321
|
+
|
|
322
|
+
See [ADVANCED_OPTIONS.md](./docs/ADVANCED_OPTIONS.md) for examples.
|
|
323
|
+
|
|
172
324
|
---
|
|
173
325
|
|
|
174
|
-
###
|
|
326
|
+
### About Tuya Account
|
|
327
|
+
|
|
328
|
+
**Q: Do I need a Tuya IoT account for Cloud mode?**
|
|
329
|
+
|
|
330
|
+
Yes. You need to create a free trial project on [Tuya IoT Platform](https://iot.tuya.com).
|
|
331
|
+
|
|
332
|
+
**Q: How do I get my local keys?**
|
|
333
|
+
|
|
334
|
+
Follow the step-by-step guide: [Get Local Keys for Your Devices](./docs/Get-Local-Keys-for-Your-Devices.md)
|
|
335
|
+
|
|
336
|
+
**Q: Can I use the same Tuya account for multiple Homebridge instances?**
|
|
337
|
+
|
|
338
|
+
Not recommended. Use separate Tuya app accounts per Homebridge instance to avoid conflicts.
|
|
175
339
|
|
|
176
|
-
Uses cloud + local simultaneously. Provide both `options` (cloud) and `local` blocks.
|
|
177
|
-
- Local LAN commands are attempted first when the device is available locally.
|
|
178
|
-
- The cloud connection remains active as a fallback.
|
|
179
|
-
- This fallback is only used when a local command does not receive confirmation within 10 seconds; normal local commands remain local.
|
|
180
|
-
- If a local command does not receive confirmation within 10 seconds, the plugin automatically retries it via cloud.
|
|
181
|
-
- Cloud status updates can also satisfy pending local commands so the device does not get double-sent commands.
|
|
182
340
|
---
|
|
183
341
|
|
|
184
|
-
###
|
|
185
|
-
|
|
342
|
+
### About Performance
|
|
343
|
+
|
|
344
|
+
**Q: Why are local commands faster than cloud?**
|
|
345
|
+
|
|
346
|
+
Local commands communicate directly with your devices over LAN (typically <100ms), while cloud commands go through Tuya's servers (typically >1 second).
|
|
186
347
|
|
|
348
|
+
**Q: Does the plugin consume a lot of bandwidth?**
|
|
349
|
+
|
|
350
|
+
No. In Local mode, it uses only local network traffic. In Cloud mode, it uses MQTT for efficient subscriptions and status updates.
|
|
351
|
+
|
|
352
|
+
---
|
|
187
353
|
|
|
188
354
|
## Limitations
|
|
189
|
-
- Using the same app account for multiple Homebridge/HomeAssistant instances is not recommended. Use separate app accounts per instance.
|
|
190
|
-
- **⚠️ Cloud API trial expires every 6 months** — set a calendar reminder to renew.
|
|
191
|
-
- Local mode requires devices and Homebridge to be on the same subnet.
|
|
192
355
|
|
|
356
|
+
- **Same app account recommendation:** Using the same Tuya account for multiple Homebridge/Home Assistant instances is not recommended. Create separate accounts.
|
|
357
|
+
- **Cloud API trial duration:** API trial must be renewed every 6 months.
|
|
358
|
+
- **Local network requirement:** Local mode requires devices and Homebridge on the same subnet.
|
|
359
|
+
- **Feature support variance:** Some features (Scenes, advanced automations) are only available in Cloud mode.
|
|
193
360
|
|
|
194
|
-
|
|
361
|
+
---
|
|
195
362
|
|
|
196
|
-
|
|
363
|
+
## Development
|
|
197
364
|
|
|
198
|
-
|
|
365
|
+
### Prerequisites
|
|
199
366
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
3. Find the line beginning with `Region code:`:
|
|
203
|
-
- `AY` = China, `AZ` = West US, `EU` = Central Europe, `IN` = India.
|
|
204
|
-
4. Manually set `options.endpoint` in your config.
|
|
367
|
+
- Node.js 20+ (or 22, 24, 25)
|
|
368
|
+
- npm 10+
|
|
205
369
|
|
|
206
|
-
|
|
370
|
+
### Build & Test
|
|
207
371
|
|
|
208
|
-
|
|
372
|
+
```bash
|
|
373
|
+
# Install dependencies
|
|
374
|
+
npm install
|
|
209
375
|
|
|
210
|
-
|
|
376
|
+
# Run linter
|
|
377
|
+
npm run lint
|
|
211
378
|
|
|
212
|
-
|
|
379
|
+
# Fix linting issues
|
|
380
|
+
npm run lint:fix
|
|
213
381
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
2. Click the pencil icon next to your product → select **DP Instruction** → save.
|
|
217
|
-
3. Add a `deviceOverrides` entry with schema mappings in the plugin config.
|
|
382
|
+
# Run tests
|
|
383
|
+
npm test
|
|
218
384
|
|
|
385
|
+
# Generate coverage report
|
|
386
|
+
npm run coverage
|
|
219
387
|
|
|
220
|
-
|
|
388
|
+
# Build for deployment
|
|
389
|
+
npm run build
|
|
390
|
+
|
|
391
|
+
# Watch mode (auto-rebuild on changes)
|
|
392
|
+
npm run watch
|
|
393
|
+
```
|
|
221
394
|
|
|
222
|
-
|
|
395
|
+
### Project Structure
|
|
223
396
|
|
|
224
|
-
After a successful start, the cloud device list is saved at the path shown in the Homebridge log:
|
|
225
397
|
```
|
|
226
|
-
|
|
398
|
+
src/
|
|
399
|
+
├── index.ts # Plugin entry point
|
|
400
|
+
├── platform.ts # Main platform class
|
|
401
|
+
├── config.ts # Config interfaces
|
|
402
|
+
├── settings.ts # Constants
|
|
403
|
+
├── cloud/ # Cloud/API logic
|
|
404
|
+
│ ├── api/ # Tuya API clients
|
|
405
|
+
│ └── device/ # Cloud device handling
|
|
406
|
+
├── local/ # Local/LAN logic
|
|
407
|
+
│ ├── protocol/ # Tuya local protocol
|
|
408
|
+
│ └── device/ # Local device handling
|
|
409
|
+
└── shared/ # Shared utilities
|
|
410
|
+
├── accessory/ # HomeKit accessory factories
|
|
411
|
+
└── util/ # Utilities
|
|
412
|
+
|
|
413
|
+
test/ # Test suite
|
|
414
|
+
docs/ # Documentation
|
|
227
415
|
```
|
|
228
|
-
**⚠️ Remove sensitive fields (`ip`, `lon`, `lat`, `local_key`, `uid`) before sharing.**
|
|
229
416
|
|
|
230
|
-
|
|
417
|
+
### Contributing
|
|
418
|
+
|
|
419
|
+
Contributions are welcome! Please:
|
|
420
|
+
|
|
421
|
+
1. Fork the repository
|
|
422
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
423
|
+
3. Make your changes and test thoroughly
|
|
424
|
+
4. Run `npm run lint:fix` and `npm test`
|
|
425
|
+
5. Commit with clear messages
|
|
426
|
+
6. Push to your branch
|
|
427
|
+
7. Open a Pull Request
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## License
|
|
432
|
+
|
|
433
|
+
MIT License — see [LICENSE](./LICENSE) file for details
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Support
|
|
231
438
|
|
|
232
|
-
|
|
439
|
+
- ⭐ Star this repo if you find it helpful
|
|
440
|
+
- 💖 [Sponsor the project](https://github.com/sponsors/tassy-h)
|
|
441
|
+
- 🐛 [Report issues](https://github.com/homebridge-plugins/homebridge-tuya/issues)
|
|
442
|
+
- 📖 [Documentation](./docs/CONFIG_GUIDE.md)
|
|
443
|
+
|
|
444
|
+
---
|
|
233
445
|
|
|
234
|
-
|
|
446
|
+
## Changelog
|
|
235
447
|
|
|
236
|
-
|
|
448
|
+
See [CHANGELOG.md](./CHANGELOG.md) for version history and release notes.
|