@homebridge-plugins/homebridge-tuya 3.0.0-beta.0 → 3.0.0-beta.2

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.
Files changed (341) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +166 -145
  3. package/config.schema.json +976 -11
  4. package/dist/{core → cloud/api}/TuyaOpenAPI.js +16 -7
  5. package/dist/cloud/api/TuyaOpenAPI.js.map +1 -0
  6. package/dist/{core → cloud/api}/TuyaOpenMQ.js +13 -11
  7. package/dist/cloud/api/TuyaOpenMQ.js.map +1 -0
  8. package/dist/cloud/device/TuyaCustomDeviceManager.js.map +1 -0
  9. package/dist/{device → cloud/device}/TuyaDevice.js +14 -1
  10. package/dist/cloud/device/TuyaDevice.js.map +1 -0
  11. package/dist/{device → cloud/device}/TuyaDeviceManager.js +12 -3
  12. package/dist/cloud/device/TuyaDeviceManager.js.map +1 -0
  13. package/dist/cloud/device/TuyaHomeDeviceManager.js.map +1 -0
  14. package/dist/config.js +1 -0
  15. package/dist/config.js.map +1 -1
  16. package/dist/local/CloudLocalReconciliation.js +180 -0
  17. package/dist/local/CloudLocalReconciliation.js.map +1 -0
  18. package/dist/local/DynamicChildDiscovery.js +154 -0
  19. package/dist/local/DynamicChildDiscovery.js.map +1 -0
  20. package/dist/local/LocalDevice.js +419 -0
  21. package/dist/local/LocalDevice.js.map +1 -0
  22. package/dist/local/LocalDeviceManager.js +981 -0
  23. package/dist/local/LocalDeviceManager.js.map +1 -0
  24. package/dist/local/TuyaDiscovery.js +248 -0
  25. package/dist/local/TuyaDiscovery.js.map +1 -0
  26. package/dist/local/ZigbeeEventDetection.js +213 -0
  27. package/dist/local/ZigbeeEventDetection.js.map +1 -0
  28. package/dist/local/ZigbeeGatewayDetection.js +109 -0
  29. package/dist/local/ZigbeeGatewayDetection.js.map +1 -0
  30. package/dist/local/config.js +6 -0
  31. package/dist/local/config.js.map +1 -0
  32. package/dist/local/protocol/ChildPayloadUtility.js +94 -0
  33. package/dist/local/protocol/ChildPayloadUtility.js.map +1 -0
  34. package/dist/local/protocol/Protocol.js +3 -0
  35. package/dist/local/protocol/Protocol.js.map +1 -0
  36. package/dist/local/protocol/ProtocolFactory.js +27 -0
  37. package/dist/local/protocol/ProtocolFactory.js.map +1 -0
  38. package/dist/local/protocol/ProtocolUtilities.js +329 -0
  39. package/dist/local/protocol/ProtocolUtilities.js.map +1 -0
  40. package/dist/local/protocol/ProtocolV31V32.js +60 -0
  41. package/dist/local/protocol/ProtocolV31V32.js.map +1 -0
  42. package/dist/local/protocol/ProtocolV33.js +52 -0
  43. package/dist/local/protocol/ProtocolV33.js.map +1 -0
  44. package/dist/local/protocol/ProtocolV34.js +104 -0
  45. package/dist/local/protocol/ProtocolV34.js.map +1 -0
  46. package/dist/local/protocol/ProtocolV35.js +77 -0
  47. package/dist/local/protocol/ProtocolV35.js.map +1 -0
  48. package/dist/platform.js +284 -67
  49. package/dist/platform.js.map +1 -1
  50. package/dist/shared/AccessoryFactory.js +276 -0
  51. package/dist/shared/AccessoryFactory.js.map +1 -0
  52. package/dist/{accessory → shared/accessories}/AccessoryFactory.js +2 -2
  53. package/dist/shared/accessories/AccessoryFactory.js.map +1 -0
  54. package/dist/shared/accessories/AirConditionerAccessory.js.map +1 -0
  55. package/dist/{accessory → shared/accessories}/AirPurifierAccessory.js +1 -1
  56. package/dist/shared/accessories/AirPurifierAccessory.js.map +1 -0
  57. package/dist/shared/accessories/AirQualitySensorAccessory.js.map +1 -0
  58. package/dist/{accessory → shared/accessories}/BaseAccessory.js +139 -35
  59. package/dist/shared/accessories/BaseAccessory.js.map +1 -0
  60. package/dist/shared/accessories/BlindsAccessory.js +199 -0
  61. package/dist/shared/accessories/BlindsAccessory.js.map +1 -0
  62. package/dist/{accessory → shared/accessories}/CameraAccessory.js +7 -3
  63. package/dist/shared/accessories/CameraAccessory.js.map +1 -0
  64. package/dist/shared/accessories/CarbonDioxideSensorAccessory.js.map +1 -0
  65. package/dist/shared/accessories/CarbonMonoxideSensorAccessory.js.map +1 -0
  66. package/dist/shared/accessories/ContactSensorAccessory.js.map +1 -0
  67. package/dist/shared/accessories/DehumidifierAccessory.js.map +1 -0
  68. package/dist/shared/accessories/DiffuserAccessory.js.map +1 -0
  69. package/dist/shared/accessories/DimmerAccessory.js.map +1 -0
  70. package/dist/{accessory → shared/accessories}/DoorbellAccessory.js +3 -1
  71. package/dist/shared/accessories/DoorbellAccessory.js.map +1 -0
  72. package/dist/{accessory → shared/accessories}/ExtractionHoodAccessory.js +4 -2
  73. package/dist/shared/accessories/ExtractionHoodAccessory.js.map +1 -0
  74. package/dist/{accessory → shared/accessories}/FanAccessory.js +10 -4
  75. package/dist/shared/accessories/FanAccessory.js.map +1 -0
  76. package/dist/shared/accessories/GarageDoorAccessory.js.map +1 -0
  77. package/dist/shared/accessories/HeaterAccessory.js.map +1 -0
  78. package/dist/shared/accessories/HeaterAccessory_old.js.map +1 -0
  79. package/dist/shared/accessories/HumanPresenceSensorAccessory.js.map +1 -0
  80. package/dist/{accessory → shared/accessories}/HumidifierAccessory.js +3 -1
  81. package/dist/shared/accessories/HumidifierAccessory.js.map +1 -0
  82. package/dist/{accessory → shared/accessories}/IRAirConditionerAccessory.js +2 -2
  83. package/dist/shared/accessories/IRAirConditionerAccessory.js.map +1 -0
  84. package/dist/shared/accessories/IRControlHubAccessory.js.map +1 -0
  85. package/dist/shared/accessories/IRControlHubSubAccessory.js.map +1 -0
  86. package/dist/shared/accessories/IRGenericAccessory.js.map +1 -0
  87. package/dist/shared/accessories/LeakSensorAccessory.js.map +1 -0
  88. package/dist/shared/accessories/LightAccessory.js.map +1 -0
  89. package/dist/shared/accessories/LightSensorAccessory.js.map +1 -0
  90. package/dist/shared/accessories/LocationWeatherAccessory.js.map +1 -0
  91. package/dist/shared/accessories/LockAccessory.js.map +1 -0
  92. package/dist/shared/accessories/MotionSensorAccessory.js.map +1 -0
  93. package/dist/shared/accessories/OutletAccessory.js.map +1 -0
  94. package/dist/shared/accessories/PetFeederAccessory.js.map +1 -0
  95. package/dist/shared/accessories/SceneAccessory.js.map +1 -0
  96. package/dist/{accessory → shared/accessories}/SceneSwitchAccessory.js +1 -1
  97. package/dist/shared/accessories/SceneSwitchAccessory.js.map +1 -0
  98. package/dist/shared/accessories/SecuritySystemAccessory.js.map +1 -0
  99. package/dist/shared/accessories/SmokeSensorAccessory.js.map +1 -0
  100. package/dist/shared/accessories/SwitchAccessory.js +148 -0
  101. package/dist/shared/accessories/SwitchAccessory.js.map +1 -0
  102. package/dist/shared/accessories/TemperatureHumiditySensorAccessory.js.map +1 -0
  103. package/dist/shared/accessories/ThermostatAccessory.js.map +1 -0
  104. package/dist/shared/accessories/TowerRackAccessory.js.map +1 -0
  105. package/dist/{accessory → shared/accessories}/ValveAccessory.js +1 -1
  106. package/dist/shared/accessories/ValveAccessory.js.map +1 -0
  107. package/dist/{accessory → shared/accessories}/VibrationSensorAccessory.js +7 -3
  108. package/dist/shared/accessories/VibrationSensorAccessory.js.map +1 -0
  109. package/dist/shared/accessories/WeatherStationAccessory.js.map +1 -0
  110. package/dist/shared/accessories/WetBulbGlobeTemperatureAccessory.js.map +1 -0
  111. package/dist/shared/accessories/WhiteNoiseLightAccessory.js.map +1 -0
  112. package/dist/shared/accessories/WindowAccessory.js.map +1 -0
  113. package/dist/shared/accessories/WindowCoveringAccessory.js.map +1 -0
  114. package/dist/shared/accessories/WirelessSwitchAccessory.js.map +1 -0
  115. package/dist/shared/accessories/characteristic/Active.js.map +1 -0
  116. package/dist/{accessory → shared/accessories}/characteristic/AirQuality.js +1 -1
  117. package/dist/shared/accessories/characteristic/AirQuality.js.map +1 -0
  118. package/dist/shared/accessories/characteristic/CurrentRelativeHumidity.js.map +1 -0
  119. package/dist/shared/accessories/characteristic/CurrentTemperature.js.map +1 -0
  120. package/dist/shared/accessories/characteristic/CurrentWeather.js.map +1 -0
  121. package/dist/shared/accessories/characteristic/CurrentWeatherByOpenMeteo.js.map +1 -0
  122. package/dist/shared/accessories/characteristic/CurrentWetBulbGlobeTemperature.js.map +1 -0
  123. package/dist/shared/accessories/characteristic/EnergyUsage.js.map +1 -0
  124. package/dist/shared/accessories/characteristic/Light.js.map +1 -0
  125. package/dist/shared/accessories/characteristic/LightSensor.js.map +1 -0
  126. package/dist/shared/accessories/characteristic/LockPhysicalControls.js.map +1 -0
  127. package/dist/{accessory → shared/accessories}/characteristic/MotionDetected.js +1 -1
  128. package/dist/shared/accessories/characteristic/MotionDetected.js.map +1 -0
  129. package/dist/shared/accessories/characteristic/Name.js.map +1 -0
  130. package/dist/shared/accessories/characteristic/OccupancyDetected.js.map +1 -0
  131. package/dist/{accessory → shared/accessories}/characteristic/On.js +1 -1
  132. package/dist/shared/accessories/characteristic/On.js.map +1 -0
  133. package/dist/shared/accessories/characteristic/OutletInUse.js.map +1 -0
  134. package/dist/{accessory → shared/accessories}/characteristic/ProgrammableSwitchEvent.js +2 -2
  135. package/dist/shared/accessories/characteristic/ProgrammableSwitchEvent.js.map +1 -0
  136. package/dist/shared/accessories/characteristic/RelativeHumidityDehumidifierThreshold.js.map +1 -0
  137. package/dist/shared/accessories/characteristic/RotationSpeed.js.map +1 -0
  138. package/dist/shared/accessories/characteristic/SecuritySystemState.js.map +1 -0
  139. package/dist/shared/accessories/characteristic/SwingMode.js.map +1 -0
  140. package/dist/shared/accessories/characteristic/TargetTemperature.js.map +1 -0
  141. package/dist/shared/accessories/characteristic/TemperatureDisplayUnits.js.map +1 -0
  142. package/dist/shared/util/ConfigHash.js +79 -0
  143. package/dist/shared/util/ConfigHash.js.map +1 -0
  144. package/dist/shared/util/FfmpegStreamingProcess.js.map +1 -0
  145. package/dist/shared/util/InfraredTool.js.map +1 -0
  146. package/dist/shared/util/Logger.js.map +1 -0
  147. package/dist/shared/util/TuyaRecordingDelegate.js.map +1 -0
  148. package/dist/shared/util/TuyaStreamDelegate.js.map +1 -0
  149. package/dist/shared/util/color.js.map +1 -0
  150. package/dist/shared/util/util.js +135 -0
  151. package/dist/shared/util/util.js.map +1 -0
  152. package/eslint.config.mjs +52 -0
  153. package/jest.config.js +6 -0
  154. package/package.json +23 -28
  155. package/test/__mocks__/@homebridge-camera-utils.js +10 -0
  156. package/test/__mocks__/color-convert.js +24 -0
  157. package/test/__mocks__/kelvin-to-rgb.js +21 -0
  158. package/test/accessoryFactory.test.ts +522 -0
  159. package/test/config.test.ts +430 -0
  160. package/test/custom.test.ts +4 -4
  161. package/test/errorHandling.test.ts +570 -0
  162. package/test/errorHandlingCoverage.test.ts +410 -0
  163. package/test/home.test.ts +4 -4
  164. package/test/localDevice.test.ts +616 -0
  165. package/test/localDeviceManager.behavior.test.ts +185 -0
  166. package/test/localDeviceManager.test.ts +327 -0
  167. package/test/mqttMessages.test.ts +495 -0
  168. package/test/platform.test.ts +1310 -0
  169. package/test/platform.validation.local.test.ts +250 -0
  170. package/test/protocol.test.ts +446 -0
  171. package/test/protocolUtilities.test.ts +351 -0
  172. package/test/sanitizeName.test.ts +2 -1
  173. package/test/tuyaCustomDeviceManager.test.ts +469 -0
  174. package/test/tuyaDevice.test.ts +425 -0
  175. package/test/tuyaDeviceManager.test.ts +813 -0
  176. package/test/tuyaDiscovery.test.ts +439 -0
  177. package/test/tuyaHomeDeviceManager.test.ts +540 -0
  178. package/test/tuyaOpenAPI.test.ts +404 -0
  179. package/test/tuyaOpenMQ.test.ts +444 -0
  180. package/test/util.test.ts +318 -0
  181. package/test/util.ts +4 -3
  182. package/test/zigbee/ChildPayloadUtility.test.ts +199 -0
  183. package/test/zigbee/CloudLocalReconciliation.test.ts +284 -0
  184. package/test/zigbee/DynamicChildDiscovery.test.ts +333 -0
  185. package/test/zigbee/LocalDevice.zigbee.test.ts +274 -0
  186. package/test/zigbee/LocalDeviceManager.cloud-discovery.test.ts +163 -0
  187. package/test/zigbee/LocalDeviceManager.zigbee.reconnect.test.ts +200 -0
  188. package/test/zigbee/LocalDeviceManager.zigbee.test.ts +344 -0
  189. package/test/zigbee/ZigbeeEventDetection.test.ts +418 -0
  190. package/test/zigbee/ZigbeeGatewayDetection.test.ts +222 -0
  191. package/tuya-local-configs/dev-1.hash +1 -0
  192. package/tuya-local-configs/device1.hash +1 -0
  193. package/wiki/Get-Local-Keys-for-Your-Devices.md +85 -0
  194. package/dist/accessory/AccessoryFactory.js.map +0 -1
  195. package/dist/accessory/AirConditionerAccessory.js.map +0 -1
  196. package/dist/accessory/AirPurifierAccessory.js.map +0 -1
  197. package/dist/accessory/AirQualitySensorAccessory.js.map +0 -1
  198. package/dist/accessory/BaseAccessory.js.map +0 -1
  199. package/dist/accessory/CameraAccessory.js.map +0 -1
  200. package/dist/accessory/CarbonDioxideSensorAccessory.js.map +0 -1
  201. package/dist/accessory/CarbonMonoxideSensorAccessory.js.map +0 -1
  202. package/dist/accessory/ContactSensorAccessory.js.map +0 -1
  203. package/dist/accessory/DehumidifierAccessory.js.map +0 -1
  204. package/dist/accessory/DiffuserAccessory.js.map +0 -1
  205. package/dist/accessory/DimmerAccessory.js.map +0 -1
  206. package/dist/accessory/DoorbellAccessory.js.map +0 -1
  207. package/dist/accessory/ExtractionHoodAccessory.js.map +0 -1
  208. package/dist/accessory/FanAccessory.js.map +0 -1
  209. package/dist/accessory/GarageDoorAccessory.js.map +0 -1
  210. package/dist/accessory/HeaterAccessory.js.map +0 -1
  211. package/dist/accessory/HeaterAccessory_old.js.map +0 -1
  212. package/dist/accessory/HumanPresenceSensorAccessory.js.map +0 -1
  213. package/dist/accessory/HumidifierAccessory.js.map +0 -1
  214. package/dist/accessory/IRAirConditionerAccessory.js.map +0 -1
  215. package/dist/accessory/IRControlHubAccessory.js.map +0 -1
  216. package/dist/accessory/IRControlHubSubAccessory.js.map +0 -1
  217. package/dist/accessory/IRGenericAccessory.js.map +0 -1
  218. package/dist/accessory/LeakSensorAccessory.js.map +0 -1
  219. package/dist/accessory/LightAccessory.js.map +0 -1
  220. package/dist/accessory/LightSensorAccessory.js.map +0 -1
  221. package/dist/accessory/LocationWeatherAccessory.js.map +0 -1
  222. package/dist/accessory/LockAccessory.js.map +0 -1
  223. package/dist/accessory/MotionSensorAccessory.js.map +0 -1
  224. package/dist/accessory/OutletAccessory.js.map +0 -1
  225. package/dist/accessory/PetFeederAccessory.js.map +0 -1
  226. package/dist/accessory/SceneAccessory.js.map +0 -1
  227. package/dist/accessory/SceneSwitchAccessory.js.map +0 -1
  228. package/dist/accessory/SecuritySystemAccessory.js.map +0 -1
  229. package/dist/accessory/SmokeSensorAccessory.js.map +0 -1
  230. package/dist/accessory/SwitchAccessory.js +0 -85
  231. package/dist/accessory/SwitchAccessory.js.map +0 -1
  232. package/dist/accessory/TemperatureHumiditySensorAccessory.js.map +0 -1
  233. package/dist/accessory/ThermostatAccessory.js.map +0 -1
  234. package/dist/accessory/TowerRackAccessory.js.map +0 -1
  235. package/dist/accessory/ValveAccessory.js.map +0 -1
  236. package/dist/accessory/VibrationSensorAccessory.js.map +0 -1
  237. package/dist/accessory/WeatherStationAccessory.js.map +0 -1
  238. package/dist/accessory/WetBulbGlobeTemperatureAccessory.js.map +0 -1
  239. package/dist/accessory/WhiteNoiseLightAccessory.js.map +0 -1
  240. package/dist/accessory/WindowAccessory.js.map +0 -1
  241. package/dist/accessory/WindowCoveringAccessory.js.map +0 -1
  242. package/dist/accessory/WirelessSwitchAccessory.js.map +0 -1
  243. package/dist/accessory/characteristic/Active.js.map +0 -1
  244. package/dist/accessory/characteristic/AirQuality.js.map +0 -1
  245. package/dist/accessory/characteristic/CurrentRelativeHumidity.js.map +0 -1
  246. package/dist/accessory/characteristic/CurrentTemperature.js.map +0 -1
  247. package/dist/accessory/characteristic/CurrentWeather.js.map +0 -1
  248. package/dist/accessory/characteristic/CurrentWeatherByOpenMeteo.js.map +0 -1
  249. package/dist/accessory/characteristic/CurrentWetBulbGlobeTemperature.js.map +0 -1
  250. package/dist/accessory/characteristic/EnergyUsage.js.map +0 -1
  251. package/dist/accessory/characteristic/Light.js.map +0 -1
  252. package/dist/accessory/characteristic/LightSensor.js.map +0 -1
  253. package/dist/accessory/characteristic/LockPhysicalControls.js.map +0 -1
  254. package/dist/accessory/characteristic/MotionDetected.js.map +0 -1
  255. package/dist/accessory/characteristic/Name.js.map +0 -1
  256. package/dist/accessory/characteristic/OccupancyDetected.js.map +0 -1
  257. package/dist/accessory/characteristic/On.js.map +0 -1
  258. package/dist/accessory/characteristic/OutletInUse.js.map +0 -1
  259. package/dist/accessory/characteristic/ProgrammableSwitchEvent.js.map +0 -1
  260. package/dist/accessory/characteristic/RelativeHumidityDehumidifierThreshold.js.map +0 -1
  261. package/dist/accessory/characteristic/RotationSpeed.js.map +0 -1
  262. package/dist/accessory/characteristic/SecuritySystemState.js.map +0 -1
  263. package/dist/accessory/characteristic/SwingMode.js.map +0 -1
  264. package/dist/accessory/characteristic/TargetTemperature.js.map +0 -1
  265. package/dist/accessory/characteristic/TemperatureDisplayUnits.js.map +0 -1
  266. package/dist/core/TuyaOpenAPI.js.map +0 -1
  267. package/dist/core/TuyaOpenMQ.js.map +0 -1
  268. package/dist/device/TuyaCustomDeviceManager.js.map +0 -1
  269. package/dist/device/TuyaDevice.js.map +0 -1
  270. package/dist/device/TuyaDeviceManager.js.map +0 -1
  271. package/dist/device/TuyaHomeDeviceManager.js.map +0 -1
  272. package/dist/util/FfmpegStreamingProcess.js.map +0 -1
  273. package/dist/util/InfraredTool.js.map +0 -1
  274. package/dist/util/Logger.js.map +0 -1
  275. package/dist/util/TuyaRecordingDelegate.js.map +0 -1
  276. package/dist/util/TuyaStreamDelegate.js.map +0 -1
  277. package/dist/util/color.js.map +0 -1
  278. package/dist/util/util.js +0 -63
  279. package/dist/util/util.js.map +0 -1
  280. /package/dist/{device → cloud/device}/TuyaCustomDeviceManager.js +0 -0
  281. /package/dist/{device → cloud/device}/TuyaHomeDeviceManager.js +0 -0
  282. /package/dist/{accessory → shared/accessories}/AirConditionerAccessory.js +0 -0
  283. /package/dist/{accessory → shared/accessories}/AirQualitySensorAccessory.js +0 -0
  284. /package/dist/{accessory → shared/accessories}/CarbonDioxideSensorAccessory.js +0 -0
  285. /package/dist/{accessory → shared/accessories}/CarbonMonoxideSensorAccessory.js +0 -0
  286. /package/dist/{accessory → shared/accessories}/ContactSensorAccessory.js +0 -0
  287. /package/dist/{accessory → shared/accessories}/DehumidifierAccessory.js +0 -0
  288. /package/dist/{accessory → shared/accessories}/DiffuserAccessory.js +0 -0
  289. /package/dist/{accessory → shared/accessories}/DimmerAccessory.js +0 -0
  290. /package/dist/{accessory → shared/accessories}/GarageDoorAccessory.js +0 -0
  291. /package/dist/{accessory → shared/accessories}/HeaterAccessory.js +0 -0
  292. /package/dist/{accessory → shared/accessories}/HeaterAccessory_old.js +0 -0
  293. /package/dist/{accessory → shared/accessories}/HumanPresenceSensorAccessory.js +0 -0
  294. /package/dist/{accessory → shared/accessories}/IRControlHubAccessory.js +0 -0
  295. /package/dist/{accessory → shared/accessories}/IRControlHubSubAccessory.js +0 -0
  296. /package/dist/{accessory → shared/accessories}/IRGenericAccessory.js +0 -0
  297. /package/dist/{accessory → shared/accessories}/LeakSensorAccessory.js +0 -0
  298. /package/dist/{accessory → shared/accessories}/LightAccessory.js +0 -0
  299. /package/dist/{accessory → shared/accessories}/LightSensorAccessory.js +0 -0
  300. /package/dist/{accessory → shared/accessories}/LocationWeatherAccessory.js +0 -0
  301. /package/dist/{accessory → shared/accessories}/LockAccessory.js +0 -0
  302. /package/dist/{accessory → shared/accessories}/MotionSensorAccessory.js +0 -0
  303. /package/dist/{accessory → shared/accessories}/OutletAccessory.js +0 -0
  304. /package/dist/{accessory → shared/accessories}/PetFeederAccessory.js +0 -0
  305. /package/dist/{accessory → shared/accessories}/SceneAccessory.js +0 -0
  306. /package/dist/{accessory → shared/accessories}/SecuritySystemAccessory.js +0 -0
  307. /package/dist/{accessory → shared/accessories}/SmokeSensorAccessory.js +0 -0
  308. /package/dist/{accessory → shared/accessories}/TemperatureHumiditySensorAccessory.js +0 -0
  309. /package/dist/{accessory → shared/accessories}/ThermostatAccessory.js +0 -0
  310. /package/dist/{accessory → shared/accessories}/TowerRackAccessory.js +0 -0
  311. /package/dist/{accessory → shared/accessories}/WeatherStationAccessory.js +0 -0
  312. /package/dist/{accessory → shared/accessories}/WetBulbGlobeTemperatureAccessory.js +0 -0
  313. /package/dist/{accessory → shared/accessories}/WhiteNoiseLightAccessory.js +0 -0
  314. /package/dist/{accessory → shared/accessories}/WindowAccessory.js +0 -0
  315. /package/dist/{accessory → shared/accessories}/WindowCoveringAccessory.js +0 -0
  316. /package/dist/{accessory → shared/accessories}/WirelessSwitchAccessory.js +0 -0
  317. /package/dist/{accessory → shared/accessories}/characteristic/Active.js +0 -0
  318. /package/dist/{accessory → shared/accessories}/characteristic/CurrentRelativeHumidity.js +0 -0
  319. /package/dist/{accessory → shared/accessories}/characteristic/CurrentTemperature.js +0 -0
  320. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWeather.js +0 -0
  321. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWeatherByOpenMeteo.js +0 -0
  322. /package/dist/{accessory → shared/accessories}/characteristic/CurrentWetBulbGlobeTemperature.js +0 -0
  323. /package/dist/{accessory → shared/accessories}/characteristic/EnergyUsage.js +0 -0
  324. /package/dist/{accessory → shared/accessories}/characteristic/Light.js +0 -0
  325. /package/dist/{accessory → shared/accessories}/characteristic/LightSensor.js +0 -0
  326. /package/dist/{accessory → shared/accessories}/characteristic/LockPhysicalControls.js +0 -0
  327. /package/dist/{accessory → shared/accessories}/characteristic/Name.js +0 -0
  328. /package/dist/{accessory → shared/accessories}/characteristic/OccupancyDetected.js +0 -0
  329. /package/dist/{accessory → shared/accessories}/characteristic/OutletInUse.js +0 -0
  330. /package/dist/{accessory → shared/accessories}/characteristic/RelativeHumidityDehumidifierThreshold.js +0 -0
  331. /package/dist/{accessory → shared/accessories}/characteristic/RotationSpeed.js +0 -0
  332. /package/dist/{accessory → shared/accessories}/characteristic/SecuritySystemState.js +0 -0
  333. /package/dist/{accessory → shared/accessories}/characteristic/SwingMode.js +0 -0
  334. /package/dist/{accessory → shared/accessories}/characteristic/TargetTemperature.js +0 -0
  335. /package/dist/{accessory → shared/accessories}/characteristic/TemperatureDisplayUnits.js +0 -0
  336. /package/dist/{util → shared/util}/FfmpegStreamingProcess.js +0 -0
  337. /package/dist/{util → shared/util}/InfraredTool.js +0 -0
  338. /package/dist/{util → shared/util}/Logger.js +0 -0
  339. /package/dist/{util → shared/util}/TuyaRecordingDelegate.js +0 -0
  340. /package/dist/{util → shared/util}/TuyaStreamDelegate.js +0 -0
  341. /package/dist/{util → shared/util}/color.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.0] - (2026.6.1)
4
+
5
+ ### Breaking Changes
6
+ - **Complete codebase restructure** — source files are now organised under `src/cloud/`, `src/local/`, and `src/shared/` instead of the previous flat layout. No config changes needed for existing cloud users.
7
+ - Requires Node.js `^20 || ^22 || ^24 || ^25`.
8
+
9
+ ### Added
10
+ - **Local LAN mode** — communicate directly with Tuya devices over TCP on your local network with no cloud connection required. Set `"mode": "local"` in your config.
11
+ - **Both mode** — run cloud and local connections simultaneously (`"mode": "both"`).
12
+ - **UDP auto-discovery** — automatically finds Tuya devices on the local network (ports 6666/6667/7000). Supports protocol versions 3.1–3.5 including AES-GCM (v3.5).
13
+ - **Full local protocol support** — LAN TCP client with AES-128-ECB (v3.1–v3.4) and AES-128-GCM (v3.5), 3-way key exchange for v3.4/v3.5, and automatic reconnection with exponential backoff.
14
+ - New `local` config block in Homebridge UI with device list and discovery options.
15
+ - New `mode` selector in the Homebridge UI config screen.
16
+
17
+ ### Changed
18
+ - Updated `config.schema.json` with the new `mode` enum and `local` block; all cloud options now only appear when mode is `cloud` or `both`.
19
+ - Version bump to 3.0.0 to reflect the breaking restructure.
20
+ - Updated README with full cloud and local setup instructions.
21
+
3
22
  ## [2.2.0] - (2026.2.23)
4
23
 
5
24
  ### Fixed
package/README.md CHANGED
@@ -12,24 +12,20 @@
12
12
  [![mit-license](https://badgen.net/npm/license/@homebridge-plugins/homebridge-tuya)](https://github.com/homebridge-plugins/homebridge-tuya/blob/main/LICENSE)
13
13
  [![Build and Lint](https://github.com/homebridge-plugins/homebridge-tuya/actions/workflows/build.yml/badge.svg)](https://github.com/homebridge-plugins/homebridge-tuya/actions/workflows/build.yml)
14
14
 
15
+ Unified Homebridge plugin for Tuya smart devices — supports **Tuya Cloud** (REST/MQTT) and **Tuya Local** (direct LAN/TCP) communication, or both simultaneously.
15
16
 
16
-
17
-
18
- Forked from 0x5e/homebridge-tuya-platform, with a focus on fixing bugs and adding new device support.
19
-
20
-
21
-
17
+ ---
22
18
 
23
19
  ## Features
24
20
 
21
+ - **Three connection modes**: Cloud, Local (LAN), or Both simultaneously.
25
22
  - Optimized and improved code for better readability and maintainability.
26
- - Enhanced stability.
27
- - Reduced duplicate code.
28
- - Fewer API errors.
29
- - Lower development costs for new accessory categories.
30
- - Supports Tuya Scenes (Tap-to-Run).
31
- - Includes the ability to override device configurations, which enables support for "non-standard" DPs.
32
- - Supports over 60+ device categories, including most light, switch, sensor, camera, lock, IR remote control, etc.
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.
33
29
 
34
30
 
35
31
  ## Supported Tuya Devices
@@ -41,15 +37,11 @@ See [CHANGELOG.md](./CHANGELOG.md)
41
37
 
42
38
 
43
39
  ## Installation
44
- Before using this plugin, please make sure to uninstall `homebridge-tuya-platform` first as these two plugins cannot run simultaneously. However, the configuration files are compatible, so there's no need to delete them.
45
40
 
46
- #### For Homebridge Web UI Users
47
- Go to plugin page, search for `@homebridge-plugins/homebridge-tuya` and install it.
41
+ #### Homebridge Web UI
42
+ Search for `@homebridge-plugins/homebridge-tuya` on the Plugins page and install it.
48
43
 
49
-
50
- #### For Homebridge Command Line Users
51
-
52
- Run the following command in the terminal:
44
+ #### Command Line
53
45
  ```
54
46
  npm install @homebridge-plugins/homebridge-tuya
55
47
  ```
@@ -57,159 +49,188 @@ npm install @homebridge-plugins/homebridge-tuya
57
49
 
58
50
  ## Configuration
59
51
 
60
- There are two types of projects: `Custom` and `Smart Home`.
61
- The difference between them is:
62
- - The `Custom` project pulls devices from the project's assets.
63
- - The `Smart Home` project pulls devices from the user's home in the Tuya app.
64
-
65
- If you are a personal user and are unsure which one to choose, please use the `Smart Home` project.
66
-
67
- Before you can configure, you must go to the [Tuya IoT Platform](https://iot.tuya.com):
68
- - Create a cloud development project, and select the data center where your app account is located. See [Mappings Between OEM App Accounts and Data Centers](https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb) or [Countries Regions and Tuya Data Center](https://github.com/tuya/tuya-home-assistant/wiki/Countries-Regions-and-Tuya-Data-Center)
69
- - Go to the `Project Page` > `Devices Panel` > `Link Tuya App Account`, and link your app account.
70
- - Go to the `Project Page` > `Service API` > `Go to Authorize`, and subscribe to the following APIs (it is free for trial):
71
- - Authorization Token Management
72
- - Device Status Notification
73
- - IoT Core
74
- - IoT Video Live Stream (for cameras)
75
- - Industry Project Client Service (for the `Custom` project)
76
- - IR Control Hub Open Service (for IR devices)
77
- - Smart Home Scene Linkage (for scenes)
78
- - Smart Lock Open Service (for Lock devices)
79
- - **⚠️Remember to extend the API trial period every 6 months here [Tuya IoT Platform > Cloud > Cloud Services > IoT Core](https://iot.tuya.com/cloud/products/detail?abilityId=1442730014117204014&id=p1668587814138nv4h3n&abilityAuth=0&tab=1) (the first-time subscription only gives you 1 month).**
80
-
81
- #### For "Custom" Project
82
-
83
- - `platform` - **required** : Must be 'TuyaPlatform'
84
- - `options.projectType` - **required** : Must be '1'
85
- - `options.endpoint` - **required** : The endpoint URL taken from the [API Reference > Endpoints](https://developer.tuya.com/en/docs/iot/api-request?id=Ka4a8uuo1j4t4#title-1-Endpoints) table.
86
- - `options.accessId` - **required** : The Access ID obtained from [Tuya IoT Platform > Cloud Develop](https://iot.tuya.com/cloud)
87
- - `options.accessKey` - **required** : The Access Secret obtained from [Tuya IoT Platform > Cloud Develop](https://iot.tuya.com/cloud)
88
- - `options.debug` - **optional**: Includes debugging output in the Homebridge log. (Default: `false`)
89
- - `options.debugLevel` - **optional**: An optional list of strings seperated with comma `,`. `api` represents for HTTP API log, `mqtt` represents for MQTT log, and device ID represents for device log. If blank, all logs are outputed.
90
-
91
- #### For "Smart Home" Project
92
-
93
- - `platform` - **required** : Must be 'TuyaPlatform'
94
- - `options.projectType` - **required** : Must be '2'
95
- - `options.accessId` - **required** : The Access ID obtained from [Tuya IoT Platform > Cloud Develop](https://iot.tuya.com/cloud)
96
- - `options.accessKey` - **required** : The Access Secret obtained from [Tuya IoT Platform > Cloud Develop](https://iot.tuya.com/cloud)
97
- - `options.countryCode` - **required** : The country code of your app account's region.
98
- - `options.username` - **required** : The app account's username.
99
- - `options.password` - **required** : The app account's password. MD5 salted password is also available for increased security.
100
- - `options.appSchema` - **required** : The app schema: 'tuyaSmart' for the Tuya Smart App, or 'smartlife' for the Smart Life App.
101
- - `options.endpoint` - **optional** : The endpoint URL can be inferred from the [API Reference > Endpoints](https://developer.tuya.com/en/docs/iot/api-request?id=Ka4a8uuo1j4t4#title-1-Endpoints) table based on the country code provided. Only manually set this value if you encounter login issues and need to specify the endpoint for your account location.
102
- - `options.homeWhitelist` - **optional**: An array of integer values for the home IDs you want to whitelist. If provided, only devices with matching Home IDs will be included. You can find the Home ID in the Homebridge log.
103
- - `options.debug` - **optional**: Includes debugging output in the Homebridge log. (Default: `false`)
104
- - `options.debugLevel` - **optional**: An optional list of strings seperated with comma `,`. `api` represents for API and MQTT log, device ID represents for specific device log. If blank, all logs are outputed.
105
-
106
-
107
- #### Advanced options
108
- See [ADVANCED_OPTIONS.md](./ADVANCED_OPTIONS.md)
109
-
110
-
111
- ## Limitations
112
- - **⚠️Don't forget to extend the API trial period every 6 months. Maybe you can set up a reminder in calendar.**
113
- - Using the same app account for multiple Homebridge/HomeAssistant instances is not supported. Please use separate app accounts for each instance.
114
- - The plugin requires an internet connection to the Tuya Cloud and does not support the LAN protocol. See [#90](https://github.com/homebridge-plugins/homebridge-tuya/issues/90) for more information.
115
-
116
- ## FAQ
52
+ ### Connection Mode
53
+
54
+ Set `mode` in your config to one of:
55
+
56
+ | Mode | Description |
57
+ |------|-------------|
58
+ | `cloud` | Connect via Tuya Cloud API (default, backward-compatible) |
59
+ | `local` | Connect directly over LAN no cloud needed |
60
+ | `both` | Cloud + Local simultaneously |
61
+
62
+ ---
63
+
64
+ ### Cloud Mode (`mode: "cloud"`)
65
+
66
+ Requires a [Tuya IoT Platform](https://iot.tuya.com) account and cloud project:
67
+
68
+ 1. Create a cloud project and select your data center. See [Mappings Between OEM App Accounts and Data Centers](https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb).
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).
80
+
81
+ There are two project types:
82
+
83
+ #### Custom Project (`options.projectType: "1"`)
84
+
85
+ | Field | Required | Description |
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 |
93
+
94
+ #### Smart Home Project (`options.projectType: "2"`)
95
+
96
+ | Field | Required | Description |
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:**
111
+ ```json
112
+ {
113
+ "platform": "TuyaPlatform",
114
+ "name": "Tuya",
115
+ "mode": "cloud",
116
+ "options": {
117
+ "projectType": "2",
118
+ "accessId": "YOUR_ACCESS_ID",
119
+ "accessKey": "YOUR_ACCESS_KEY",
120
+ "countryCode": 1,
121
+ "username": "your@email.com",
122
+ "password": "yourpassword",
123
+ "appSchema": "tuyaSmart"
124
+ }
125
+ }
126
+ ```
117
127
 
118
- #### About Login issue
128
+ ---
129
+
130
+ ### Local Mode (`mode: "local"`)
131
+
132
+ Communicates directly with your Tuya devices over LAN — no internet or Tuya Cloud account required after initial key retrieval.
133
+
134
+ **Requirements:**
135
+ - Your Homebridge host and Tuya devices must be on the same network.
136
+ - Each device's **local key** (16-character AES key). You can retrieve your local keys from the [Tuya IoT Platform](https://iot.tuya.com) — see [Get Local Keys](https://github.com/homebridge-plugins/homebridge-tuya/wiki/Get-Local-Keys-for-Your-Devices) for a guide.
137
+
138
+ | Field | Required | Description |
139
+ |-------|----------|-------------|
140
+ | `local.autoDiscoverDevices` | ➖ | Auto-discover devices via UDP broadcast (default: `true`) |
141
+ | `local.discoverTimeout` | ➖ | Discovery listen time in seconds (default: `5`) |
142
+ | `local.devices` | ➖ | Optional list of known devices with their keys |
143
+ | `local.devices[].tuyaDeviceId` | ✅ | Tuya device ID |
144
+ | `local.devices[].tuyaKey` | ➖ | Local AES key (16 chars) |
145
+ | `local.devices[].ip` | ➖ | Fixed IP address (optional; otherwise auto-discovered) |
146
+ | `local.devices[].name` | ➖ | Friendly name |
147
+ | `local.devices[].category` | ➖ | Category code (e.g. `light`, `switch`) to pick the right accessory handler |
148
+ | `local.devices[].protocolVersion` | ➖ | Protocol version (e.g. `3.3`, `3.4`); auto-detected when blank |
149
+
150
+ **Example local config:**
151
+ ```json
152
+ {
153
+ "platform": "TuyaPlatform",
154
+ "name": "Tuya",
155
+ "mode": "local",
156
+ "local": {
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
+ ]
168
+ }
169
+ }
170
+ ```
119
171
 
120
- For most users, you can easily find your app account's data center through the [documentation](https://developer.tuya.com/en/docs/iot/oem-app-data-center-distributed?id=Kafi0ku9l07qb) and login without any issues. However, for some users, they may encounter error codes such as 1106 or 2406. If you encounter such errors, it's possible that there are differences between your data center and the documentation.
172
+ ---
121
173
 
122
- To determine the data center, follow these steps:
174
+ ### Both Mode (`mode: "both"`)
123
175
 
124
- 1. Open the app and navigate to "Me > Settings > Network Diagnosis".
125
- 2. Start the diagnosis and select "Upload Log > Copy the Log to Clipboard".
126
- 3. Paste the log anywhere and find the line beginning with "Region code:".
127
- 4. Look for the following codes: "AY" for China, "AZ" for the West US, "EU" for Central Europe, and "IN" for India.
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
+ ---
128
183
 
129
- Then manually specify endpoint in the plugin config.
184
+ ### Advanced Options
185
+ See [ADVANCED_OPTIONS.md](./ADVANCED_OPTIONS.md)
130
186
 
131
187
 
132
- #### What is "Standard DP" and "Non-standard DP"?
188
+ ## 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.
133
192
 
134
- <!-- If your device is working properly, you don't need to know this. -->
135
193
 
136
- "Standard DP" refers to device properties or functionalities that are specified in the Tuya IoT Development Platform documentation at [Tuya IoT Development Platform Documentation > Cloud Development > Standard Instruction Set](https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq).
194
+ ## FAQ
137
195
 
138
- For example, a light bulb should have a standard DP code of `switch_led` for power on/off, and optional codes `bright_value`/`bright_value_v2` for brightness, `temp_value`/`temp_value_v2` for color temperature, and `work_mode` for changing the working mode. These codes can be found in the above documentation.
196
+ #### About Login Issues
139
197
 
140
- If your light bulb can be adjusted in the Tuya app but not with the plugin, it most likely has "Non-standard DP."
198
+ For most users, the data center is auto-detected. If you get error codes `1106` or `2406`:
141
199
 
200
+ 1. Open the Tuya app → Me → Settings → Network Diagnosis.
201
+ 2. Start diagnosis, select Upload Log → Copy the Log to Clipboard.
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.
142
205
 
143
- #### Can "Non-standard DP" be supportd by this plugin?
206
+ #### What is "Standard DP" and "Non-standard DP"?
144
207
 
145
- Yes. The device must be listed in the support list and the following steps must be completed before it will work:
146
- 1. Change the device's control mode on the Tuya Platform:
147
- - Go to "[Tuya Platform Cloud Development](https://iot.tuya.com/cloud/) > Your Project > Devices > All Devices > View Devices by Product".
148
- - Find the product related to your device, click the "pencil" icon (Change Control Instruction Mode).
149
- - <img width="500" alt="image" src="https://user-images.githubusercontent.com/5144674/202967707-8b934e05-36d6-4b42-bb7b-87e5b24474c4.png">
150
- - In the "Table of Instructions", you can see the cloud mapping and determine which DP codes are missing and need to be manually mapped later.
151
- - <img width="500" alt="image" src="https://user-images.githubusercontent.com/5144674/202967528-4838f9a1-0547-4102-afbb-180dc9b198b1.png">
152
- - Select "DP Instruction" and save.
153
- 2. Override the device schema, see [ADVANCED_OPTIONS.md](./ADVANCED_OPTIONS.md).
208
+ "Standard DP" refers to device properties defined in [Tuya Standard Instruction Set](https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq) (e.g. `switch_led`, `bright_value`). If your device works in the Tuya app but not this plugin, it likely has non-standard DPs.
154
209
 
210
+ #### Can "Non-standard DP" be supported?
155
211
 
156
- #### Local support
157
- See [#90](https://github.com/homebridge-plugins/homebridge-tuya/issues/90).
212
+ Yes override the device schema. See [ADVANCED_OPTIONS.md](./ADVANCED_OPTIONS.md).
158
213
 
159
- Although the plugin didn't implemented tuya local protocol now, it still remains possibility in the future.
214
+ Steps:
215
+ 1. On the Tuya Platform → Your Project → Devices → All Devices → View by Product.
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.
160
218
 
161
219
 
162
220
  ## Troubleshooting
163
221
 
164
- If your device is not supported, please follow these steps to collect information.
165
-
166
222
  #### 1. Get Device Information
167
223
 
168
- After Homebridge has been successfully launched, the device information list will be saved in Homebridge's persist path. You can find the file path in the Homebridge log:
224
+ After a successful start, the cloud device list is saved at the path shown in the Homebridge log:
169
225
  ```
170
- [2022/11/3 18:37:43] [TuyaPlatform] Device list saved at /path/to/TuyaDeviceList.{uid}.json
226
+ [TuyaPlatform] Device list saved at /path/to/TuyaDeviceList.{uid}.json
171
227
  ```
172
-
173
- **⚠️Please make sure to remove sensitive information such as `ip`, `lon`, `lat`, `local_key`, and `uid` before submitting the file.**
174
-
228
+ **⚠️ Remove sensitive fields (`ip`, `lon`, `lat`, `local_key`, `uid`) before sharing.**
175
229
 
176
230
  #### 2. Enable Debug Mode
177
231
 
178
- Add debug option in the plugin config, then restart Homebridge.
232
+ Add `"debug": true` to your `options` block and restart Homebridge.
179
233
 
180
234
  #### 3. Collect Logs
181
235
 
182
- With debug mode enabled, you can now receive MQTT logs. Operate your device, either physically or through the Tuya App, to receive MQTT logs like this:
183
-
184
- ```
185
- [2022/12/8 12:51:59] [TuyaPlatform] [TuyaOpenMQ] onMessage:
186
- topic = cloud/token/in/xxx
187
- protocol = 4
188
- message = {
189
- "dataId": "xxx",
190
- "devId": "xxx",
191
- "productKey": "xxx",
192
- "status": [
193
- {
194
- "1": "double_click",
195
- "code": "switch1_value",
196
- "t": "1670475119766",
197
- "value": "double_click"
198
- }
199
- ]
200
- }
201
- ```
202
-
203
- If you are unable to receive any MQTT logs while controlling the device, it likely means that your device has "Non-standard DP".
204
-
205
- By submitting the device information JSON and MQTT logs, you can help us support new device categories.
206
-
207
-
208
- ## Contributing
209
-
210
- Please see https://github.com/homebridge/homebridge-plugin-template#setup-development-environment for setup development environment.
211
-
212
- PRs and issues are welcome.
213
-
214
- #
215
- Thank you for spend time using the project. If it helps you, don't hesitate to give it a star 🌟:-)
236
+ With debug enabled, operate your device physically or via the Tuya App and collect the MQTT/local protocol logs from the Homebridge log.