@homebridge-plugins/homebridge-tuya 3.0.0-beta.3 → 3.0.0-beta.30

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 (321) hide show
  1. package/README.md +364 -142
  2. package/config.schema.json +1299 -894
  3. package/dist/cloud/api/TuyaOpenAPI.js +108 -60
  4. package/dist/cloud/api/TuyaOpenAPI.js.map +1 -1
  5. package/dist/cloud/api/TuyaOpenMQ.js +45 -22
  6. package/dist/cloud/api/TuyaOpenMQ.js.map +1 -1
  7. package/dist/cloud/device/{TuyaDeviceManager.js → TuyaCloudDeviceManager.js} +146 -96
  8. package/dist/cloud/device/TuyaCloudDeviceManager.js.map +1 -0
  9. package/dist/cloud/device/TuyaCustomDeviceManager.js +75 -5
  10. package/dist/cloud/device/TuyaCustomDeviceManager.js.map +1 -1
  11. package/dist/cloud/device/TuyaDevice.js.map +1 -1
  12. package/dist/cloud/device/TuyaHomeDeviceManager.js +81 -13
  13. package/dist/cloud/device/TuyaHomeDeviceManager.js.map +1 -1
  14. package/dist/config.js +26 -5
  15. package/dist/config.js.map +1 -1
  16. package/dist/local/DynamicChildDiscovery.js +2 -1
  17. package/dist/local/DynamicChildDiscovery.js.map +1 -1
  18. package/dist/local/LocalDevice.js +108 -11
  19. package/dist/local/LocalDevice.js.map +1 -1
  20. package/dist/local/LocalDeviceManager.js +362 -177
  21. package/dist/local/LocalDeviceManager.js.map +1 -1
  22. package/dist/local/TuyaDiscovery.js +17 -8
  23. package/dist/local/TuyaDiscovery.js.map +1 -1
  24. package/dist/local/ZigbeeGatewayDetection.js +7 -4
  25. package/dist/local/ZigbeeGatewayDetection.js.map +1 -1
  26. package/dist/local/protocol/ProtocolUtilities.js +61 -27
  27. package/dist/local/protocol/ProtocolUtilities.js.map +1 -1
  28. package/dist/local/protocol/ProtocolV31V32.js +61 -11
  29. package/dist/local/protocol/ProtocolV31V32.js.map +1 -1
  30. package/dist/local/protocol/ProtocolV33.js +4 -2
  31. package/dist/local/protocol/ProtocolV33.js.map +1 -1
  32. package/dist/local/protocol/ProtocolV34.js +10 -5
  33. package/dist/local/protocol/ProtocolV34.js.map +1 -1
  34. package/dist/local/protocol/ProtocolV35.js +17 -6
  35. package/dist/local/protocol/ProtocolV35.js.map +1 -1
  36. package/dist/platform.js +263 -497
  37. package/dist/platform.js.map +1 -1
  38. package/dist/settings.js +0 -2
  39. package/dist/settings.js.map +1 -1
  40. package/dist/shared/TuyaDeviceManager.js +147 -0
  41. package/dist/shared/TuyaDeviceManager.js.map +1 -0
  42. package/dist/shared/TuyaHybridDeviceManager.js +219 -0
  43. package/dist/shared/TuyaHybridDeviceManager.js.map +1 -0
  44. package/dist/shared/accessory/AccessoryFactory.js +359 -0
  45. package/dist/shared/accessory/AccessoryFactory.js.map +1 -0
  46. package/dist/shared/{accessories → accessory}/AirConditionerAccessory.js +129 -23
  47. package/dist/shared/accessory/AirConditionerAccessory.js.map +1 -0
  48. package/dist/shared/{accessories → accessory}/AirPurifierAccessory.js.map +1 -1
  49. package/dist/shared/accessory/AirQualitySensorAccessory.js.map +1 -0
  50. package/dist/shared/{accessories → accessory}/BaseAccessory.js +47 -97
  51. package/dist/shared/accessory/BaseAccessory.js.map +1 -0
  52. package/dist/shared/{accessories → accessory}/BlindsAccessory.js.map +1 -1
  53. package/dist/shared/{accessories → accessory}/CameraAccessory.js +9 -3
  54. package/dist/shared/accessory/CameraAccessory.js.map +1 -0
  55. package/dist/shared/{accessories → accessory}/CarbonDioxideSensorAccessory.js.map +1 -1
  56. package/dist/shared/{accessories → accessory}/CarbonMonoxideSensorAccessory.js.map +1 -1
  57. package/dist/shared/accessory/CatToiletAccessory.js +130 -0
  58. package/dist/shared/accessory/CatToiletAccessory.js.map +1 -0
  59. package/dist/shared/{accessories → accessory}/ContactSensorAccessory.js.map +1 -1
  60. package/dist/shared/{accessories → accessory}/DehumidifierAccessory.js.map +1 -1
  61. package/dist/shared/{accessories → accessory}/DiffuserAccessory.js.map +1 -1
  62. package/dist/shared/{accessories → accessory}/DimmerAccessory.js.map +1 -1
  63. package/dist/shared/{accessories → accessory}/DoorbellAccessory.js.map +1 -1
  64. package/dist/shared/{accessories → accessory}/ExtractionHoodAccessory.js.map +1 -1
  65. package/dist/shared/{accessories → accessory}/FanAccessory.js +16 -4
  66. package/dist/shared/accessory/FanAccessory.js.map +1 -0
  67. package/dist/shared/{accessories → accessory}/GarageDoorAccessory.js +19 -2
  68. package/dist/shared/accessory/GarageDoorAccessory.js.map +1 -0
  69. package/dist/shared/{accessories → accessory}/HeaterAccessory.js +3 -0
  70. package/dist/shared/accessory/HeaterAccessory.js.map +1 -0
  71. package/dist/shared/{accessories → accessory}/HeaterAccessory_old.js.map +1 -1
  72. package/dist/shared/accessory/HumanPresenceSensorAccessory.js.map +1 -0
  73. package/dist/shared/{accessories → accessory}/HumidifierAccessory.js.map +1 -1
  74. package/dist/shared/accessory/IRAdapter.js +169 -0
  75. package/dist/shared/accessory/IRAdapter.js.map +1 -0
  76. package/dist/shared/{accessories → accessory}/IRAirConditionerAccessory.js +2 -2
  77. package/dist/shared/accessory/IRAirConditionerAccessory.js.map +1 -0
  78. package/dist/shared/accessory/IRControlHubAccessory.js.map +1 -0
  79. package/dist/shared/accessory/IRControlHubSubAccessory.js.map +1 -0
  80. package/dist/shared/accessory/IRFanAccessory.js +109 -0
  81. package/dist/shared/accessory/IRFanAccessory.js.map +1 -0
  82. package/dist/shared/accessory/IRGenericAccessory.js.map +1 -0
  83. package/dist/shared/{accessories → accessory}/LeakSensorAccessory.js.map +1 -1
  84. package/dist/shared/{accessories → accessory}/LightAccessory.js.map +1 -1
  85. package/dist/shared/{accessories → accessory}/LightSensorAccessory.js.map +1 -1
  86. package/dist/shared/{accessories → accessory}/LocationWeatherAccessory.js +9 -36
  87. package/dist/shared/accessory/LocationWeatherAccessory.js.map +1 -0
  88. package/dist/shared/{accessories → accessory}/LockAccessory.js +3 -3
  89. package/dist/shared/{accessories → accessory}/LockAccessory.js.map +1 -1
  90. package/dist/shared/accessory/MotionSensorAccessory.js.map +1 -0
  91. package/dist/shared/accessory/OutletAccessory.js.map +1 -0
  92. package/dist/shared/{accessories → accessory}/PetFeederAccessory.js.map +1 -1
  93. package/dist/shared/accessory/SaunaAccessory.js +134 -0
  94. package/dist/shared/accessory/SaunaAccessory.js.map +1 -0
  95. package/dist/shared/{accessories → accessory}/SceneAccessory.js +1 -1
  96. package/dist/shared/accessory/SceneAccessory.js.map +1 -0
  97. package/dist/shared/accessory/SceneSwitchAccessory.js.map +1 -0
  98. package/dist/shared/{accessories → accessory}/SecuritySystemAccessory.js +4 -4
  99. package/dist/shared/accessory/SecuritySystemAccessory.js.map +1 -0
  100. package/dist/shared/{accessories → accessory}/SmokeSensorAccessory.js.map +1 -1
  101. package/dist/shared/{accessories → accessory}/SwitchAccessory.js +1 -45
  102. package/dist/shared/accessory/SwitchAccessory.js.map +1 -0
  103. package/dist/shared/accessory/TemperatureHumiditySensorAccessory.js.map +1 -0
  104. package/dist/shared/{accessories → accessory}/ThermostatAccessory.js.map +1 -1
  105. package/dist/shared/{accessories → accessory}/TowerRackAccessory.js.map +1 -1
  106. package/dist/shared/{accessories → accessory}/ValveAccessory.js.map +1 -1
  107. package/dist/shared/{accessories → accessory}/VibrationSensorAccessory.js.map +1 -1
  108. package/dist/shared/accessory/WeatherStationAccessory.js.map +1 -0
  109. package/dist/shared/accessory/WetBulbGlobeTemperatureAccessory.js.map +1 -0
  110. package/dist/shared/{accessories → accessory}/WhiteNoiseLightAccessory.js +1 -0
  111. package/dist/shared/accessory/WhiteNoiseLightAccessory.js.map +1 -0
  112. package/dist/shared/accessory/WindowAccessory.js.map +1 -0
  113. package/dist/shared/{accessories → accessory}/WindowCoveringAccessory.js.map +1 -1
  114. package/dist/shared/{accessories → accessory}/WirelessSwitchAccessory.js.map +1 -1
  115. package/dist/shared/accessory/characteristic/Active.js.map +1 -0
  116. package/dist/shared/accessory/characteristic/AirQuality.js.map +1 -0
  117. package/dist/shared/{accessories → accessory}/characteristic/CurrentRelativeHumidity.js +3 -0
  118. package/dist/shared/accessory/characteristic/CurrentRelativeHumidity.js.map +1 -0
  119. package/dist/shared/accessory/characteristic/CurrentTemperature.js.map +1 -0
  120. package/dist/shared/accessory/characteristic/CurrentWeather.js.map +1 -0
  121. package/dist/shared/accessory/characteristic/CurrentWeatherByOpenMeteo.js.map +1 -0
  122. package/dist/shared/{accessories → accessory}/characteristic/CurrentWetBulbGlobeTemperature.js +3 -2
  123. package/dist/shared/accessory/characteristic/CurrentWetBulbGlobeTemperature.js.map +1 -0
  124. package/dist/shared/{accessories → accessory}/characteristic/EnergyUsage.js +0 -5
  125. package/dist/shared/accessory/characteristic/EnergyUsage.js.map +1 -0
  126. package/dist/shared/accessory/characteristic/EnumOn.js +48 -0
  127. package/dist/shared/accessory/characteristic/EnumOn.js.map +1 -0
  128. package/dist/shared/accessory/characteristic/ExtraCharacteristicAdapter.js +197 -0
  129. package/dist/shared/accessory/characteristic/ExtraCharacteristicAdapter.js.map +1 -0
  130. package/dist/shared/{accessories → accessory}/characteristic/Light.js +62 -12
  131. package/dist/shared/accessory/characteristic/Light.js.map +1 -0
  132. package/dist/shared/accessory/characteristic/LightSensor.js.map +1 -0
  133. package/dist/shared/{accessories → accessory}/characteristic/LockPhysicalControls.js +3 -0
  134. package/dist/shared/accessory/characteristic/LockPhysicalControls.js.map +1 -0
  135. package/dist/shared/accessory/characteristic/MotionDetected.js.map +1 -0
  136. package/dist/shared/accessory/characteristic/Name.js.map +1 -0
  137. package/dist/shared/accessory/characteristic/OccupancyDetected.js.map +1 -0
  138. package/dist/shared/{accessories → accessory}/characteristic/On.js +3 -2
  139. package/dist/shared/accessory/characteristic/On.js.map +1 -0
  140. package/dist/shared/accessory/characteristic/OutletInUse.js.map +1 -0
  141. package/dist/shared/accessory/characteristic/ProgrammableSwitchEvent.js.map +1 -0
  142. package/dist/shared/accessory/characteristic/RawOn.js +93 -0
  143. package/dist/shared/accessory/characteristic/RawOn.js.map +1 -0
  144. package/dist/shared/{accessories → accessory}/characteristic/RelativeHumidityDehumidifierThreshold.js +3 -0
  145. package/dist/shared/accessory/characteristic/RelativeHumidityDehumidifierThreshold.js.map +1 -0
  146. package/dist/shared/accessory/characteristic/RotationSpeed.js +157 -0
  147. package/dist/shared/accessory/characteristic/RotationSpeed.js.map +1 -0
  148. package/dist/shared/accessory/characteristic/SecuritySystemState.js.map +1 -0
  149. package/dist/shared/{accessories → accessory}/characteristic/SwingMode.js +3 -0
  150. package/dist/shared/accessory/characteristic/SwingMode.js.map +1 -0
  151. package/dist/shared/accessory/characteristic/TargetTemperature.js.map +1 -0
  152. package/dist/shared/{accessories → accessory}/characteristic/TemperatureDisplayUnits.js +9 -2
  153. package/dist/shared/accessory/characteristic/TemperatureDisplayUnits.js.map +1 -0
  154. package/dist/shared/util/ConfigHash.js +2 -2
  155. package/dist/shared/util/ConfigHash.js.map +1 -1
  156. package/dist/shared/util/ConfigMigrator.js +222 -0
  157. package/dist/shared/util/ConfigMigrator.js.map +1 -0
  158. package/dist/shared/util/FfmpegStreamingProcess.js +62 -0
  159. package/dist/shared/util/FfmpegStreamingProcess.js.map +1 -1
  160. package/dist/shared/util/InfraredTool.js +0 -2
  161. package/dist/shared/util/InfraredTool.js.map +1 -1
  162. package/dist/shared/util/Logger.js +85 -10
  163. package/dist/shared/util/Logger.js.map +1 -1
  164. package/dist/shared/util/TuyaStreamDelegate.js +201 -99
  165. package/dist/shared/util/TuyaStreamDelegate.js.map +1 -1
  166. package/dist/shared/util/color.js +15 -4
  167. package/dist/shared/util/color.js.map +1 -1
  168. package/dist/shared/util/util.js +91 -5
  169. package/dist/shared/util/util.js.map +1 -1
  170. package/docs/ADVANCED_OPTIONS.md +623 -0
  171. package/docs/CONFIG_GUIDE.md +616 -0
  172. package/docs/Get-Local-Keys-for-Your-Devices.md +246 -0
  173. package/{SUPPORTED_DEVICES.md → docs/SUPPORTED_DEVICES.md} +27 -5
  174. package/eslint.config.mjs +0 -1
  175. package/{jest.config.js → jest.config.ts} +5 -2
  176. package/package.json +14 -11
  177. package/test/ConfigMigrator.test.ts +1060 -0
  178. package/test/FanAccessory.test.ts +458 -0
  179. package/test/Light.test.ts +424 -0
  180. package/test/Logger.test.ts +482 -0
  181. package/test/ProtocolV31V32.test.ts +42 -0
  182. package/test/accessoryFactory.data.test.ts +176 -0
  183. package/test/accessoryFactory.test.ts +65 -35
  184. package/test/airConditioner.swing.test.ts +226 -0
  185. package/test/airConditioner.test.ts +770 -0
  186. package/test/color.test.ts +52 -0
  187. package/test/config.test.ts +17 -13
  188. package/test/custom.test.ts +2 -2
  189. package/test/errorHandling.test.ts +12 -12
  190. package/test/fanAccessory.test.ts +458 -0
  191. package/test/home.test.ts +1 -1
  192. package/test/hybridDeviceManager.test.ts +808 -0
  193. package/test/infraredTools.test.ts +67 -0
  194. package/test/light.test.ts +424 -0
  195. package/test/localDevice.test.ts +31 -53
  196. package/test/localDeviceManager.behavior.test.ts +211 -37
  197. package/test/localDeviceManager.test.ts +124 -41
  198. package/test/mqttMessages.test.ts +40 -16
  199. package/test/platform.test.ts +380 -814
  200. package/test/platform.validation.local.test.ts +90 -120
  201. package/test/protocol.test.ts +27 -12
  202. package/test/protocol35Frames.test.ts +204 -0
  203. package/test/rotationSpeed.test.ts +150 -0
  204. package/test/tuyaCustomDeviceManager.test.ts +111 -17
  205. package/test/tuyaDeviceManager.test.ts +655 -645
  206. package/test/tuyaDiscovery.test.ts +21 -33
  207. package/test/tuyaHomeDeviceManager.test.ts +114 -19
  208. package/test/tuyaOpenAPI.test.ts +25 -44
  209. package/test/tuyaOpenMQ.test.ts +15 -23
  210. package/test/util.test.ts +107 -7
  211. package/test/zigbee/LocalDevice.zigbee.test.ts +14 -18
  212. package/test/zigbee/LocalDeviceManager.cloud-discovery.test.ts +19 -20
  213. package/test/zigbee/LocalDeviceManager.zigbee.reconnect.test.ts +19 -20
  214. package/test/zigbee/LocalDeviceManager.zigbee.test.ts +73 -35
  215. package/test/zigbee/ZigbeeGatewayDetection.test.ts +2 -2
  216. package/ADVANCED_OPTIONS.md +0 -267
  217. package/dist/cloud/device/TuyaDeviceManager.js.map +0 -1
  218. package/dist/local/CloudLocalReconciliation.js +0 -180
  219. package/dist/local/CloudLocalReconciliation.js.map +0 -1
  220. package/dist/shared/accessories/AccessoryFactory.js +0 -309
  221. package/dist/shared/accessories/AccessoryFactory.js.map +0 -1
  222. package/dist/shared/accessories/AirConditionerAccessory.js.map +0 -1
  223. package/dist/shared/accessories/AirQualitySensorAccessory.js.map +0 -1
  224. package/dist/shared/accessories/BaseAccessory.js.map +0 -1
  225. package/dist/shared/accessories/CameraAccessory.js.map +0 -1
  226. package/dist/shared/accessories/FanAccessory.js.map +0 -1
  227. package/dist/shared/accessories/GarageDoorAccessory.js.map +0 -1
  228. package/dist/shared/accessories/HeaterAccessory.js.map +0 -1
  229. package/dist/shared/accessories/HumanPresenceSensorAccessory.js.map +0 -1
  230. package/dist/shared/accessories/IRAirConditionerAccessory.js.map +0 -1
  231. package/dist/shared/accessories/IRControlHubAccessory.js.map +0 -1
  232. package/dist/shared/accessories/IRControlHubSubAccessory.js.map +0 -1
  233. package/dist/shared/accessories/IRGenericAccessory.js.map +0 -1
  234. package/dist/shared/accessories/LocationWeatherAccessory.js.map +0 -1
  235. package/dist/shared/accessories/MotionSensorAccessory.js.map +0 -1
  236. package/dist/shared/accessories/OutletAccessory.js.map +0 -1
  237. package/dist/shared/accessories/SceneAccessory.js.map +0 -1
  238. package/dist/shared/accessories/SceneSwitchAccessory.js.map +0 -1
  239. package/dist/shared/accessories/SecuritySystemAccessory.js.map +0 -1
  240. package/dist/shared/accessories/SwitchAccessory.js.map +0 -1
  241. package/dist/shared/accessories/TemperatureHumiditySensorAccessory.js.map +0 -1
  242. package/dist/shared/accessories/WeatherStationAccessory.js.map +0 -1
  243. package/dist/shared/accessories/WetBulbGlobeTemperatureAccessory.js.map +0 -1
  244. package/dist/shared/accessories/WhiteNoiseLightAccessory.js.map +0 -1
  245. package/dist/shared/accessories/WindowAccessory.js.map +0 -1
  246. package/dist/shared/accessories/characteristic/Active.js.map +0 -1
  247. package/dist/shared/accessories/characteristic/AirQuality.js.map +0 -1
  248. package/dist/shared/accessories/characteristic/CurrentRelativeHumidity.js.map +0 -1
  249. package/dist/shared/accessories/characteristic/CurrentTemperature.js.map +0 -1
  250. package/dist/shared/accessories/characteristic/CurrentWeather.js.map +0 -1
  251. package/dist/shared/accessories/characteristic/CurrentWeatherByOpenMeteo.js.map +0 -1
  252. package/dist/shared/accessories/characteristic/CurrentWetBulbGlobeTemperature.js.map +0 -1
  253. package/dist/shared/accessories/characteristic/EnergyUsage.js.map +0 -1
  254. package/dist/shared/accessories/characteristic/Light.js.map +0 -1
  255. package/dist/shared/accessories/characteristic/LightSensor.js.map +0 -1
  256. package/dist/shared/accessories/characteristic/LockPhysicalControls.js.map +0 -1
  257. package/dist/shared/accessories/characteristic/MotionDetected.js.map +0 -1
  258. package/dist/shared/accessories/characteristic/Name.js.map +0 -1
  259. package/dist/shared/accessories/characteristic/OccupancyDetected.js.map +0 -1
  260. package/dist/shared/accessories/characteristic/On.js.map +0 -1
  261. package/dist/shared/accessories/characteristic/OutletInUse.js.map +0 -1
  262. package/dist/shared/accessories/characteristic/ProgrammableSwitchEvent.js.map +0 -1
  263. package/dist/shared/accessories/characteristic/RelativeHumidityDehumidifierThreshold.js.map +0 -1
  264. package/dist/shared/accessories/characteristic/RotationSpeed.js +0 -78
  265. package/dist/shared/accessories/characteristic/RotationSpeed.js.map +0 -1
  266. package/dist/shared/accessories/characteristic/SecuritySystemState.js.map +0 -1
  267. package/dist/shared/accessories/characteristic/SwingMode.js.map +0 -1
  268. package/dist/shared/accessories/characteristic/TargetTemperature.js.map +0 -1
  269. package/dist/shared/accessories/characteristic/TemperatureDisplayUnits.js.map +0 -1
  270. package/test/zigbee/CloudLocalReconciliation.test.ts +0 -284
  271. package/tuya-local-configs/dev-1.hash +0 -1
  272. package/tuya-local-configs/device1.hash +0 -1
  273. package/wiki/Get-Local-Keys-for-Your-Devices.md +0 -85
  274. /package/dist/shared/{accessories → accessory}/AirPurifierAccessory.js +0 -0
  275. /package/dist/shared/{accessories → accessory}/AirQualitySensorAccessory.js +0 -0
  276. /package/dist/shared/{accessories → accessory}/BlindsAccessory.js +0 -0
  277. /package/dist/shared/{accessories → accessory}/CarbonDioxideSensorAccessory.js +0 -0
  278. /package/dist/shared/{accessories → accessory}/CarbonMonoxideSensorAccessory.js +0 -0
  279. /package/dist/shared/{accessories → accessory}/ContactSensorAccessory.js +0 -0
  280. /package/dist/shared/{accessories → accessory}/DehumidifierAccessory.js +0 -0
  281. /package/dist/shared/{accessories → accessory}/DiffuserAccessory.js +0 -0
  282. /package/dist/shared/{accessories → accessory}/DimmerAccessory.js +0 -0
  283. /package/dist/shared/{accessories → accessory}/DoorbellAccessory.js +0 -0
  284. /package/dist/shared/{accessories → accessory}/ExtractionHoodAccessory.js +0 -0
  285. /package/dist/shared/{accessories → accessory}/HeaterAccessory_old.js +0 -0
  286. /package/dist/shared/{accessories → accessory}/HumanPresenceSensorAccessory.js +0 -0
  287. /package/dist/shared/{accessories → accessory}/HumidifierAccessory.js +0 -0
  288. /package/dist/shared/{accessories → accessory}/IRControlHubAccessory.js +0 -0
  289. /package/dist/shared/{accessories → accessory}/IRControlHubSubAccessory.js +0 -0
  290. /package/dist/shared/{accessories → accessory}/IRGenericAccessory.js +0 -0
  291. /package/dist/shared/{accessories → accessory}/LeakSensorAccessory.js +0 -0
  292. /package/dist/shared/{accessories → accessory}/LightAccessory.js +0 -0
  293. /package/dist/shared/{accessories → accessory}/LightSensorAccessory.js +0 -0
  294. /package/dist/shared/{accessories → accessory}/MotionSensorAccessory.js +0 -0
  295. /package/dist/shared/{accessories → accessory}/OutletAccessory.js +0 -0
  296. /package/dist/shared/{accessories → accessory}/PetFeederAccessory.js +0 -0
  297. /package/dist/shared/{accessories → accessory}/SceneSwitchAccessory.js +0 -0
  298. /package/dist/shared/{accessories → accessory}/SmokeSensorAccessory.js +0 -0
  299. /package/dist/shared/{accessories → accessory}/TemperatureHumiditySensorAccessory.js +0 -0
  300. /package/dist/shared/{accessories → accessory}/ThermostatAccessory.js +0 -0
  301. /package/dist/shared/{accessories → accessory}/TowerRackAccessory.js +0 -0
  302. /package/dist/shared/{accessories → accessory}/ValveAccessory.js +0 -0
  303. /package/dist/shared/{accessories → accessory}/VibrationSensorAccessory.js +0 -0
  304. /package/dist/shared/{accessories → accessory}/WeatherStationAccessory.js +0 -0
  305. /package/dist/shared/{accessories → accessory}/WetBulbGlobeTemperatureAccessory.js +0 -0
  306. /package/dist/shared/{accessories → accessory}/WindowAccessory.js +0 -0
  307. /package/dist/shared/{accessories → accessory}/WindowCoveringAccessory.js +0 -0
  308. /package/dist/shared/{accessories → accessory}/WirelessSwitchAccessory.js +0 -0
  309. /package/dist/shared/{accessories → accessory}/characteristic/Active.js +0 -0
  310. /package/dist/shared/{accessories → accessory}/characteristic/AirQuality.js +0 -0
  311. /package/dist/shared/{accessories → accessory}/characteristic/CurrentTemperature.js +0 -0
  312. /package/dist/shared/{accessories → accessory}/characteristic/CurrentWeather.js +0 -0
  313. /package/dist/shared/{accessories → accessory}/characteristic/CurrentWeatherByOpenMeteo.js +0 -0
  314. /package/dist/shared/{accessories → accessory}/characteristic/LightSensor.js +0 -0
  315. /package/dist/shared/{accessories → accessory}/characteristic/MotionDetected.js +0 -0
  316. /package/dist/shared/{accessories → accessory}/characteristic/Name.js +0 -0
  317. /package/dist/shared/{accessories → accessory}/characteristic/OccupancyDetected.js +0 -0
  318. /package/dist/shared/{accessories → accessory}/characteristic/OutletInUse.js +0 -0
  319. /package/dist/shared/{accessories → accessory}/characteristic/ProgrammableSwitchEvent.js +0 -0
  320. /package/dist/shared/{accessories → accessory}/characteristic/SecuritySystemState.js +0 -0
  321. /package/dist/shared/{accessories → accessory}/characteristic/TargetTemperature.js +0 -0
@@ -5,6 +5,413 @@
5
5
  "headerDisplay": "<p align='center'><img height='60px' src='https://user-images.githubusercontent.com/3979615/78354049-dc7ff780-75f6-11ea-8026-2f8bf81d8331.png'></p>",
6
6
  "footerDisplay": "",
7
7
  "customUi": false,
8
+ "layout": [
9
+ {
10
+ "type": "radiobuttons",
11
+ "key": "mode",
12
+ "style": { "selected": "btn-secondary", "unselected": "btn-outline-secondary" }
13
+ },
14
+ {
15
+ "type": "fieldset",
16
+ "items": [
17
+ {
18
+ "type": "tabs",
19
+ "tabs": [
20
+ {
21
+ "type": "fieldset",
22
+ "title": "Local Settings",
23
+ "notitle": true,
24
+ "items": [
25
+ {
26
+ "type": "help",
27
+ "labelHtmlClass": "alert-link alert-warning",
28
+ "helpvalue": "⚠These settings are currently inactive because Cloud mode is enabled.",
29
+ "condition": { "functionBody": "return (model.mode === 'cloud')" }
30
+ },
31
+ "local.autoDiscoverDevices",
32
+ "local.discoverTimeout",
33
+ "local.rediscoverInterval",
34
+ {
35
+ "key": "local.devices",
36
+ "add": "Add Manual Device",
37
+ "title": "{{ 'Add New Device' }}",
38
+ "type": "tabarray",
39
+ "notitle": true,
40
+ "items": [
41
+ {
42
+ "type": "div",
43
+ "displayFlex": false,
44
+ "notitle": true,
45
+ "title": "{{ value.name || value.tuyaDeviceId || 'New Device' }}",
46
+ "items": [
47
+ "local.devices[].category",
48
+ "local.devices[].name",
49
+ "local.devices[].tuyaDeviceId",
50
+ "local.devices[].tuyaKey",
51
+ "local.devices[].ip",
52
+ "local.devices[].protocolVersion",
53
+ "local.devices[].dpMapping",
54
+ "local.devices[].outletCount",
55
+ {
56
+ "type": "help",
57
+ "labelHtmlClass": "alert-link alert-warning",
58
+ "helpvalue": "Set up the camera streaming in the Common Settings > RTSP Camera Settings.",
59
+ "condition": { "functionBody": "return (model.local?.devices?.[arrayIndices[0]].category === 'sp')" }
60
+ },
61
+ {
62
+ "type": "fieldset",
63
+ "items": [
64
+ "local.devices[].dpMapping.add_ele",
65
+ "local.devices[].dpMapping.air_quality",
66
+ "local.devices[].dpMapping.alarm_message",
67
+ "local.devices[].dpMapping.alarm_propel_switch",
68
+ "local.devices[].dpMapping.battery_percentage",
69
+ "local.devices[].dpMapping.bright_value",
70
+ "local.devices[].dpMapping.bright_value_v2",
71
+ "local.devices[].dpMapping.child_lock",
72
+ "local.devices[].dpMapping.co2_state",
73
+ "local.devices[].dpMapping.co2_value",
74
+ "local.devices[].dpMapping.co_status",
75
+ "local.devices[].dpMapping.co_value",
76
+ "local.devices[].dpMapping.colour_data",
77
+ "local.devices[].dpMapping.colour_data_v2",
78
+ "local.devices[].dpMapping.control",
79
+ "local.devices[].dpMapping.cur_current",
80
+ "local.devices[].dpMapping.cur_power",
81
+ "local.devices[].dpMapping.cur_voltage",
82
+ "local.devices[].dpMapping.dehumidify_set_value",
83
+ "local.devices[].dpMapping.doorbell_call",
84
+ "local.devices[].dpMapping.doorbell_pic",
85
+ "local.devices[].dpMapping.doorbell_ring_exist",
86
+ "local.devices[].dpMapping.doorbell_volume_value",
87
+ "local.devices[].dpMapping.doorcontact_state",
88
+ "local.devices[].dpMapping.fan_direction",
89
+ "local.devices[].dpMapping.fan_speed",
90
+ "local.devices[].dpMapping.fan_speed_enum",
91
+ "local.devices[].dpMapping.feed_report",
92
+ "local.devices[].dpMapping.feed_state",
93
+ "local.devices[].dpMapping.floodlight_lightness",
94
+ "local.devices[].dpMapping.floodlight_switch",
95
+ "local.devices[].dpMapping.gas_sensor_status",
96
+ "local.devices[].dpMapping.humidity_current",
97
+ "local.devices[].dpMapping.humidity_indoor",
98
+ "local.devices[].dpMapping.humidity_set",
99
+ "local.devices[].dpMapping.level",
100
+ "local.devices[].dpMapping.light",
101
+ "local.devices[].dpMapping.lock",
102
+ "local.devices[].dpMapping.lock_motor_state",
103
+ "local.devices[].dpMapping.manual_feed",
104
+ "local.devices[].dpMapping.master_mode",
105
+ "local.devices[].dpMapping.meal_plan",
106
+ "local.devices[].dpMapping.mode",
107
+ "local.devices[].dpMapping.motion_switch",
108
+ "local.devices[].dpMapping.movement_detect_pic",
109
+ "local.devices[].dpMapping.open_close",
110
+ "local.devices[].dpMapping.percent_control",
111
+ "local.devices[].dpMapping.percent_state",
112
+ "local.devices[].dpMapping.pir",
113
+ "local.devices[].dpMapping.pir_state",
114
+ "local.devices[].dpMapping.pm10_value",
115
+ "local.devices[].dpMapping.pm25",
116
+ "local.devices[].dpMapping.pm25_value",
117
+ "local.devices[].dpMapping.position",
118
+ "local.devices[].dpMapping.presence_state",
119
+ "local.devices[].dpMapping.quick_feed",
120
+ "local.devices[].dpMapping.shake",
121
+ "local.devices[].dpMapping.shock_state",
122
+ "local.devices[].dpMapping.slow_feed",
123
+ "local.devices[].dpMapping.smoke_sensor_status",
124
+ "local.devices[].dpMapping.sos_state",
125
+ "local.devices[].dpMapping.speed",
126
+ "local.devices[].dpMapping.swing",
127
+ "local.devices[].dpMapping.switch",
128
+ "local.devices[].dpMapping.switch_1",
129
+ "local.devices[].dpMapping.switch_fan",
130
+ "local.devices[].dpMapping.switch_horizontal",
131
+ "local.devices[].dpMapping.switch_inching",
132
+ "local.devices[].dpMapping.switch_led",
133
+ "local.devices[].dpMapping.switch_mode1",
134
+ "local.devices[].dpMapping.switch_music",
135
+ "local.devices[].dpMapping.switch_pir",
136
+ "local.devices[].dpMapping.switch_sound",
137
+ "local.devices[].dpMapping.switch_spray",
138
+ "local.devices[].dpMapping.temp_current",
139
+ "local.devices[].dpMapping.temp_indoor",
140
+ "local.devices[].dpMapping.temp_set",
141
+ "local.devices[].dpMapping.temp_unit_convert",
142
+ "local.devices[].dpMapping.temp_value",
143
+ "local.devices[].dpMapping.temp_value_v2",
144
+ "local.devices[].dpMapping.tvoc",
145
+ "local.devices[].dpMapping.va_humidity",
146
+ "local.devices[].dpMapping.va_temperature",
147
+ "local.devices[].dpMapping.voc_value",
148
+ "local.devices[].dpMapping.work_mode",
149
+ "local.devices[].dpMapping.work_state",
150
+ "local.devices[].dpMapping.work_status"
151
+ ]
152
+ },
153
+ {
154
+ "key": "local.devices[].dpMappingArray",
155
+ "type": "array",
156
+ "listItems": 3,
157
+ "items": [
158
+ {
159
+ "type": "div",
160
+ "displayFlex": true,
161
+ "flex-direction": "row",
162
+ "items": [
163
+ {
164
+ "key": "local.devices[].dpMappingArray[].dpCode",
165
+ "placeholder": "switch"
166
+ },
167
+ {
168
+ "key": "local.devices[].dpMappingArray[].dpID",
169
+ "placeholder": "1"
170
+ }
171
+ ]
172
+ }
173
+ ]
174
+ }
175
+ ]
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ },
181
+ {
182
+ "type": "fieldset",
183
+ "title": "Cloud Settings",
184
+ "notitle": true,
185
+ "items": [
186
+ {
187
+ "type": "help",
188
+ "labelHtmlClass": "alert-link alert-warning",
189
+ "helpvalue": "⚠These settings are currently inactive because Local mode is enabled.",
190
+ "condition": { "functionBody": "return (model.mode === 'local')" }
191
+ },
192
+ {
193
+ "type": "fieldset",
194
+ "title": "Tuya Cloud Account Info",
195
+ "expandable": true,
196
+ "expanded": true,
197
+ "items": [
198
+ "options.projectType",
199
+ "options.endpoint",
200
+ "options.accessId",
201
+ "options.accessKey",
202
+ "options.countryCode",
203
+ "options.username",
204
+ "options.password",
205
+ "options.appSchema"
206
+ ]
207
+ },
208
+ {
209
+ "type": "fieldset",
210
+ "title": "Tuya Home Settings",
211
+ "expandable": true,
212
+ "expanded": false,
213
+ "items": [
214
+ {
215
+ "key": "options.homeWhitelist",
216
+ "add": "Add Another Home ID",
217
+ "type": "tabarray",
218
+ "items": [
219
+ {
220
+ "type": "div",
221
+ "title": "{{ value }}",
222
+ "items": [ "options.homeWhitelist[]" ]
223
+ }
224
+ ]
225
+ }
226
+ ]
227
+ },
228
+ {
229
+ "type": "fieldset",
230
+ "title": "Advance Settings",
231
+ "expandable": true,
232
+ "expanded": false,
233
+ "items": [
234
+ "options.generateWeatherAccessory",
235
+ "options.weatherAPI",
236
+ "options.forceIPv4"
237
+ ]
238
+ }
239
+ ]
240
+ },
241
+ {
242
+ "type": "fieldset",
243
+ "title": "Common Settings",
244
+ "notitle": true,
245
+ "items": [
246
+ {
247
+ "type": "fieldset",
248
+ "title": "Tuya Device Settings",
249
+ "expandable": true,
250
+ "expanded": true,
251
+ "items": [
252
+ {
253
+ "key": "options.deviceOverrides",
254
+ "add": "Add Another Device Override",
255
+ "title": "{{ value.id || 'New Device Override' }}",
256
+ "type": "tabarray",
257
+ "default": [],
258
+ "items": [
259
+ {
260
+ "type": "div",
261
+ "items": [
262
+ "options.deviceOverrides[].id",
263
+ "options.deviceOverrides[].category",
264
+ "options.deviceOverrides[].unbridged",
265
+ "options.deviceOverrides[].addExtraFeaturesAutomatically",
266
+ "options.deviceOverrides[].adaptiveLighting",
267
+ "options.deviceOverrides[].configFor",
268
+ {
269
+ "key": "options.deviceOverrides[].schema",
270
+ "add": "Add New Schema",
271
+ "title": "{{ value.code }}",
272
+ "type": "tabarray",
273
+ "items": [
274
+ {
275
+ "type": "div",
276
+ "items": [
277
+ "options.deviceOverrides[].schema[].code",
278
+ "options.deviceOverrides[].schema[].newCode",
279
+ "options.deviceOverrides[].schema[].hidden",
280
+ "options.deviceOverrides[].schema[].extra",
281
+ "options.deviceOverrides[].schema[].type",
282
+ "options.deviceOverrides[].schema[].onGet",
283
+ "options.deviceOverrides[].schema[].onSet",
284
+ {
285
+ "key": "options.deviceOverrides[].schema[].property",
286
+ "items": [
287
+ "options.deviceOverrides[].schema[].property.min",
288
+ "options.deviceOverrides[].schema[].property.max",
289
+ "options.deviceOverrides[].schema[].property.scale",
290
+ "options.deviceOverrides[].schema[].property.step",
291
+ {
292
+ "key": "options.deviceOverrides[].schema[].property.range",
293
+ "add": "Add Range",
294
+ "title": "{{ value }}",
295
+ "type": "tabarray",
296
+ "items": [
297
+ {
298
+ "type": "div",
299
+ "items": [ "options.deviceOverrides[].schema[].property.range[]" ]
300
+ }
301
+ ]
302
+ }
303
+ ]
304
+ },
305
+ {
306
+ "key": "options.deviceOverrides[].schema[].extraRawSwitch",
307
+ "type": "array",
308
+ "items": [
309
+ {
310
+ "type": "fieldset",
311
+ "items": [
312
+ { "key": "options.deviceOverrides[].schema[].extraRawSwitch[].configuredName" },
313
+ {
314
+ "type": "flex",
315
+ "flex-flow": "row wrap",
316
+ "items": [
317
+ { "key": "options.deviceOverrides[].schema[].extraRawSwitch[].byteIndex", "flex-basis": "min-content" },
318
+ { "key": "options.deviceOverrides[].schema[].extraRawSwitch[].value" }
319
+ ]
320
+ }
321
+ ]
322
+ }
323
+ ]
324
+ }
325
+ ]
326
+ }
327
+ ]
328
+ }
329
+ ]
330
+ }
331
+ ]
332
+ }
333
+ ]
334
+ },
335
+ {
336
+ "type": "fieldset",
337
+ "title": "Accessory Service Informations",
338
+ "expandable": true,
339
+ "expanded": false,
340
+ "notitle": false,
341
+ "items": [
342
+ {
343
+ "key": "options.serviceInformationOverrides",
344
+ "add": "Add Another Service Information Override",
345
+ "title": "{{ 'New Service Information Override' }}",
346
+ "type": "tabarray",
347
+ "default": [],
348
+ "items": [
349
+ {
350
+ "type": "div",
351
+ "title": "{{ value.configuredName || value.device_id }}",
352
+ "items": [
353
+ "options.serviceInformationOverrides[].device_id",
354
+ "options.serviceInformationOverrides[].index",
355
+ "options.serviceInformationOverrides[].manifacturer",
356
+ "options.serviceInformationOverrides[].model",
357
+ "options.serviceInformationOverrides[].firmwareRevision",
358
+ "options.serviceInformationOverrides[].configuredName"
359
+ ]
360
+ }
361
+ ]
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "type": "fieldset",
367
+ "title": "RTSP Camera Settings",
368
+ "expandable": true,
369
+ "expanded": false,
370
+ "notitle": false,
371
+ "items": [
372
+ {
373
+ "key": "cameras",
374
+ "add": "Add Camera",
375
+ "title": "{{ 'New Camera' }}",
376
+ "type": "tabarray",
377
+ "notitle": true,
378
+ "items": [
379
+ {
380
+ "type": "div",
381
+ "displayFlex": false,
382
+ "flex-direction": "row",
383
+ "notitle": true,
384
+ "title": "{{ value.deviceName }}",
385
+ "items": [
386
+ "cameras[].deviceId",
387
+ "cameras[].deviceName",
388
+ "cameras[].rtspUrl",
389
+ "cameras[].username",
390
+ "cameras[].password"
391
+ ]
392
+ }
393
+ ]
394
+ }
395
+ ]
396
+ },
397
+ {
398
+ "type": "fieldset",
399
+ "title": "Debug Settings",
400
+ "expandable": true,
401
+ "expanded": false,
402
+ "notitle": false,
403
+ "items": [
404
+ "common.debug",
405
+ "common.debugLevel"
406
+ ]
407
+ }
408
+ ]
409
+ }
410
+ ]
411
+ }
412
+ ]
413
+ }
414
+ ],
8
415
  "schema": {
9
416
  "type": "object",
10
417
  "required": ["mode"],
@@ -20,18 +427,15 @@
20
427
  "type": "string",
21
428
  "default": "cloud",
22
429
  "oneOf": [
23
- { "title": "Cloud (Tuya OpenAPI)", "enum": ["cloud"] },
24
430
  { "title": "Local (LAN / direct TCP)", "enum": ["local"] },
431
+ { "title": "Cloud (Tuya OpenAPI)", "enum": ["cloud"] },
25
432
  { "title": "Both (Cloud + Local)", "enum": ["both"] }
26
433
  ]
27
434
  },
28
435
  "local": {
29
436
  "title": "Local Settings",
30
- "description": "Configure local LAN devices. For help getting local keys, see the <a href='#' onClick='alert(\"Visit: wiki/Get-Local-Keys-for-Your-Devices.md\")'>Local Keys Setup Guide</a>.",
437
+ "description": "Configure local LAN devices. For help getting local keys, see the <a href='#' onClick='alert(\"Visit: docs/Get-Local-Keys-for-Your-Devices.md\")'>Local Keys Setup Guide</a>.",
31
438
  "type": "object",
32
- "condition": {
33
- "functionBody": "return (model.mode === 'local' || model.mode === 'both');"
34
- },
35
439
  "properties": {
36
440
  "autoDiscoverDevices": {
37
441
  "title": "Auto-Discover Devices",
@@ -62,6 +466,7 @@
62
466
  "default": [],
63
467
  "items": {
64
468
  "type": "object",
469
+ "required": ["category"],
65
470
  "properties": {
66
471
  "category": {
67
472
  "title": "Type",
@@ -76,27 +481,42 @@
76
481
  { "title": "Smart Outlet / Power Strip", "enum": ["cz"] },
77
482
  { "title": "Wireless Remote Switch", "enum": ["wxkg"] },
78
483
  { "title": "Scene Switch", "enum": ["cjkg"] },
484
+ { "title": "WhiteNoiseLight", "enum": ["bzyd"] },
79
485
  { "title": "Air Conditioner", "enum": ["kt"] },
80
486
  { "title": "Heater / Convector", "enum": ["qn"] },
81
487
  { "title": "Air Purifier", "enum": ["kj"] },
82
- { "title": "Humidifier / Diffuser", "enum": ["xxj"] },
488
+ { "title": "Diffuser", "enum": ["xxj"] },
83
489
  { "title": "Garage Door", "enum": ["ckmkzq"] },
84
- { "title": "Window Covering / Blind", "enum": ["cl"] },
85
- { "title": "Smart Lock", "enum": ["ms"] },
490
+ { "title": "Blind", "enum": ["mg"] },
491
+ { "title": "Window Covering", "enum": ["cl"] },
492
+ { "title": "Pet Feeder", "enum": ["cwwsq"] },
86
493
  { "title": "Window / Door Sensor", "enum": ["mc"] },
87
- { "title": "Contact Sensor", "enum": ["hj"] },
88
- { "title": "Leak Sensor", "enum": ["yc"] },
89
- { "title": "Motion Sensor", "enum": ["pir"] },
90
- { "title": "Smoke Sensor", "enum": ["yw"] },
91
- { "title": "Temperature/Humidity Sensor", "enum": ["wsdcz"] },
92
- { "title": "Light Sensor", "enum": ["gd"] },
93
- { "title": "Air Quality Sensor", "enum": ["kqbj"] },
94
494
  { "title": "Thermostat", "enum": ["wk"] },
95
495
  { "title": "Towel Rack / Warmer", "enum": ["mjj"] },
496
+ { "title": "Valve", "enum": ["ggq"] },
497
+ { "title": "Humidifier", "enum": ["jsq"] },
498
+ { "title": "Dehumidifier", "enum": ["cs"] },
96
499
  { "title": "Fan", "enum": ["fs"] },
97
- { "title": "Doorbell / Camera", "enum": ["mb"] },
98
- { "title": "Pet Feeder", "enum": ["cwwsq"] },
99
- { "title": "Security System", "enum": ["aq"] },
500
+ { "title": "ExtractionHood", "enum": ["yyj"] },
501
+ { "title": "Camera", "enum": ["sp"] },
502
+ { "title": "Smoke Sensor", "enum": ["ywbj"] },
503
+ { "title": "Contact Sensor", "enum": ["mcs"] },
504
+ { "title": "Vibration Sensor", "enum": ["zd"] },
505
+ { "title": "Leak Sensor", "enum": ["rqbj"] },
506
+ { "title": "CarbonMonoxide Sensor", "enum": ["cobj"] },
507
+ { "title": "CarbonDioxide Sensor", "enum": ["co2bj"] },
508
+ { "title": "Temperature/Humidity Sensor", "enum": ["wsdcg"] },
509
+ { "title": "Light Sensor", "enum": ["ldcg"] },
510
+ { "title": "Motion Sensor", "enum": ["pir"] },
511
+ { "title": "Air Quality Sensor", "enum": ["pm25"] },
512
+ { "title": "HumanPresence Sensor", "enum": ["hps"] },
513
+ { "title": "Smart Lock", "enum": ["ms"] },
514
+ { "title": "Security System", "enum": ["mal"] },
515
+ { "title": "Doorbell", "enum": ["wxml"] },
516
+ { "title": "WeatherStation", "enum": ["qxj"] },
517
+ { "title": "IRControlHub", "enum": ["wnykq"] },
518
+ { "title": "IRControlHubSub", "enum": ["qt"] },
519
+ { "title": "IRGeneric", "enum": ["infrared_"] },
100
520
  { "title": "Custom / Other", "enum": ["other"] }
101
521
  ]
102
522
  },
@@ -104,517 +524,737 @@
104
524
  "title": "Device ID",
105
525
  "description": "The Tuya device ID (same as the cloud device ID).",
106
526
  "type": "string",
107
- "condition": {
108
- "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
109
- }
527
+ "condition": { "functionBody": "return !!model.local?.devices?.[arrayIndices[0]]?.category;" }
110
528
  },
111
529
  "tuyaKey": {
112
530
  "title": "Local Key",
113
531
  "description": "The 16-character AES local key for direct communication.",
114
532
  "type": "string",
115
- "condition": {
116
- "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
117
- }
533
+ "condition": { "functionBody": "return !!model.local?.devices?.[arrayIndices[0]]?.category;" }
118
534
  },
119
535
  "ip": {
120
536
  "title": "IP Address",
121
537
  "description": "Fixed IP address. Leave blank to use auto-discovery.",
122
538
  "type": "string",
123
- "condition": {
124
- "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
125
- }
539
+ "condition": { "functionBody": "return !!model.local?.devices?.[arrayIndices[0]]?.category;" }
126
540
  },
127
541
  "name": {
128
542
  "title": "Name",
129
543
  "description": "Anything you'd like to use to identify this device.",
130
544
  "type": "string",
131
- "condition": {
132
- "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
133
- }
545
+ "condition": { "functionBody": "return !!model.local?.devices?.[arrayIndices[0]]?.category;" }
134
546
  },
135
547
  "protocolVersion": {
136
548
  "title": "Protocol Version",
137
549
  "description": "Tuya local protocol version. Leave blank to auto-detect.",
138
550
  "type": "string",
139
- "condition": {
140
- "functionBody": "return model.local && model.local.devices && model.local.devices[arrayIndices[0]] && model.local.devices[arrayIndices[0]].category !== '';"
141
- }
551
+ "condition": { "functionBody": "return !!model.local?.devices?.[arrayIndices[0]]?.category;" }
142
552
  },
143
- "dpMapping": {
553
+ "dpMappingArray": {
144
554
  "title": "Custom DP Mapping (Advanced)",
145
- "description": "Override default DP-to-function mappings as JSON. Example: {\"switch_1\": 1, \"bright_value\": 2, \"temp_value\": 3}",
146
- "type": "object",
147
- "additionalProperties": {
148
- "type": "integer"
149
- },
150
- "condition": {
151
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) !== '';"
152
- }
153
- },
154
- "outletCount": {
155
- "type": "integer",
156
- "title": "Outlet Count",
157
- "placeholder": 5,
158
- "condition": {
159
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
160
- }
161
- },
162
- "isZigbeeGateway": {
163
- "title": "Zigbee Gateway",
164
- "description": "Mark this device as a Zigbee gateway. Usually auto-detected if other devices reference this device as their parent.",
165
- "type": "boolean",
166
- "default": false
167
- },
168
- "parentDeviceId": {
169
- "title": "Parent Gateway Device ID",
170
- "description": "For Zigbee sub-devices: the Tuya device ID of the parent gateway. Commands are routed through the parent's TCP connection using the Zigbee CID.",
171
- "type": "string"
172
- },
173
- "zigbeeChildId": {
174
- "title": "Zigbee Child ID (CID)",
175
- "description": "For Zigbee sub-devices: the 16-character hex node ID assigned by the gateway (e.g. '0011223344556601'). Required when parentDeviceId is set.",
176
- "type": "string",
177
- "pattern": "^[0-9a-fA-F]{16}$"
178
- },
179
- "childDpMapping": {
180
- "title": "Child DP Mapping (Override)",
181
- "description": "For Zigbee sub-devices: optional DP mapping override. If provided, replaces the parent's DP mapping for this child device. Useful when child DPs differ from the gateway.",
182
- "type": "object",
183
- "additionalProperties": {
184
- "type": "integer"
185
- },
186
- "condition": {
187
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
188
- }
189
- },
190
- "childCategory": {
191
- "title": "Child Category Override",
192
- "description": "For Zigbee sub-devices: optional category override. If provided, replaces the parent's category for this child device. Useful when child is a different device type than the gateway.",
193
- "type": "string",
194
- "condition": {
195
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
196
- }
197
- },
198
- "outlets": {
555
+ "description": "Override default DP-to-function mappings as JSON.",
199
556
  "type": "array",
200
- "title": "Outlets",
201
- "orderable": false,
202
557
  "items": {
203
558
  "type": "object",
559
+ "required": ["dpCode", "dpID"],
204
560
  "properties": {
205
- "name": {
206
- "type": "string"
561
+ "dpCode": {
562
+ "type": "string",
563
+ "title": "DP Code"
207
564
  },
208
- "dp": {
209
- "type": "integer"
565
+ "dpID": {
566
+ "type": "integer",
567
+ "title": "DP ID"
210
568
  }
211
569
  }
212
570
  },
213
571
  "condition": {
214
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
215
- }
216
- },
217
- "dpPower": {
218
- "type": "integer",
219
- "title": "Power DP",
220
- "placeholder": 1,
221
- "condition": {
222
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
223
- }
224
- },
225
- "dpBrightness": {
226
- "type": "integer",
227
- "title": "Brightness DP",
228
- "placeholder": 2,
229
- "condition": {
230
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
231
- }
232
- },
233
- "dpColorTemperature": {
234
- "type": "integer",
235
- "title": "Color Temperature DP",
236
- "placeholder": 3,
237
- "condition": {
238
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
239
- }
240
- },
241
- "minWhiteColor": {
242
- "type": "integer",
243
- "title": "Min White Color",
244
- "placeholder": 140,
245
- "condition": {
246
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
247
- }
248
- },
249
- "maxWhiteColor": {
250
- "type": "integer",
251
- "title": "Max White Color",
252
- "placeholder": 400,
253
- "condition": {
254
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
255
- }
256
- },
257
- "dpMode": {
258
- "type": "integer",
259
- "title": "Mode DP",
260
- "placeholder": 2,
261
- "condition": {
262
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
263
- }
264
- },
265
- "dpColor": {
266
- "type": "integer",
267
- "title": "Color DP",
268
- "placeholder": 5,
269
- "condition": {
270
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
271
- }
272
- },
273
- "colorFunction": {
274
- "type": "string",
275
- "title": "Color Function",
276
- "placeholder": "HEXHSB",
277
- "condition": {
278
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
279
- }
280
- },
281
- "scaleBrightness": {
282
- "type": "integer",
283
- "title": "Scale Brightness",
284
- "placeholder": 255,
285
- "condition": {
286
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
287
- }
288
- },
289
- "scaleWhiteColor": {
290
- "type": "integer",
291
- "title": "Scale White Color",
292
- "placeholder": 255,
293
- "condition": {
294
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dj' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'dsd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'xdd' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'tgkg';"
295
- }
296
- },
297
- "voltsId": {
298
- "type": "integer",
299
- "title": "Voltage DP",
300
- "placeholder": 9,
301
- "condition": {
302
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
303
- }
304
- },
305
- "ampsId": {
306
- "type": "integer",
307
- "title": "Amperage DP",
308
- "placeholder": 8,
309
- "condition": {
310
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
311
- }
312
- },
313
- "wattsId": {
314
- "type": "integer",
315
- "title": "Power DP",
316
- "placeholder": 7,
317
- "condition": {
318
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
319
- }
320
- },
321
- "voltsDivisor": {
322
- "type": "integer",
323
- "title": "Voltage Divisor",
324
- "placeholder": 10,
325
- "condition": {
326
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
327
- }
328
- },
329
- "ampsDivisor": {
330
- "type": "integer",
331
- "title": "Amperage Divisor",
332
- "placeholder": 1000,
333
- "condition": {
334
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
335
- }
336
- },
337
- "wattsDivisor": {
338
- "type": "integer",
339
- "title": "Power Divisor",
340
- "placeholder": 10,
341
- "condition": {
342
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
343
- }
344
- },
345
- "noCool": {
346
- "type": "boolean",
347
- "title": "No Cool Mode",
348
- "condition": {
349
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
350
- }
351
- },
352
- "noHeat": {
353
- "type": "boolean",
354
- "title": "No Heat Mode",
355
- "condition": {
356
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
357
- }
358
- },
359
- "cmdCool": {
360
- "type": "string",
361
- "title": "Cool Command",
362
- "placeholder": "COOL",
363
- "condition": {
364
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
365
- }
366
- },
367
- "cmdHeat": {
368
- "type": "string",
369
- "title": "Heat Command",
370
- "placeholder": "HEAT",
371
- "condition": {
372
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
373
- }
374
- },
375
- "noSwing": {
376
- "type": "boolean",
377
- "title": "No Swing Mode",
378
- "condition": {
379
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
380
- }
381
- },
382
- "minTemperature": {
383
- "type": "integer",
384
- "title": "Min Temperature",
385
- "placeholder": 15,
386
- "condition": {
387
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
388
- }
389
- },
390
- "maxTemperature": {
391
- "type": "integer",
392
- "title": "Max Temperature",
393
- "placeholder": 40,
394
- "condition": {
395
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
396
- }
397
- },
398
- "minTemperatureSteps": {
399
- "type": "integer",
400
- "title": "Min Temperature Steps",
401
- "placeholder": 1,
402
- "condition": {
403
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'kt' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ktkzq';"
404
- }
405
- },
406
- "dpActive": {
407
- "type": "integer",
408
- "title": "Active DP",
409
- "placeholder": 7,
410
- "condition": {
411
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
412
- }
413
- },
414
- "dpDesiredTemperature": {
415
- "type": "integer",
416
- "title": "Desired Temperature DP",
417
- "placeholder": 2,
418
- "condition": {
419
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
420
- }
421
- },
422
- "dpCurrentTemperature": {
423
- "type": "integer",
424
- "title": "Current Temperature DP",
425
- "placeholder": 3,
426
- "condition": {
427
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
428
- }
429
- },
430
- "dpAction": {
431
- "type": "integer",
432
- "title": "Action DP",
433
- "placeholder": 1,
434
- "condition": {
435
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq';"
436
- }
437
- },
438
- "dpStatus": {
439
- "type": "integer",
440
- "title": "Status DP",
441
- "placeholder": 2,
442
- "condition": {
443
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq';"
444
- }
445
- },
446
- "flipState": {
447
- "type": "boolean",
448
- "title": "Flip State",
449
- "condition": {
450
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'ckmkzq' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
451
- }
452
- },
453
- "timeToOpen": {
454
- "type": "integer",
455
- "title": "Time to Open (seconds)",
456
- "placeholder": 45,
457
- "condition": {
458
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
459
- }
460
- },
461
- "timeToTighten": {
462
- "type": "integer",
463
- "title": "Time to Tighten (seconds)",
464
- "placeholder": 0,
465
- "condition": {
466
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
467
- }
468
- },
469
- "timeToClose": {
470
- "type": "integer",
471
- "title": "Time to Close (seconds)",
472
- "placeholder": 30,
473
- "description": "Time in seconds for blinds to fully open or close",
474
- "condition": {
475
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
476
- }
477
- },
478
- "dpLight": {
479
- "type": "integer",
480
- "title": "Light DP",
481
- "placeholder": 1,
482
- "condition": {
483
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cz' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'pc' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'wkcz';"
484
- }
485
- },
486
- "dpBlindType": {
487
- "type": "integer",
488
- "title": "Blind Type DP",
489
- "placeholder": 1,
490
- "condition": {
491
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'cl' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'clkg';"
492
- }
493
- },
494
- "dpLightOn": {
495
- "type": "integer",
496
- "title": "Light On DP",
497
- "placeholder": 9,
498
- "condition": {
499
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
500
- }
501
- },
502
- "dpFanOn": {
503
- "type": "integer",
504
- "title": "Fan On DP",
505
- "placeholder": 1,
506
- "condition": {
507
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
508
- }
509
- },
510
- "dpRotationSpeed": {
511
- "type": "integer",
512
- "title": "Rotation Speed DP",
513
- "placeholder": 4,
514
- "condition": {
515
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn' || ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
516
- }
517
- },
518
- "dpRotationDirection": {
519
- "type": "integer",
520
- "title": "Rotation Direction DP",
521
- "placeholder": 63,
522
- "condition": {
523
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
524
- }
525
- },
526
- "maxSpeed": {
527
- "type": "integer",
528
- "title": "Max Speed",
529
- "placeholder": 3,
530
- "condition": {
531
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
572
+ "functionBody": "return ['wnykq', 'qt', 'infrared_', 'other'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
532
573
  }
533
574
  },
534
- "fanDefaultSpeed": {
535
- "type": "integer",
536
- "title": "Fan Default Speed",
537
- "placeholder": 1,
538
- "condition": {
539
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
540
- }
541
- },
542
- "useStrings": {
543
- "type": "boolean",
544
- "title": "Use Strings",
545
- "placeholder": true,
546
- "condition": {
547
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'fs';"
548
- }
549
- },
550
- "dpChildLock": {
551
- "type": "integer",
552
- "title": "Child Lock DP",
553
- "placeholder": 6,
554
- "condition": {
555
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
575
+ "dpMapping": {
576
+ "title": "DP Mapping (Advanced)",
577
+ "description": "Override default DP-to-function mappings as JSON. Example: {\"switch_1\": 1, \"bright_value\": 2, \"temp_value\": 3}",
578
+ "type": "object",
579
+ "condition": { "functionBody": "return !['other', '', undefined].includes(model.local?.devices?.[arrayIndices[0]]?.category);" },
580
+ "properties": {
581
+ "add_ele": {
582
+ "type": "integer",
583
+ "title": "add_ele",
584
+ "condition": {
585
+ "functionBody": "return ['cz', 'dlq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
586
+ }
587
+ },
588
+ "air_quality": {
589
+ "type": "integer",
590
+ "title": "air_quality",
591
+ "condition": {
592
+ "functionBody": "return ['kj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
593
+ }
594
+ },
595
+ "alarm_message": {
596
+ "type": "integer",
597
+ "title": "alarm_message",
598
+ "condition": {
599
+ "functionBody": "return ['sp', 'wxml'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
600
+ }
601
+ },
602
+ "alarm_propel_switch": {
603
+ "type": "integer",
604
+ "title": "alarm_propel_switch",
605
+ "condition": {
606
+ "functionBody": "return ['wxml'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
607
+ }
608
+ },
609
+ "battery_percentage": {
610
+ "type": "integer",
611
+ "title": "battery_percentage",
612
+ "condition": {
613
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
614
+ }
615
+ },
616
+ "bright_value": {
617
+ "type": "integer",
618
+ "title": "bright_value",
619
+ "condition": {
620
+ "functionBody": "return ['dj', 'fs', 'jsq', 'ldcg', 'tgq', 'wnykq', 'xxj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
621
+ }
622
+ },
623
+ "bright_value_v2": {
624
+ "type": "integer",
625
+ "title": "bright_value_v2",
626
+ "condition": {
627
+ "functionBody": "return ['dj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
628
+ }
629
+ },
630
+ "child_lock": {
631
+ "type": "integer",
632
+ "title": "child_lock",
633
+ "condition": {
634
+ "functionBody": "return ['cs', 'fs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
635
+ }
636
+ },
637
+ "co2_state": {
638
+ "type": "integer",
639
+ "title": "co2_state",
640
+ "condition": {
641
+ "functionBody": "return ['co2bj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
642
+ }
643
+ },
644
+ "co2_value": {
645
+ "type": "integer",
646
+ "title": "co2_value",
647
+ "condition": {
648
+ "functionBody": "return ['co2bj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
649
+ }
650
+ },
651
+ "co_status": {
652
+ "type": "integer",
653
+ "title": "co_status",
654
+ "condition": {
655
+ "functionBody": "return ['cobj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
656
+ }
657
+ },
658
+ "co_value": {
659
+ "type": "integer",
660
+ "title": "co_value",
661
+ "condition": {
662
+ "functionBody": "return ['cobj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
663
+ }
664
+ },
665
+ "colour_data": {
666
+ "type": "integer",
667
+ "title": "colour_data",
668
+ "condition": {
669
+ "functionBody": "return ['bzyd', 'dj', 'fs', 'jsq', 'xxj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
670
+ }
671
+ },
672
+ "colour_data_v2": {
673
+ "type": "integer",
674
+ "title": "colour_data_v2",
675
+ "condition": {
676
+ "functionBody": "return ['dj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
677
+ }
678
+ },
679
+ "control": {
680
+ "type": "integer",
681
+ "title": "control",
682
+ "condition": {
683
+ "functionBody": "return ['mg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
684
+ }
685
+ },
686
+ "cur_current": {
687
+ "type": "integer",
688
+ "title": "cur_current",
689
+ "condition": {
690
+ "functionBody": "return ['cz', 'dlq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
691
+ }
692
+ },
693
+ "cur_power": {
694
+ "type": "integer",
695
+ "title": "cur_power",
696
+ "condition": {
697
+ "functionBody": "return ['cz', 'dlq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
698
+ }
699
+ },
700
+ "cur_voltage": {
701
+ "type": "integer",
702
+ "title": "cur_voltage",
703
+ "condition": {
704
+ "functionBody": "return ['cz', 'dlq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
705
+ }
706
+ },
707
+ "dehumidify_set_value": {
708
+ "type": "integer",
709
+ "title": "dehumidify_set_value",
710
+ "condition": {
711
+ "functionBody": "return ['cs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
712
+ }
713
+ },
714
+ "doorbell_call": {
715
+ "type": "integer",
716
+ "title": "doorbell_call",
717
+ "condition": {
718
+ "functionBody": "return ['wxml'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
719
+ }
720
+ },
721
+ "doorbell_pic": {
722
+ "type": "integer",
723
+ "title": "doorbell_pic",
724
+ "condition": {
725
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
726
+ }
727
+ },
728
+ "doorbell_ring_exist": {
729
+ "type": "integer",
730
+ "title": "doorbell_ring_exist",
731
+ "condition": {
732
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
733
+ }
734
+ },
735
+ "doorbell_volume_value": {
736
+ "type": "integer",
737
+ "title": "doorbell_volume_value",
738
+ "condition": {
739
+ "functionBody": "return ['wxml'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
740
+ }
741
+ },
742
+ "doorcontact_state": {
743
+ "type": "integer",
744
+ "title": "doorcontact_state",
745
+ "condition": {
746
+ "functionBody": "return ['ckmkzq', 'mcs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
747
+ }
748
+ },
749
+ "fan_direction": {
750
+ "type": "integer",
751
+ "title": "fan_direction",
752
+ "condition": {
753
+ "functionBody": "return ['fs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
754
+ }
755
+ },
756
+ "fan_speed": {
757
+ "type": "integer",
758
+ "title": "fan_speed",
759
+ "condition": {
760
+ "functionBody": "return ['fs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
761
+ }
762
+ },
763
+ "fan_speed_enum": {
764
+ "type": "integer",
765
+ "title": "fan_speed_enum",
766
+ "condition": {
767
+ "functionBody": "return ['cs', 'fs', 'kj', 'kt', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
768
+ }
769
+ },
770
+ "feed_report": {
771
+ "type": "integer",
772
+ "title": "feed_report",
773
+ "condition": {
774
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
775
+ }
776
+ },
777
+ "feed_state": {
778
+ "type": "integer",
779
+ "title": "feed_state",
780
+ "condition": {
781
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
782
+ }
783
+ },
784
+ "floodlight_lightness": {
785
+ "type": "integer",
786
+ "title": "floodlight_lightness",
787
+ "condition": {
788
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
789
+ }
790
+ },
791
+ "floodlight_switch": {
792
+ "type": "integer",
793
+ "title": "floodlight_switch",
794
+ "condition": {
795
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
796
+ }
797
+ },
798
+ "gas_sensor_status": {
799
+ "type": "integer",
800
+ "title": "gas_sensor_status",
801
+ "condition": {
802
+ "functionBody": "return ['rqbj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
803
+ }
804
+ },
805
+ "humidity_current": {
806
+ "type": "integer",
807
+ "title": "humidity_current",
808
+ "condition": {
809
+ "functionBody": "return ['jsq', 'kt'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
810
+ }
811
+ },
812
+ "humidity_indoor": {
813
+ "type": "integer",
814
+ "title": "humidity_indoor",
815
+ "condition": {
816
+ "functionBody": "return ['cs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
817
+ }
818
+ },
819
+ "humidity_set": {
820
+ "type": "integer",
821
+ "title": "humidity_set",
822
+ "condition": {
823
+ "functionBody": "return ['jsq', 'kt'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
824
+ }
825
+ },
826
+ "level": {
827
+ "type": "integer",
828
+ "title": "level",
829
+ "condition": {
830
+ "functionBody": "return ['xxj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
831
+ }
832
+ },
833
+ "light": {
834
+ "type": "integer",
835
+ "title": "light",
836
+ "condition": {
837
+ "functionBody": "return ['cwwsq', 'fs', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
838
+ }
839
+ },
840
+ "lock": {
841
+ "type": "integer",
842
+ "title": "lock",
843
+ "condition": {
844
+ "functionBody": "return ['kj', 'kt', 'qn', 'qn_old', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
845
+ }
846
+ },
847
+ "lock_motor_state": {
848
+ "type": "integer",
849
+ "title": "lock_motor_state",
850
+ "condition": {
851
+ "functionBody": "return ['ms'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
852
+ }
853
+ },
854
+ "manual_feed": {
855
+ "type": "integer",
856
+ "title": "manual_feed",
857
+ "condition": {
858
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
859
+ }
860
+ },
861
+ "master_mode": {
862
+ "type": "integer",
863
+ "title": "master_mode",
864
+ "condition": {
865
+ "functionBody": "return ['mal'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
866
+ }
867
+ },
868
+ "meal_plan": {
869
+ "type": "integer",
870
+ "title": "meal_plan",
871
+ "condition": {
872
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
873
+ }
874
+ },
875
+ "mode": {
876
+ "type": "integer",
877
+ "title": "mode",
878
+ "condition": {
879
+ "functionBody": "return ['kj', 'kt', 'mjj', 'wk', 'xxj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
880
+ }
881
+ },
882
+ "motion_switch": {
883
+ "type": "integer",
884
+ "title": "motion_switch",
885
+ "condition": {
886
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
887
+ }
888
+ },
889
+ "movement_detect_pic": {
890
+ "type": "integer",
891
+ "title": "movement_detect_pic",
892
+ "condition": {
893
+ "functionBody": "return ['sp'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
894
+ }
895
+ },
896
+ "open_close": {
897
+ "type": "integer",
898
+ "title": "open_close",
899
+ "condition": {
900
+ "functionBody": "return ['ms'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
901
+ }
902
+ },
903
+ "percent_control": {
904
+ "type": "integer",
905
+ "title": "percent_control",
906
+ "condition": {
907
+ "functionBody": "return ['mg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
908
+ }
909
+ },
910
+ "percent_state": {
911
+ "type": "integer",
912
+ "title": "percent_state",
913
+ "condition": {
914
+ "functionBody": "return ['mg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
915
+ }
916
+ },
917
+ "pir": {
918
+ "type": "integer",
919
+ "title": "pir",
920
+ "condition": {
921
+ "functionBody": "return ['pir'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
922
+ }
923
+ },
924
+ "pir_state": {
925
+ "type": "integer",
926
+ "title": "pir_state",
927
+ "condition": {
928
+ "functionBody": "return ['dj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
929
+ }
930
+ },
931
+ "pm10_value": {
932
+ "type": "integer",
933
+ "title": "pm10_value",
934
+ "condition": {
935
+ "functionBody": "return ['pm25'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
936
+ }
937
+ },
938
+ "pm25": {
939
+ "type": "integer",
940
+ "title": "pm25",
941
+ "condition": {
942
+ "functionBody": "return ['kj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
943
+ }
944
+ },
945
+ "pm25_value": {
946
+ "type": "integer",
947
+ "title": "pm25_value",
948
+ "condition": {
949
+ "functionBody": "return ['pm25'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
950
+ }
951
+ },
952
+ "position": {
953
+ "type": "integer",
954
+ "title": "position",
955
+ "condition": {
956
+ "functionBody": "return ['mg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
957
+ }
958
+ },
959
+ "presence_state": {
960
+ "type": "integer",
961
+ "title": "presence_state",
962
+ "condition": {
963
+ "functionBody": "return ['hps'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
964
+ }
965
+ },
966
+ "quick_feed": {
967
+ "type": "integer",
968
+ "title": "quick_feed",
969
+ "condition": {
970
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
971
+ }
972
+ },
973
+ "shake": {
974
+ "type": "integer",
975
+ "title": "shake",
976
+ "condition": {
977
+ "functionBody": "return ['qn', 'qn_old'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
978
+ }
979
+ },
980
+ "shock_state": {
981
+ "type": "integer",
982
+ "title": "shock_state",
983
+ "condition": {
984
+ "functionBody": "return ['zd'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
985
+ }
986
+ },
987
+ "slow_feed": {
988
+ "type": "integer",
989
+ "title": "slow_feed",
990
+ "condition": {
991
+ "functionBody": "return ['cwwsq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
992
+ }
993
+ },
994
+ "smoke_sensor_status": {
995
+ "type": "integer",
996
+ "title": "smoke_sensor_status",
997
+ "condition": {
998
+ "functionBody": "return ['ywbj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
999
+ }
1000
+ },
1001
+ "sos_state": {
1002
+ "type": "integer",
1003
+ "title": "sos_state",
1004
+ "condition": {
1005
+ "functionBody": "return ['mal'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1006
+ }
1007
+ },
1008
+ "speed": {
1009
+ "type": "integer",
1010
+ "title": "speed",
1011
+ "condition": {
1012
+ "functionBody": "return ['kj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1013
+ }
1014
+ },
1015
+ "swing": {
1016
+ "type": "integer",
1017
+ "title": "swing",
1018
+ "condition": {
1019
+ "functionBody": "return ['cs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1020
+ }
1021
+ },
1022
+ "switch": {
1023
+ "type": "integer",
1024
+ "title": "switch",
1025
+ "condition": {
1026
+ "functionBody": "return ['cs', 'cwwsq', 'cz', 'dj', 'dlq', 'ggq', 'jsq', 'kj', 'kt', 'mjj', 'qn', 'qn_old', 'tgq', 'wk', 'xxj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1027
+ }
1028
+ },
1029
+ "switch_1": {
1030
+ "type": "integer",
1031
+ "title": "switch_1",
1032
+ "condition": {
1033
+ "functionBody": "return ['ckmkzq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1034
+ }
1035
+ },
1036
+ "switch_fan": {
1037
+ "type": "integer",
1038
+ "title": "switch_fan",
1039
+ "condition": {
1040
+ "functionBody": "return ['fs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1041
+ }
1042
+ },
1043
+ "switch_horizontal": {
1044
+ "type": "integer",
1045
+ "title": "switch_horizontal",
1046
+ "condition": {
1047
+ "functionBody": "return ['fs', 'kt'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1048
+ }
1049
+ },
1050
+ "switch_inching": {
1051
+ "type": "integer",
1052
+ "title": "switch_inching",
1053
+ "condition": {
1054
+ "functionBody": "return ['cz', 'dlq'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1055
+ }
1056
+ },
1057
+ "switch_led": {
1058
+ "type": "integer",
1059
+ "title": "switch_led",
1060
+ "condition": {
1061
+ "functionBody": "return ['bzyd', 'dj', 'jsq', 'xxj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1062
+ }
1063
+ },
1064
+ "switch_mode1": {
1065
+ "type": "integer",
1066
+ "title": "switch_mode1",
1067
+ "condition": {
1068
+ "functionBody": "return ['wxkg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1069
+ }
1070
+ },
1071
+ "switch_music": {
1072
+ "type": "integer",
1073
+ "title": "switch_music",
1074
+ "condition": {
1075
+ "functionBody": "return ['bzyd'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1076
+ }
1077
+ },
1078
+ "switch_pir": {
1079
+ "type": "integer",
1080
+ "title": "switch_pir",
1081
+ "condition": {
1082
+ "functionBody": "return ['dj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1083
+ }
1084
+ },
1085
+ "switch_sound": {
1086
+ "type": "integer",
1087
+ "title": "switch_sound",
1088
+ "condition": {
1089
+ "functionBody": "return ['xxj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1090
+ }
1091
+ },
1092
+ "switch_spray": {
1093
+ "type": "integer",
1094
+ "title": "switch_spray",
1095
+ "condition": {
1096
+ "functionBody": "return ['xxj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1097
+ }
1098
+ },
1099
+ "temp_current": {
1100
+ "type": "integer",
1101
+ "title": "temp_current",
1102
+ "condition": {
1103
+ "functionBody": "return ['jsq', 'kt', 'mjj', 'qn', 'qn_old', 'wk'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1104
+ }
1105
+ },
1106
+ "temp_indoor": {
1107
+ "type": "integer",
1108
+ "title": "temp_indoor",
1109
+ "condition": {
1110
+ "functionBody": "return ['cs'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1111
+ }
1112
+ },
1113
+ "temp_set": {
1114
+ "type": "integer",
1115
+ "title": "temp_set",
1116
+ "condition": {
1117
+ "functionBody": "return ['kt', 'mjj', 'qn', 'qn_old', 'wk'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1118
+ }
1119
+ },
1120
+ "temp_unit_convert": {
1121
+ "type": "integer",
1122
+ "title": "temp_unit_convert",
1123
+ "condition": {
1124
+ "functionBody": "return ['kt', 'mjj', 'qn', 'qn_old', 'wk'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1125
+ }
1126
+ },
1127
+ "temp_value": {
1128
+ "type": "integer",
1129
+ "title": "temp_value",
1130
+ "condition": {
1131
+ "functionBody": "return ['dj', 'fs', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1132
+ }
1133
+ },
1134
+ "temp_value_v2": {
1135
+ "type": "integer",
1136
+ "title": "temp_value_v2",
1137
+ "condition": {
1138
+ "functionBody": "return ['dj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1139
+ }
1140
+ },
1141
+ "tvoc": {
1142
+ "type": "integer",
1143
+ "title": "tvoc",
1144
+ "condition": {
1145
+ "functionBody": "return ['kj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1146
+ }
1147
+ },
1148
+ "va_humidity": {
1149
+ "type": "integer",
1150
+ "title": "va_humidity",
1151
+ "condition": {
1152
+ "functionBody": "return ['cz', 'dlq', 'pm25', 'wnykq', 'wsdcg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1153
+ }
1154
+ },
1155
+ "va_temperature": {
1156
+ "type": "integer",
1157
+ "title": "va_temperature",
1158
+ "condition": {
1159
+ "functionBody": "return ['cz', 'dlq', 'pm25', 'wnykq', 'wsdcg'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1160
+ }
1161
+ },
1162
+ "voc_value": {
1163
+ "type": "integer",
1164
+ "title": "voc_value",
1165
+ "condition": {
1166
+ "functionBody": "return ['pm25'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1167
+ }
1168
+ },
1169
+ "work_mode": {
1170
+ "type": "integer",
1171
+ "title": "work_mode",
1172
+ "condition": {
1173
+ "functionBody": "return ['dj', 'fs', 'jsq', 'xxj', 'yyj'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1174
+ }
1175
+ },
1176
+ "work_state": {
1177
+ "type": "integer",
1178
+ "title": "work_state",
1179
+ "condition": {
1180
+ "functionBody": "return ['mjj', 'qn', 'qn_old', 'wk'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1181
+ }
1182
+ },
1183
+ "work_status": {
1184
+ "type": "integer",
1185
+ "title": "work_status",
1186
+ "condition": {
1187
+ "functionBody": "return ['kt'].includes(model.local?.devices?.[arrayIndices[0]]?.category);"
1188
+ }
1189
+ }
556
1190
  }
557
1191
  },
558
- "dpTemperatureDisplayUnits": {
1192
+ "outletCount": {
559
1193
  "type": "integer",
560
- "title": "Temperature Display Units DP",
561
- "placeholder": 19,
562
- "condition": {
563
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
564
- }
565
- },
566
- "cmdLow": {
567
- "type": "string",
568
- "title": "Low Command",
569
- "placeholder": "Low",
570
- "condition": {
571
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
572
- }
573
- },
574
- "cmdHigh": {
575
- "type": "string",
576
- "title": "High Command",
577
- "placeholder": "High",
578
- "condition": {
579
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
580
- }
1194
+ "title": "Outlet Count",
1195
+ "placeholder": 5,
1196
+ "condition": { "functionBody": "return ['cz', 'pc', 'wkcz'].includes(model.local?.devices?.[arrayIndices[0]]?.category);" }
581
1197
  },
582
- "noChildLock": {
1198
+ "isZigbeeGateway": {
1199
+ "title": "Zigbee Gateway",
1200
+ "description": "Mark this device as a Zigbee gateway. Usually auto-detected if other devices reference this device as their parent.",
583
1201
  "type": "boolean",
584
- "title": "No Child Lock",
585
- "condition": {
586
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
587
- }
1202
+ "default": false
588
1203
  },
589
- "noTemperatureUnit": {
590
- "type": "boolean",
591
- "title": "No Temperature Unit",
592
- "condition": {
593
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
594
- }
1204
+ "parentDeviceId": {
1205
+ "title": "Parent Gateway Device ID",
1206
+ "description": "For Zigbee sub-devices: the Tuya device ID of the parent gateway. Commands are routed through the parent's TCP connection using the Zigbee CID.",
1207
+ "type": "string"
595
1208
  },
596
- "temperatureDivisor": {
597
- "type": "integer",
598
- "title": "Temperature Divisor",
599
- "placeholder": 1,
1209
+ "zigbeeChildId": {
1210
+ "title": "Zigbee Child ID (CID)",
1211
+ "description": "For Zigbee sub-devices: the 16-character hex node ID assigned by the gateway (e.g. '0011223344556601'). Required when parentDeviceId is set.",
1212
+ "type": "string",
1213
+ "pattern": "^[0-9a-fA-F]{16}$"
1214
+ },
1215
+ "childDpMapping": {
1216
+ "title": "Child DP Mapping (Override)",
1217
+ "description": "For Zigbee sub-devices: optional DP mapping override. If provided, replaces the parent's DP mapping for this child device. Useful when child DPs differ from the gateway.",
1218
+ "type": "object",
1219
+ "additionalProperties": {
1220
+ "type": "integer"
1221
+ },
600
1222
  "condition": {
601
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
1223
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
602
1224
  }
603
1225
  },
604
- "thresholdTemperatureDivisor": {
605
- "type": "integer",
606
- "title": "Threshold Temperature Divisor",
607
- "placeholder": 1,
1226
+ "childCategory": {
1227
+ "title": "Child Category Override",
1228
+ "description": "For Zigbee sub-devices: optional category override. If provided, replaces the parent's category for this child device. Useful when child is a different device type than the gateway.",
1229
+ "type": "string",
608
1230
  "condition": {
609
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
1231
+ "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== undefined && ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].parentDeviceId : undefined) !== '';"
610
1232
  }
611
1233
  },
612
- "temperatureOffset": {
613
- "type": "integer",
614
- "title": "Temperature Offset",
615
- "placeholder": 0,
616
- "condition": {
617
- "functionBody": "return ((model.local && model.local.devices && model.local.devices[arrayIndices[0]]) ? model.local.devices[arrayIndices[0]].category : undefined) === 'qn';"
1234
+ "remote_keys": {
1235
+ "title": "IR Keys",
1236
+ "description": "",
1237
+ "type": "object",
1238
+ "condition": { "functionBody": "return !['other', '', undefined].includes(model.local?.devices?.[arrayIndices[0]]?.category);" },
1239
+ "properties": {
1240
+ "key_list": {
1241
+ "title": "IR Learning Code",
1242
+ "type": "array",
1243
+ "items": {
1244
+ "type": "object",
1245
+ "required": ["id"],
1246
+ "properties": {
1247
+ "key_name": {
1248
+ "title": "Display Name",
1249
+ "type": "string"
1250
+ },
1251
+ "learning_code": {
1252
+ "title": "Learning Code",
1253
+ "type": "string"
1254
+ }
1255
+ }
1256
+ }
1257
+ }
618
1258
  }
619
1259
  }
620
1260
  }
@@ -625,48 +1265,26 @@
625
1265
  "options": {
626
1266
  "title": "Cloud Account Info",
627
1267
  "type": "object",
628
- "condition": {
629
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
630
- },
631
1268
  "properties": {
632
1269
  "projectType": {
633
1270
  "title": "Project Type (Development Method)",
634
1271
  "description": "Required for Cloud mode.",
635
1272
  "type": "string",
636
1273
  "default": "2",
637
- "condition": {
638
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
639
- },
640
1274
  "oneOf": [
641
- {
642
- "title": "Custom",
643
- "enum": [
644
- "1"
645
- ]
646
- },
647
- {
648
- "title": "Smart Home",
649
- "enum": [
650
- "2"
651
- ]
652
- }
1275
+ { "title": "Custom", "enum": [ "1" ] },
1276
+ { "title": "Smart Home", "enum": [ "2" ] }
653
1277
  ]
654
1278
  },
655
1279
  "endpoint": {
656
1280
  "title": "Endpoint URL",
657
1281
  "type": "string",
658
- "format": "url",
659
- "condition": {
660
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
661
- }
1282
+ "format": "url"
662
1283
  },
663
1284
  "accessId": {
664
1285
  "title": "Access ID",
665
1286
  "description": "Required for Cloud mode.",
666
- "type": "string",
667
- "condition": {
668
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
669
- }
1287
+ "type": "string"
670
1288
  },
671
1289
  "accessKey": {
672
1290
  "description": "Required for Cloud mode.",
@@ -674,9 +1292,6 @@
674
1292
  "type": "string",
675
1293
  "x-schema-form": {
676
1294
  "type": "password"
677
- },
678
- "condition": {
679
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
680
1295
  }
681
1296
  },
682
1297
  "countryCode": {
@@ -934,18 +1549,8 @@
934
1549
  "type": "string",
935
1550
  "default": "tuyaSmart",
936
1551
  "oneOf": [
937
- {
938
- "title": "Tuya Smart",
939
- "enum": [
940
- "tuyaSmart"
941
- ]
942
- },
943
- {
944
- "title": "Smart Life",
945
- "enum": [
946
- "smartlife"
947
- ]
948
- }
1552
+ { "title": "Tuya Smart", "enum": [ "tuyaSmart" ] },
1553
+ { "title": "Smart Life", "enum": [ "smartlife" ] }
949
1554
  ],
950
1555
  "condition": {
951
1556
  "functionBody": "return model.options.projectType === '2';"
@@ -966,9 +1571,6 @@
966
1571
  "deviceOverrides": {
967
1572
  "title": "Device Overriding Configs",
968
1573
  "type": "array",
969
- "condition": {
970
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
971
- },
972
1574
  "items": {
973
1575
  "type": "object",
974
1576
  "required": ["id"],
@@ -983,17 +1585,53 @@
983
1585
  "description": "Category Code or `hidden`",
984
1586
  "type": "string",
985
1587
  "condition": {
986
- "functionBody": "return (model.options && model.options.deviceOverrides);"
1588
+ "functionBody": "return (model.options?.deviceOverrides);"
987
1589
  }
988
1590
  },
989
1591
  "unbridged": {
990
1592
  "title": "Unbridge",
991
1593
  "description": "Would you like to make this device be an external device?",
992
1594
  "type": "boolean",
1595
+ "condition": {
1596
+ "functionBody": "return (model.options?.deviceOverrides);"
1597
+ }
1598
+ },
1599
+ "addExtraFeaturesAutomatically": {
1600
+ "title": "Add Extra Features Automatically",
1601
+ "description": "Show device‑specific features that aren’t part of the standard spec",
1602
+ "type": "boolean",
993
1603
  "condition": {
994
1604
  "functionBody": "return (model.options && model.options.deviceOverrides);"
995
1605
  }
996
1606
  },
1607
+ "adaptiveLighting": {
1608
+ "title": "Adaptive Lighting",
1609
+ "description": "Enable if your device supports intelligently adjusting the brightness and color of your lights",
1610
+ "type": "boolean",
1611
+ "condition": {
1612
+ "functionBody": "return (['bzyd', 'cwwsq', 'dj', 'dsd', 'xdd', 'fwd', 'dc', 'dd', 'gyd', 'tyndj', 'sxd', 'jsq', 'fs', 'fsd', 'fskg', 'yyj', 'xxj', 'sp'].includes(model?.options?.deviceOverrides?.[arrayIndices[0]]?.category));"
1613
+ }
1614
+ },
1615
+ "configFor": {
1616
+ "title": "When to apply the configuration",
1617
+ "description": "Whether the setting is for devices on Cloud, devices on Local, or used by both.",
1618
+ "type": "string",
1619
+ "required": true,
1620
+ "default": "cloud",
1621
+ "oneOf": [
1622
+ { "title": "Cloud", "enum": [ "cloud" ] },
1623
+ { "title": "Local", "enum": [ "local" ] },
1624
+ { "title": "Both", "enum": [ "both" ] }
1625
+ ]
1626
+ },
1627
+ "garageDoorUseContactSensorForState": {
1628
+ "title": "Use Contact Sensor For Garage Door State",
1629
+ "description": "For garage door controllers only. Derive CurrentDoorState and TargetDoorState reads from doorcontact_state instead of switch_1.",
1630
+ "type": "boolean",
1631
+ "condition": {
1632
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].category === 'ckmkzq');"
1633
+ }
1634
+ },
997
1635
  "schema": {
998
1636
  "title": "Schema Overriding Configs",
999
1637
  "type": "array",
@@ -1005,14 +1643,14 @@
1005
1643
  "title": "DP Code",
1006
1644
  "type": "string",
1007
1645
  "condition": {
1008
- "functionBody": "return (model.options && model.options.deviceOverrides);"
1646
+ "functionBody": "return (model.options?.deviceOverrides);"
1009
1647
  }
1010
1648
  },
1011
1649
  "newCode": {
1012
1650
  "title": "New DP Code",
1013
1651
  "type": "string",
1014
1652
  "condition": {
1015
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1653
+ "functionBody": "return (model.options?.deviceOverrides?.[arrayIndices[0]]?.schema?.[arrayIndices[1]]?.code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1016
1654
  }
1017
1655
  },
1018
1656
  "type": {
@@ -1020,45 +1658,15 @@
1020
1658
  "type": "string",
1021
1659
  "default": "",
1022
1660
  "oneOf": [
1023
- {
1024
- "title": "Boolean",
1025
- "enum": [
1026
- "Boolean"
1027
- ]
1028
- },
1029
- {
1030
- "title": "Integer",
1031
- "enum": [
1032
- "Integer"
1033
- ]
1034
- },
1035
- {
1036
- "title": "Enum",
1037
- "enum": [
1038
- "Enum"
1039
- ]
1040
- },
1041
- {
1042
- "title": "String",
1043
- "enum": [
1044
- "String"
1045
- ]
1046
- },
1047
- {
1048
- "title": "Json",
1049
- "enum": [
1050
- "Json"
1051
- ]
1052
- },
1053
- {
1054
- "title": "Raw",
1055
- "enum": [
1056
- "Raw"
1057
- ]
1058
- }
1661
+ { "title": "Boolean", "enum": [ "Boolean" ] },
1662
+ { "title": "Integer", "enum": [ "Integer" ] },
1663
+ { "title": "Enum", "enum": [ "Enum" ] },
1664
+ { "title": "String", "enum": [ "String" ] },
1665
+ { "title": "Json", "enum": [ "Json" ] },
1666
+ { "title": "Raw", "enum": [ "Raw" ] }
1059
1667
  ],
1060
1668
  "condition": {
1061
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1669
+ "functionBody": "return (model.options?.deviceOverrides?.[arrayIndices[0]]?.schema?.[arrayIndices[1]]?.code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1062
1670
  }
1063
1671
  },
1064
1672
  "property": {
@@ -1069,28 +1677,28 @@
1069
1677
  "title": "min",
1070
1678
  "type": "integer",
1071
1679
  "condition": {
1072
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1680
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1073
1681
  }
1074
1682
  },
1075
1683
  "max": {
1076
1684
  "title": "max",
1077
1685
  "type": "integer",
1078
1686
  "condition": {
1079
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1687
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1080
1688
  }
1081
1689
  },
1082
1690
  "scale": {
1083
1691
  "title": "scale",
1084
1692
  "type": "integer",
1085
1693
  "condition": {
1086
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1694
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1087
1695
  }
1088
1696
  },
1089
1697
  "step": {
1090
1698
  "title": "step",
1091
1699
  "type": "integer",
1092
1700
  "condition": {
1093
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1701
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Integer' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1094
1702
  }
1095
1703
  },
1096
1704
  "range": {
@@ -1101,25 +1709,90 @@
1101
1709
  "type": "string"
1102
1710
  },
1103
1711
  "condition": {
1104
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Enum' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1712
+ "functionBody": "return (model.options?.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Enum' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1105
1713
  }
1106
1714
  }
1107
1715
  },
1108
1716
  "condition": {
1109
- "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1717
+ "functionBody": "return (model.options?.deviceOverrides?.[arrayIndices[0]]?.schema?.[arrayIndices[1]]?.code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1110
1718
  }
1111
1719
  },
1112
1720
  "hidden": {
1113
1721
  "title": "Hidden",
1114
1722
  "type": "boolean",
1115
1723
  "condition": {
1116
- "functionBody": "return (model.options && model.options.deviceOverrides);"
1724
+ "functionBody": "return (model.options?.deviceOverrides);"
1725
+ }
1726
+ },
1727
+ "onGet": {
1728
+ "title": "onGet",
1729
+ "type": "string",
1730
+ "description": "Optional. A one-line JavaScript code to convert the old value to the new value. The function is called with two arguments: device and value. Examples: https://github.com/homebridge-plugins/homebridge-tuya/blob/latest/ADVANCED_OPTIONS.md#examples",
1731
+ "placeholder": "value",
1732
+ "condition": {
1733
+ "functionBody": "return (model.options?.deviceOverrides?.[arrayIndices[0]]?.schema?.[arrayIndices[1]]?.code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1734
+ }
1735
+ },
1736
+ "onSet": {
1737
+ "title": "onSet",
1738
+ "type": "string",
1739
+ "description": "Optional. A one-line JavaScript code to convert the new value to the old value. The function is called with two arguments: device and value. Returning undefined means to skip sending the command. Examples: https://github.com/homebridge-plugins/homebridge-tuya/blob/latest/ADVANCED_OPTIONS.md#examples",
1740
+ "placeholder": "value",
1741
+ "condition": {
1742
+ "functionBody": "return (model.options?.deviceOverrides?.[arrayIndices[0]]?.schema?.[arrayIndices[1]]?.code && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden);"
1743
+ }
1744
+ },
1745
+ "extra": {
1746
+ "title": "Extra",
1747
+ "type": "boolean",
1748
+ "description": "Treat as Extra Feature",
1749
+ "condition": {
1750
+ "functionBody": "return (model?.options?.deviceOverrides?.[arrayIndices[0]].schema);"
1751
+ }
1752
+ },
1753
+ "extraRawSwitch": {
1754
+ "title": "RawDataSwitches",
1755
+ "type": "array",
1756
+ "description": "Add switches for updating the byte‑code data.",
1757
+ "condition": {
1758
+ "functionBody": "return (model.options && model.options.deviceOverrides && model.options.deviceOverrides[arrayIndices[0]].schema && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].type === 'Raw' && !model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].hidden && model.options.deviceOverrides[arrayIndices[0]].schema[arrayIndices[1]].extra);"
1759
+ },
1760
+ "items": {
1761
+ "type": "object",
1762
+ "required": ["configuredName", "notation", "value", "byteIndex"],
1763
+ "properties": {
1764
+ "configuredName": {
1765
+ "title": "Name",
1766
+ "type": "string"
1767
+ },
1768
+ "notation": {
1769
+ "title": "Notation",
1770
+ "type": "string",
1771
+ "default": "base64",
1772
+ "oneOf": [
1773
+ { "title": "Base64", "enum": [ "base64" ] },
1774
+ { "title": "Hexadecimal", "enum": [ "hex" ] }
1775
+ ]
1776
+ },
1777
+ "value": {
1778
+ "title": "Value",
1779
+ "type": "string",
1780
+ "placeholder": "0x01",
1781
+ "pattern": "^0x([0-9a-fA-F]{2})+$"
1782
+ },
1783
+ "byteIndex": {
1784
+ "title": "ByteIndex",
1785
+ "type": "integer",
1786
+ "default": 0,
1787
+ "minimum": 0
1788
+ }
1789
+ }
1117
1790
  }
1118
1791
  }
1119
1792
  }
1120
1793
  },
1121
1794
  "condition": {
1122
- "functionBody": "return (model.options && model.options.deviceOverrides);"
1795
+ "functionBody": "return (model.options?.deviceOverrides);"
1123
1796
  }
1124
1797
  }
1125
1798
  }
@@ -1129,9 +1802,6 @@
1129
1802
  "title": "Accessory Service Informations ",
1130
1803
  "description": "Accessory Service Information Configs",
1131
1804
  "type": "array",
1132
- "condition": {
1133
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1134
- },
1135
1805
  "items": {
1136
1806
  "type": "object",
1137
1807
  "required": ["device_id", "index"],
@@ -1180,12 +1850,23 @@
1180
1850
  "title": "Weather API",
1181
1851
  "description": "Open-Meteo : For non-commercial use. [Weather data by Open-Meteo.com](https://open-meteo.com/)<br>Tuya : Requires authorization for Weather Service.",
1182
1852
  "type": "string",
1183
- "enum": ["Open-Meteo", "Tuya"],
1853
+ "enum": [ "Open-Meteo", "Tuya" ],
1184
1854
  "default": "Open-Meteo",
1185
1855
  "condition": {
1186
1856
  "functionBody": "return (model.options && model.options.generateWeatherAccessory);"
1187
1857
  }
1188
1858
  },
1859
+ "forceIPv4": {
1860
+ "title": "Forcing IPv4 connection",
1861
+ "type": "boolean",
1862
+ "default": false
1863
+ }
1864
+ }
1865
+ },
1866
+ "common": {
1867
+ "title": "Common Settings",
1868
+ "type": "object",
1869
+ "properties": {
1189
1870
  "debug": {
1190
1871
  "title": "Enable Debug Logging",
1191
1872
  "type": "boolean",
@@ -1196,326 +1877,50 @@
1196
1877
  "description": "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.",
1197
1878
  "type": "string",
1198
1879
  "condition": {
1199
- "functionBody": "return (model.options && model.options.debug);"
1880
+ "functionBody": "return (model.common.debug);"
1200
1881
  }
1201
1882
  }
1202
1883
  }
1203
- }
1204
- }
1205
- },
1206
- "layout": [
1207
- "mode",
1208
- {
1209
- "type": "fieldset",
1210
- "title": "Local Settings",
1211
- "expandable": true,
1212
- "expanded": true,
1213
- "condition": {
1214
- "functionBody": "return (model.mode === 'local' || model.mode === 'both');"
1215
- },
1216
- "items": [
1217
- "local.autoDiscoverDevices",
1218
- "local.discoverTimeout",
1219
- "local.rediscoverInterval",
1220
- {
1221
- "key": "local.devices",
1222
- "add": "Add Manual Device",
1223
- "title": "{{ 'Add New Device' }}",
1224
- "type": "tabarray",
1225
- "notitle": true,
1226
- "items": [
1227
- {
1228
- "type": "div",
1229
- "displayFlex": false,
1230
- "notitle": true,
1231
- "title": "{{ value.name || value.tuyaDeviceId || 'New Device' }}",
1232
- "items": [
1233
- { "key": "local.devices[].category" },
1234
- { "key": "local.devices[].name" },
1235
- { "key": "local.devices[].tuyaDeviceId" },
1236
- { "key": "local.devices[].tuyaKey" },
1237
- { "key": "local.devices[].ip" },
1238
- { "key": "local.devices[].protocolVersion" },
1239
- { "key": "local.devices[].dpMapping" },
1240
- { "key": "local.devices[].outletCount" },
1241
- { "key": "local.devices[].outlets" },
1242
- { "key": "local.devices[].dpPower" },
1243
- { "key": "local.devices[].dpBrightness" },
1244
- { "key": "local.devices[].dpColorTemperature" },
1245
- { "key": "local.devices[].minWhiteColor" },
1246
- { "key": "local.devices[].maxWhiteColor" },
1247
- { "key": "local.devices[].dpMode" },
1248
- { "key": "local.devices[].dpColor" },
1249
- { "key": "local.devices[].colorFunction" },
1250
- { "key": "local.devices[].scaleBrightness" },
1251
- { "key": "local.devices[].scaleWhiteColor" },
1252
- { "key": "local.devices[].voltsId" },
1253
- { "key": "local.devices[].ampsId" },
1254
- { "key": "local.devices[].wattsId" },
1255
- { "key": "local.devices[].voltsDivisor" },
1256
- { "key": "local.devices[].ampsDivisor" },
1257
- { "key": "local.devices[].wattsDivisor" },
1258
- { "key": "local.devices[].noCool" },
1259
- { "key": "local.devices[].noHeat" },
1260
- { "key": "local.devices[].cmdCool" },
1261
- { "key": "local.devices[].cmdHeat" },
1262
- { "key": "local.devices[].noSwing" },
1263
- { "key": "local.devices[].minTemperature" },
1264
- { "key": "local.devices[].maxTemperature" },
1265
- { "key": "local.devices[].minTemperatureSteps" },
1266
- { "key": "local.devices[].dpActive" },
1267
- { "key": "local.devices[].dpDesiredTemperature" },
1268
- { "key": "local.devices[].dpCurrentTemperature" },
1269
- { "key": "local.devices[].dpAction" },
1270
- { "key": "local.devices[].dpStatus" },
1271
- { "key": "local.devices[].flipState" },
1272
- { "key": "local.devices[].timeToOpen" },
1273
- { "key": "local.devices[].timeToTighten" },
1274
- { "key": "local.devices[].timeToClose" },
1275
- { "key": "local.devices[].dpLight" },
1276
- { "key": "local.devices[].dpBlindType" },
1277
- { "key": "local.devices[].dpLightOn" },
1278
- { "key": "local.devices[].dpFanOn" },
1279
- { "key": "local.devices[].dpRotationSpeed" },
1280
- { "key": "local.devices[].dpRotationDirection" },
1281
- { "key": "local.devices[].maxSpeed" },
1282
- { "key": "local.devices[].fanDefaultSpeed" },
1283
- { "key": "local.devices[].useStrings" },
1284
- { "key": "local.devices[].dpChildLock" },
1285
- { "key": "local.devices[].dpTemperatureDisplayUnits" },
1286
- { "key": "local.devices[].cmdLow" },
1287
- { "key": "local.devices[].cmdHigh" },
1288
- { "key": "local.devices[].noChildLock" },
1289
- { "key": "local.devices[].noTemperatureUnit" },
1290
- { "key": "local.devices[].temperatureDivisor" },
1291
- { "key": "local.devices[].thresholdTemperatureDivisor" },
1292
- { "key": "local.devices[].temperatureOffset" }
1293
- ]
1294
- }
1295
- ]
1296
- }
1297
- ]
1298
- },
1299
- {
1300
- "type": "fieldset",
1301
- "title": "Tuya Cloud Account Info",
1302
- "expandable": true,
1303
- "expanded": false,
1304
- "condition": {
1305
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1306
- },
1307
- "items": [
1308
- "options.projectType",
1309
- "options.endpoint",
1310
- "options.accessId",
1311
- "options.accessKey",
1312
- "options.countryCode",
1313
- "options.username",
1314
- "options.password",
1315
- "options.appSchema"
1316
- ]
1317
- },
1318
- {
1319
- "type": "fieldset",
1320
- "title": "Tuya Home Settings",
1321
- "expandable": true,
1322
- "expanded": false,
1323
- "notitle": false,
1324
- "condition": {
1325
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1326
- },
1327
- "items": [
1328
- {
1329
- "key": "options.homeWhitelist",
1330
- "add": "Add Another Home ID",
1331
- "title": "{{ 'New Whitelisted Home' }}",
1332
- "type": "tabarray",
1333
- "notitle": true,
1334
- "items": [
1335
- {
1336
- "type": "div",
1337
- "displayFlex": true,
1338
- "flex-direction": "row",
1339
- "notitle": true,
1340
- "title": "{{ value }}",
1341
- "items": [
1342
- {
1343
- "key": "options.homeWhitelist[]",
1344
- "placeholder": "Home ID"
1345
- }
1346
- ]
1347
- }
1348
- ]
1349
- }
1350
- ]
1351
- },
1352
- {
1353
- "type": "fieldset",
1354
- "title": "Tuya Device Settings",
1355
- "expandable": true,
1356
- "expanded": true,
1357
- "notitle": false,
1358
- "condition": {
1359
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1360
- },
1361
- "items": [
1362
- {
1363
- "key": "options.deviceOverrides",
1364
- "add": "Add Another Device Override",
1365
- "title": "{{ 'New Device Override' }}",
1366
- "type": "tabarray",
1367
- "notitle": true,
1368
- "default": [],
1369
- "items": [
1370
- {
1371
- "type": "div",
1372
- "displayFlex": false,
1373
- "flex-direction": "row",
1374
- "notitle": true,
1375
- "title": "{{ value.id || 'New Device Override' }}",
1376
- "items": [
1377
- {
1378
- "key": "options.deviceOverrides[].id"
1379
- },
1380
- {
1381
- "key": "options.deviceOverrides[].category"
1382
- },
1383
- {
1384
- "key": "options.deviceOverrides[].unbridged"
1385
- },
1386
- {
1387
- "key": "options.deviceOverrides[].schema",
1388
- "add": "Add New Schema",
1389
- "title": "{{ 'New Schema' }}",
1390
- "type": "tabarray",
1391
- "notitle": true,
1392
- "items": [
1393
- {
1394
- "type": "div",
1395
- "displayFlex": true,
1396
- "title": "{{ value.code }}",
1397
- "flex-direction": "column",
1398
- "notitle": false,
1399
- "items": [
1400
- {
1401
- "key": "options.deviceOverrides[].schema[].code"
1402
- },
1403
- {
1404
- "key": "options.deviceOverrides[].schema[].newCode"
1405
- },
1406
- {
1407
- "key": "options.deviceOverrides[].schema[].hidden"
1408
- },
1409
- {
1410
- "key": "options.deviceOverrides[].schema[].type"
1411
- },
1412
- {
1413
- "key": "options.deviceOverrides[].schema[].property",
1414
- "notitle": false,
1415
- "items": [
1416
- "options.deviceOverrides[].schema[].property.min",
1417
- "options.deviceOverrides[].schema[].property.max",
1418
- "options.deviceOverrides[].schema[].property.scale",
1419
- "options.deviceOverrides[].schema[].property.step",
1420
- {
1421
- "key": "options.deviceOverrides[].schema[].property.range",
1422
- "add": "Add Range",
1423
- "title": "{{ 'New Range' }}",
1424
- "type": "tabarray",
1425
- "notitle": true,
1426
- "items": [
1427
- {
1428
- "type": "div",
1429
- "displayFlex": true,
1430
- "flex-direction": "row",
1431
- "notitle": true,
1432
- "title": "{{ value }}",
1433
- "items": [
1434
- {
1435
- "key": "options.deviceOverrides[].schema[].property.range[]",
1436
- "placeholder": "Range"
1437
- }
1438
- ]
1439
- }
1440
- ]
1441
- }
1442
- ]
1443
- }
1444
- ]
1445
- }
1446
- ]
1447
- }
1448
- ]
1449
- }
1450
- ]
1451
- }
1452
- ]
1453
- },
1454
-
1455
- {
1456
- "type": "fieldset",
1457
- "title": "Accessory Service Informations",
1458
- "expandable": true,
1459
- "expanded": false,
1460
- "notitle": false,
1461
- "condition": {
1462
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1463
1884
  },
1464
- "items": [
1465
- {
1466
- "key": "options.serviceInformationOverrides",
1467
- "add": "Add Another Service Information Override",
1468
- "title": "{{ 'New Service Information Override' }}",
1469
- "type": "tabarray",
1470
- "notitle": true,
1471
- "default": [],
1472
- "items": [
1473
- {
1474
- "type": "div",
1475
- "displayFlex": false,
1476
- "flex-direction": "row",
1477
- "notitle": true,
1478
- "title": "{{ value.device_id }}",
1479
- "items": [
1480
- {
1481
- "key": "options.serviceInformationOverrides[].device_id"
1482
- },
1483
- {
1484
- "key": "options.serviceInformationOverrides[].index"
1485
- },
1486
- {
1487
- "key": "options.serviceInformationOverrides[].manifacturer"
1488
- },
1489
- {
1490
- "key": "options.serviceInformationOverrides[].model"
1491
- },
1492
- {
1493
- "key": "options.serviceInformationOverrides[].firmwareRevision"
1494
- },
1495
- {
1496
- "key": "options.serviceInformationOverrides[].configuredName"
1497
- }
1498
- ]
1885
+ "cameras": {
1886
+ "title": "RTSP Camera",
1887
+ "description": "Specifying a local IP address causes the communication to be routed within the local network (LAN).",
1888
+ "type": "array",
1889
+ "items": {
1890
+ "type": "object",
1891
+ "required": ["rtspUrl"],
1892
+ "properties": {
1893
+ "deviceId": {
1894
+ "title": "DeviceID",
1895
+ "description": "Device ID. If the device is not a Tuya camera, you don’t need to enter anything.",
1896
+ "type": "string"
1897
+ },
1898
+ "deviceName": {
1899
+ "title": "Device Name",
1900
+ "description": "Display Name",
1901
+ "type": "string"
1902
+ },
1903
+ "rtspUrl": {
1904
+ "title": "RTSP URL",
1905
+ "description": "RTSP URLs (starting with rtsp://) for real-time video/audio streaming.",
1906
+ "type": "string"
1907
+ },
1908
+ "username": {
1909
+ "title": "username",
1910
+ "description": "The authentication username for accessing the RTSP stream. If authentication is not required, please leave it empty.",
1911
+ "type": "string"
1912
+ },
1913
+ "password": {
1914
+ "title": "password",
1915
+ "description": "The authentication password for accessing the RTSP stream. If authentication is not required, please leave it empty.",
1916
+ "type": "string",
1917
+ "x-schema-form": {
1918
+ "type": "password"
1919
+ }
1499
1920
  }
1500
- ]
1921
+ }
1501
1922
  }
1502
- ]
1503
- },
1504
- {
1505
- "type": "fieldset",
1506
- "title": "Advance Settings",
1507
- "expandable": true,
1508
- "expanded": false,
1509
- "notitle": false,
1510
- "condition": {
1511
- "functionBody": "return (model.mode === 'cloud' || model.mode === 'both');"
1512
- },
1513
- "items": [
1514
- "options.generateWeatherAccessory",
1515
- "options.weatherAPI",
1516
- "options.debug",
1517
- "options.debugLevel"
1518
- ]
1923
+ }
1519
1924
  }
1520
- ]
1925
+ }
1521
1926
  }