zigbee-herdsman-converters 24.13.0 → 25.0.0

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 (242) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +6 -0
  3. package/dist/converters/fromZigbee.d.ts +1 -0
  4. package/dist/converters/fromZigbee.d.ts.map +1 -1
  5. package/dist/converters/fromZigbee.js +19 -7
  6. package/dist/converters/fromZigbee.js.map +1 -1
  7. package/dist/converters/toZigbee.js +2 -2
  8. package/dist/converters/toZigbee.js.map +1 -1
  9. package/dist/devices/adeo.d.ts.map +1 -1
  10. package/dist/devices/adeo.js +1 -7
  11. package/dist/devices/adeo.js.map +1 -1
  12. package/dist/devices/adurosmart.d.ts.map +1 -1
  13. package/dist/devices/adurosmart.js +7 -0
  14. package/dist/devices/adurosmart.js.map +1 -1
  15. package/dist/devices/amina.d.ts.map +1 -1
  16. package/dist/devices/amina.js +22 -12
  17. package/dist/devices/amina.js.map +1 -1
  18. package/dist/devices/aurora_lighting.js +3 -3
  19. package/dist/devices/aurora_lighting.js.map +1 -1
  20. package/dist/devices/avatto.d.ts.map +1 -1
  21. package/dist/devices/avatto.js +2 -12
  22. package/dist/devices/avatto.js.map +1 -1
  23. package/dist/devices/busch_jaeger.d.ts.map +1 -1
  24. package/dist/devices/busch_jaeger.js +20 -20
  25. package/dist/devices/busch_jaeger.js.map +1 -1
  26. package/dist/devices/centralite.d.ts.map +1 -1
  27. package/dist/devices/centralite.js +1 -15
  28. package/dist/devices/centralite.js.map +1 -1
  29. package/dist/devices/danfoss.d.ts.map +1 -1
  30. package/dist/devices/danfoss.js +14 -21
  31. package/dist/devices/danfoss.js.map +1 -1
  32. package/dist/devices/datek.d.ts.map +1 -1
  33. package/dist/devices/datek.js +10 -11
  34. package/dist/devices/datek.js.map +1 -1
  35. package/dist/devices/develco.d.ts.map +1 -1
  36. package/dist/devices/develco.js +13 -23
  37. package/dist/devices/develco.js.map +1 -1
  38. package/dist/devices/engo.d.ts.map +1 -1
  39. package/dist/devices/engo.js +2 -8
  40. package/dist/devices/engo.js.map +1 -1
  41. package/dist/devices/evanell.d.ts.map +1 -1
  42. package/dist/devices/evanell.js +1 -6
  43. package/dist/devices/evanell.js.map +1 -1
  44. package/dist/devices/ewelink.js +3 -3
  45. package/dist/devices/ewelink.js.map +1 -1
  46. package/dist/devices/fantem.d.ts.map +1 -1
  47. package/dist/devices/fantem.js +1 -7
  48. package/dist/devices/fantem.js.map +1 -1
  49. package/dist/devices/feibit.d.ts.map +1 -1
  50. package/dist/devices/feibit.js +1 -6
  51. package/dist/devices/feibit.js.map +1 -1
  52. package/dist/devices/futurehome.d.ts +1 -1
  53. package/dist/devices/futurehome.d.ts.map +1 -1
  54. package/dist/devices/futurehome.js +1 -4
  55. package/dist/devices/futurehome.js.map +1 -1
  56. package/dist/devices/giex.js +1 -1
  57. package/dist/devices/giex.js.map +1 -1
  58. package/dist/devices/gledopto.d.ts.map +1 -1
  59. package/dist/devices/gledopto.js +9 -17
  60. package/dist/devices/gledopto.js.map +1 -1
  61. package/dist/devices/gmmts.d.ts.map +1 -1
  62. package/dist/devices/gmmts.js +45 -74
  63. package/dist/devices/gmmts.js.map +1 -1
  64. package/dist/devices/heiman.d.ts.map +1 -1
  65. package/dist/devices/heiman.js +2 -9
  66. package/dist/devices/heiman.js.map +1 -1
  67. package/dist/devices/hive.d.ts.map +1 -1
  68. package/dist/devices/hive.js +9 -29
  69. package/dist/devices/hive.js.map +1 -1
  70. package/dist/devices/immax.js +1 -1
  71. package/dist/devices/immax.js.map +1 -1
  72. package/dist/devices/inovelli.d.ts.map +1 -1
  73. package/dist/devices/inovelli.js +2 -1
  74. package/dist/devices/inovelli.js.map +1 -1
  75. package/dist/devices/legrand.d.ts.map +1 -1
  76. package/dist/devices/legrand.js +10 -22
  77. package/dist/devices/legrand.js.map +1 -1
  78. package/dist/devices/lellki.d.ts.map +1 -1
  79. package/dist/devices/lellki.js +9 -8
  80. package/dist/devices/lellki.js.map +1 -1
  81. package/dist/devices/lidl.d.ts.map +1 -1
  82. package/dist/devices/lidl.js +14 -15
  83. package/dist/devices/lidl.js.map +1 -1
  84. package/dist/devices/lifecontrol.d.ts.map +1 -1
  85. package/dist/devices/lifecontrol.js +9 -21
  86. package/dist/devices/lifecontrol.js.map +1 -1
  87. package/dist/devices/lincukoo.d.ts.map +1 -1
  88. package/dist/devices/lincukoo.js +6 -24
  89. package/dist/devices/lincukoo.js.map +1 -1
  90. package/dist/devices/linkind.d.ts.map +1 -1
  91. package/dist/devices/linkind.js +2 -22
  92. package/dist/devices/linkind.js.map +1 -1
  93. package/dist/devices/linptech.js +5 -5
  94. package/dist/devices/linptech.js.map +1 -1
  95. package/dist/devices/livolo.d.ts.map +1 -1
  96. package/dist/devices/livolo.js +94 -249
  97. package/dist/devices/livolo.js.map +1 -1
  98. package/dist/devices/lixee.d.ts.map +1 -1
  99. package/dist/devices/lixee.js +38 -51
  100. package/dist/devices/lixee.js.map +1 -1
  101. package/dist/devices/lumi.d.ts.map +1 -1
  102. package/dist/devices/lumi.js +21 -62
  103. package/dist/devices/lumi.js.map +1 -1
  104. package/dist/devices/mazda.d.ts.map +1 -1
  105. package/dist/devices/mazda.js +1 -4
  106. package/dist/devices/mazda.js.map +1 -1
  107. package/dist/devices/mindy.d.ts.map +1 -1
  108. package/dist/devices/mindy.js +13 -18
  109. package/dist/devices/mindy.js.map +1 -1
  110. package/dist/devices/moes.d.ts.map +1 -1
  111. package/dist/devices/moes.js +24 -60
  112. package/dist/devices/moes.js.map +1 -1
  113. package/dist/devices/namron.d.ts.map +1 -1
  114. package/dist/devices/namron.js +17 -59
  115. package/dist/devices/namron.js.map +1 -1
  116. package/dist/devices/neo.d.ts.map +1 -1
  117. package/dist/devices/neo.js +7 -34
  118. package/dist/devices/neo.js.map +1 -1
  119. package/dist/devices/nous.d.ts.map +1 -1
  120. package/dist/devices/nous.js +2 -6
  121. package/dist/devices/nous.js.map +1 -1
  122. package/dist/devices/onesti.d.ts +1 -1
  123. package/dist/devices/onesti.d.ts.map +1 -1
  124. package/dist/devices/onesti.js.map +1 -1
  125. package/dist/devices/orvibo.d.ts.map +1 -1
  126. package/dist/devices/orvibo.js +5 -4
  127. package/dist/devices/orvibo.js.map +1 -1
  128. package/dist/devices/orztech.d.ts.map +1 -1
  129. package/dist/devices/orztech.js +5 -20
  130. package/dist/devices/orztech.js.map +1 -1
  131. package/dist/devices/osram.d.ts.map +1 -1
  132. package/dist/devices/osram.js +6 -4
  133. package/dist/devices/osram.js.map +1 -1
  134. package/dist/devices/philips.d.ts.map +1 -1
  135. package/dist/devices/philips.js +7 -0
  136. package/dist/devices/philips.js.map +1 -1
  137. package/dist/devices/profalux.d.ts.map +1 -1
  138. package/dist/devices/profalux.js +20 -16
  139. package/dist/devices/profalux.js.map +1 -1
  140. package/dist/devices/rtx.js +1 -1
  141. package/dist/devices/rtx.js.map +1 -1
  142. package/dist/devices/saswell.d.ts.map +1 -1
  143. package/dist/devices/saswell.js +1 -6
  144. package/dist/devices/saswell.js.map +1 -1
  145. package/dist/devices/schneider_electric.d.ts.map +1 -1
  146. package/dist/devices/schneider_electric.js +15 -12
  147. package/dist/devices/schneider_electric.js.map +1 -1
  148. package/dist/devices/senoro.d.ts.map +1 -1
  149. package/dist/devices/senoro.js +1 -4
  150. package/dist/devices/senoro.js.map +1 -1
  151. package/dist/devices/shinasystem.d.ts.map +1 -1
  152. package/dist/devices/shinasystem.js +83 -21
  153. package/dist/devices/shinasystem.js.map +1 -1
  154. package/dist/devices/sinope.d.ts.map +1 -1
  155. package/dist/devices/sinope.js +14 -4
  156. package/dist/devices/sinope.js.map +1 -1
  157. package/dist/devices/smart9.d.ts.map +1 -1
  158. package/dist/devices/smart9.js +2 -7
  159. package/dist/devices/smart9.js.map +1 -1
  160. package/dist/devices/sonoff.d.ts.map +1 -1
  161. package/dist/devices/sonoff.js +1 -0
  162. package/dist/devices/sonoff.js.map +1 -1
  163. package/dist/devices/sunricher.d.ts.map +1 -1
  164. package/dist/devices/sunricher.js +4 -27
  165. package/dist/devices/sunricher.js.map +1 -1
  166. package/dist/devices/tech.d.ts.map +1 -1
  167. package/dist/devices/tech.js +2 -8
  168. package/dist/devices/tech.js.map +1 -1
  169. package/dist/devices/technicolor.d.ts.map +1 -1
  170. package/dist/devices/technicolor.js +2 -15
  171. package/dist/devices/technicolor.js.map +1 -1
  172. package/dist/devices/tuya.d.ts.map +1 -1
  173. package/dist/devices/tuya.js +193 -409
  174. package/dist/devices/tuya.js.map +1 -1
  175. package/dist/devices/ubisys.d.ts.map +1 -1
  176. package/dist/devices/ubisys.js +31 -52
  177. package/dist/devices/ubisys.js.map +1 -1
  178. package/dist/devices/universal_electronics_inc.d.ts.map +1 -1
  179. package/dist/devices/universal_electronics_inc.js +3 -29
  180. package/dist/devices/universal_electronics_inc.js.map +1 -1
  181. package/dist/devices/vesternet.d.ts.map +1 -1
  182. package/dist/devices/vesternet.js +4 -1
  183. package/dist/devices/vesternet.js.map +1 -1
  184. package/dist/devices/weiser.d.ts.map +1 -1
  185. package/dist/devices/weiser.js +3 -48
  186. package/dist/devices/weiser.js.map +1 -1
  187. package/dist/devices/woox.d.ts.map +1 -1
  188. package/dist/devices/woox.js +2 -3
  189. package/dist/devices/woox.js.map +1 -1
  190. package/dist/devices/yale.d.ts +1 -1
  191. package/dist/devices/yale.d.ts.map +1 -1
  192. package/dist/devices/yale.js.map +1 -1
  193. package/dist/devices/yandex.d.ts.map +1 -1
  194. package/dist/devices/yandex.js +4 -4
  195. package/dist/devices/yandex.js.map +1 -1
  196. package/dist/devices/zemismart.d.ts.map +1 -1
  197. package/dist/devices/zemismart.js +8 -23
  198. package/dist/devices/zemismart.js.map +1 -1
  199. package/dist/index.d.ts +4 -4
  200. package/dist/index.d.ts.map +1 -1
  201. package/dist/index.js +14 -7
  202. package/dist/index.js.map +1 -1
  203. package/dist/lib/develco.d.ts.map +1 -1
  204. package/dist/lib/develco.js +0 -2
  205. package/dist/lib/develco.js.map +1 -1
  206. package/dist/lib/ikea.d.ts.map +1 -1
  207. package/dist/lib/ikea.js +3 -2
  208. package/dist/lib/ikea.js.map +1 -1
  209. package/dist/lib/ledvance.js +1 -1
  210. package/dist/lib/ledvance.js.map +1 -1
  211. package/dist/lib/legrand.d.ts +6 -1
  212. package/dist/lib/legrand.d.ts.map +1 -1
  213. package/dist/lib/legrand.js +14 -3
  214. package/dist/lib/legrand.js.map +1 -1
  215. package/dist/lib/lumi.d.ts +1 -0
  216. package/dist/lib/lumi.d.ts.map +1 -1
  217. package/dist/lib/lumi.js +72 -18
  218. package/dist/lib/lumi.js.map +1 -1
  219. package/dist/lib/modernExtend.d.ts +14 -1
  220. package/dist/lib/modernExtend.d.ts.map +1 -1
  221. package/dist/lib/modernExtend.js +108 -14
  222. package/dist/lib/modernExtend.js.map +1 -1
  223. package/dist/lib/store.d.ts +4 -4
  224. package/dist/lib/store.d.ts.map +1 -1
  225. package/dist/lib/store.js +3 -0
  226. package/dist/lib/store.js.map +1 -1
  227. package/dist/lib/tuya.d.ts +18 -18
  228. package/dist/lib/tuya.d.ts.map +1 -1
  229. package/dist/lib/tuya.js +142 -155
  230. package/dist/lib/tuya.js.map +1 -1
  231. package/dist/lib/types.d.ts +31 -15
  232. package/dist/lib/types.d.ts.map +1 -1
  233. package/dist/lib/ubisys.d.ts +2 -1
  234. package/dist/lib/ubisys.d.ts.map +1 -1
  235. package/dist/lib/ubisys.js +46 -0
  236. package/dist/lib/ubisys.js.map +1 -1
  237. package/dist/lib/utils.d.ts +1 -2
  238. package/dist/lib/utils.d.ts.map +1 -1
  239. package/dist/lib/utils.js +0 -30
  240. package/dist/lib/utils.js.map +1 -1
  241. package/dist/models-index.json +1 -1
  242. package/package.json +3 -3
@@ -520,7 +520,7 @@ const tzLocal = {
520
520
  switch (key) {
521
521
  case "temperature_unit": {
522
522
  utils.assertString(value, "temperature_unit");
523
- await entity.write("manuSpecificTuya_2", {
523
+ await entity.write("manuSpecificTuya2", {
524
524
  "57355": { value: { celsius: 0, fahrenheit: 1 }[value], type: 48 },
525
525
  });
526
526
  break;
@@ -550,7 +550,7 @@ const tzLocal = {
550
550
  case "temperature_threshold": {
551
551
  const state = meta.state.temperature_breaker;
552
552
  const buf = Buffer.from([5, utils.getFromLookup(state, onOffLookup), 0, utils.toNumber(value, "temperature_threshold")]);
553
- await entity.command("manuSpecificTuya_3", "setOptions2", {
553
+ await entity.command("manuSpecificTuya3", "setOptions2", {
554
554
  data: buf,
555
555
  });
556
556
  break;
@@ -559,7 +559,7 @@ const tzLocal = {
559
559
  const threshold = meta.state.temperature_threshold;
560
560
  const number = utils.toNumber(threshold, "temperature_threshold");
561
561
  const buf = Buffer.from([5, utils.getFromLookup(value, onOffLookup), 0, number]);
562
- await entity.command("manuSpecificTuya_3", "setOptions2", {
562
+ await entity.command("manuSpecificTuya3", "setOptions2", {
563
563
  data: buf,
564
564
  });
565
565
  break;
@@ -567,7 +567,7 @@ const tzLocal = {
567
567
  case "power_threshold": {
568
568
  const state = meta.state.power_breaker;
569
569
  const buf = Buffer.from([7, utils.getFromLookup(state, onOffLookup), 0, utils.toNumber(value, "power_breaker")]);
570
- await entity.command("manuSpecificTuya_3", "setOptions2", {
570
+ await entity.command("manuSpecificTuya3", "setOptions2", {
571
571
  data: buf,
572
572
  });
573
573
  break;
@@ -576,7 +576,7 @@ const tzLocal = {
576
576
  const threshold = meta.state.power_threshold;
577
577
  const number = utils.toNumber(threshold, "power_breaker");
578
578
  const buf = Buffer.from([7, utils.getFromLookup(value, onOffLookup), 0, number]);
579
- await entity.command("manuSpecificTuya_3", "setOptions2", {
579
+ await entity.command("manuSpecificTuya3", "setOptions2", {
580
580
  data: buf,
581
581
  });
582
582
  break;
@@ -584,7 +584,7 @@ const tzLocal = {
584
584
  case "over_current_threshold": {
585
585
  const state = meta.state.over_current_breaker;
586
586
  const buf = Buffer.from([1, utils.getFromLookup(state, onOffLookup), 0, utils.toNumber(value, "over_current_threshold")]);
587
- await entity.command("manuSpecificTuya_3", "setOptions3", {
587
+ await entity.command("manuSpecificTuya3", "setOptions3", {
588
588
  data: buf,
589
589
  });
590
590
  break;
@@ -593,7 +593,7 @@ const tzLocal = {
593
593
  const threshold = meta.state.over_current_threshold;
594
594
  const number = utils.toNumber(threshold, "over_current_threshold");
595
595
  const buf = Buffer.from([1, utils.getFromLookup(value, onOffLookup), 0, number]);
596
- await entity.command("manuSpecificTuya_3", "setOptions3", {
596
+ await entity.command("manuSpecificTuya3", "setOptions3", {
597
597
  data: buf,
598
598
  });
599
599
  break;
@@ -604,7 +604,7 @@ const tzLocal = {
604
604
  buf.writeUInt8(3, 0);
605
605
  buf.writeUInt8(utils.getFromLookup(state, onOffLookup), 1);
606
606
  buf.writeUInt16BE(utils.toNumber(value, "over_voltage_threshold"), 2);
607
- await entity.command("manuSpecificTuya_3", "setOptions3", {
607
+ await entity.command("manuSpecificTuya3", "setOptions3", {
608
608
  data: buf,
609
609
  });
610
610
  break;
@@ -613,7 +613,7 @@ const tzLocal = {
613
613
  const threshold = meta.state.over_voltage_threshold;
614
614
  const number = utils.toNumber(threshold, "over_voltage_threshold");
615
615
  const buf = Buffer.from([3, utils.getFromLookup(value, onOffLookup), 0, number]);
616
- await entity.command("manuSpecificTuya_3", "setOptions3", {
616
+ await entity.command("manuSpecificTuya3", "setOptions3", {
617
617
  data: buf,
618
618
  });
619
619
  break;
@@ -621,7 +621,7 @@ const tzLocal = {
621
621
  case "under_voltage_threshold": {
622
622
  const state = meta.state.under_voltage_breaker;
623
623
  const buf = Buffer.from([4, utils.getFromLookup(state, onOffLookup), 0, utils.toNumber(value, "under_voltage_threshold")]);
624
- await entity.command("manuSpecificTuya_3", "setOptions3", {
624
+ await entity.command("manuSpecificTuya3", "setOptions3", {
625
625
  data: buf,
626
626
  });
627
627
  break;
@@ -630,7 +630,7 @@ const tzLocal = {
630
630
  const threshold = meta.state.under_voltage_threshold;
631
631
  const number = utils.toNumber(threshold, "under_voltage_breaker");
632
632
  const buf = Buffer.from([4, utils.getFromLookup(value, onOffLookup), 0, number]);
633
- await entity.command("manuSpecificTuya_3", "setOptions3", {
633
+ await entity.command("manuSpecificTuya3", "setOptions3", {
634
634
  data: buf,
635
635
  });
636
636
  break;
@@ -767,7 +767,7 @@ const fzLocal = {
767
767
  },
768
768
  },
769
769
  temperature_unit: {
770
- cluster: "manuSpecificTuya_2",
770
+ cluster: "manuSpecificTuya2",
771
771
  type: ["attributeReport", "readResponse"],
772
772
  convert: (model, msg, publish, options, meta) => {
773
773
  const result = {};
@@ -824,7 +824,7 @@ const fzLocal = {
824
824
  },
825
825
  // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
826
826
  TS011F_threshold: {
827
- cluster: "manuSpecificTuya_3",
827
+ cluster: "manuSpecificTuya3",
828
828
  type: "raw",
829
829
  convert: (model, msg, publish, options, meta) => {
830
830
  const splitToAttributes = (value) => {
@@ -952,6 +952,13 @@ exports.definitions = [
952
952
  exposes: [e.battery(), e.action(["click"])],
953
953
  toZigbee: [],
954
954
  },
955
+ {
956
+ fingerprint: tuya.fingerprint("TS0203", ["Zbeacon"]),
957
+ model: "ZC-W1",
958
+ vendor: "iHseno",
959
+ description: "Temperature & humidity sensor",
960
+ extend: [m.temperature(), m.humidity(), m.battery()],
961
+ },
955
962
  {
956
963
  zigbeeModel: ["TS0203", "ZG-102Z"],
957
964
  model: "TS0203",
@@ -1033,10 +1040,7 @@ exports.definitions = [
1033
1040
  model: "TS0601_water_valve",
1034
1041
  vendor: "Tuya",
1035
1042
  description: "Ultrasonic water meter valve",
1036
- fromZigbee: [tuya.fz.datapoints],
1037
- toZigbee: [tuya.tz.datapoints],
1038
- onEvent: tuya.onEventSetTime,
1039
- configure: tuya.configureMagicPacket,
1043
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
1040
1044
  exposes: [
1041
1045
  // Main valve switch
1042
1046
  e
@@ -1090,10 +1094,8 @@ exports.definitions = [
1090
1094
  model: "TS0203_1",
1091
1095
  vendor: "Tuya",
1092
1096
  description: "Door sensor with scene switch",
1093
- fromZigbee: [tuya.fz.datapoints, fz.ias_contact_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_contact_alarm_1_report],
1094
- toZigbee: [tuya.tz.datapoints],
1095
- onEvent: tuya.onEventSetTime,
1096
- configure: tuya.configureMagicPacket,
1097
+ fromZigbee: [fz.ias_contact_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_contact_alarm_1_report],
1098
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
1097
1099
  exposes: [e.action(["single", "double", "hold"]), e.contact(), e.battery_low(), e.tamper(), e.battery(), e.battery_voltage()],
1098
1100
  meta: {
1099
1101
  tuyaDatapoints: [[101, "action", tuya.valueConverterBasic.lookup({ single: 0, double: 1, hold: 2 })]],
@@ -1105,10 +1107,7 @@ exports.definitions = [
1105
1107
  model: "LKWSZ211",
1106
1108
  vendor: "Linkoze",
1107
1109
  description: "Scene remote with 2 keys",
1108
- fromZigbee: [tuya.fz.datapoints, fz.ignore_basic_report],
1109
- toZigbee: [tuya.tz.datapoints],
1110
- onEvent: tuya.onEventSetTime,
1111
- configure: tuya.configureMagicPacket,
1110
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
1112
1111
  exposes: [
1113
1112
  e.battery(),
1114
1113
  e.action(["button_1_single", "button_1_double", "button_1_hold", "button_2_single", "button_2_double", "button_2_hold"]),
@@ -1265,14 +1264,7 @@ exports.definitions = [
1265
1264
  model: "TS0601_temperature_humidity_sensor_2",
1266
1265
  vendor: "Tuya",
1267
1266
  description: "Temperature and humidity sensor",
1268
- fromZigbee: [tuya.fz.datapoints],
1269
- toZigbee: [tuya.tz.datapoints],
1270
- onEvent: tuya.onEvent({ queryOnDeviceAnnounce: true }),
1271
- configure: async (device, coordinatorEndpoint) => {
1272
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
1273
- // Required to get the device to start reporting
1274
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
1275
- },
1267
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryOnDeviceAnnounce: true, queryOnConfigure: true })],
1276
1268
  exposes: [e.temperature(), e.humidity(), tuya.exposes.batteryState(), tuya.exposes.temperatureUnit()],
1277
1269
  meta: {
1278
1270
  tuyaDatapoints: [
@@ -1296,14 +1288,7 @@ exports.definitions = [
1296
1288
  model: "TS0601_temperature_humidity_sensor_3",
1297
1289
  vendor: "Tuya",
1298
1290
  description: "Temperature & humidity sensor",
1299
- fromZigbee: [tuya.fz.datapoints],
1300
- configure: async (device, coordinatorEndpoint) => {
1301
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
1302
- // Required to get the device to start reporting (-- Maybe needed? Copied this from another humidity sensor configuration)
1303
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
1304
- },
1305
- toZigbee: [tuya.tz.datapoints],
1306
- onEvent: tuya.onEventSetLocalTime,
1291
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true, queryOnConfigure: true })],
1307
1292
  exposes: [e.temperature(), e.humidity(), e.battery(), tuya.exposes.temperatureUnit()],
1308
1293
  meta: {
1309
1294
  tuyaDatapoints: [
@@ -1320,14 +1305,7 @@ exports.definitions = [
1320
1305
  model: "ZTH05Z",
1321
1306
  vendor: "Tuya",
1322
1307
  description: "Temperature and humidity sensor",
1323
- fromZigbee: [tuya.fz.datapoints],
1324
- toZigbee: [tuya.tz.datapoints],
1325
- onEvent: tuya.onEvent({ queryOnDeviceAnnounce: true }),
1326
- configure: async (device, coordinatorEndpoint) => {
1327
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
1328
- // Required to get the device to start reporting
1329
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
1330
- },
1308
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryOnDeviceAnnounce: true, queryOnConfigure: true })],
1331
1309
  exposes: [
1332
1310
  e.temperature(),
1333
1311
  e.humidity(),
@@ -1417,9 +1395,7 @@ exports.definitions = [
1417
1395
  model: "TS0601_contact_temperature_humidity_sensor",
1418
1396
  vendor: "Tuya",
1419
1397
  description: "Contact, temperature and humidity sensor",
1420
- fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
1421
- toZigbee: [tuya.tz.datapoints],
1422
- configure: tuya.configureMagicPacket,
1398
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
1423
1399
  exposes: [e.contact(), e.temperature(), e.humidity(), e.battery()],
1424
1400
  meta: {
1425
1401
  tuyaDatapoints: [
@@ -1982,10 +1958,8 @@ exports.definitions = [
1982
1958
  description: "Motion detector with illuminance",
1983
1959
  fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report],
1984
1960
  toZigbee: [],
1985
- onEvent: tuya.onEventSetTime,
1986
- configure: tuya.configureMagicPacket,
1961
+ extend: [m.illuminance(), tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
1987
1962
  exposes: [e.occupancy(), e.battery_low(), e.battery(), e.tamper()],
1988
- extend: [m.illuminance()],
1989
1963
  },
1990
1964
  {
1991
1965
  fingerprint: tuya.fingerprint("TS0202", ["_TZ3210_cwamkvua"]),
@@ -3712,6 +3686,7 @@ exports.definitions = [
3712
3686
  tuya.whitelabel("Tuya", "TS0044_1", "Zigbee 4 button remote - 12 scene", ["_TZ3000_dziaict4", "_TZ3000_mh9px7cq", "_TZ3000_j61x9rxn"]),
3713
3687
  tuya.whitelabel("Tuya", "TM-YKQ004", "Zigbee 4 button remote - 12 scene", ["_TZ3000_u3nv1jwk"]),
3714
3688
  tuya.whitelabel("HOBEIAN", "ZG-101ZS", "Star Ring 4 Gang Scene Switch", ["_TZ3000_bgtzm4ny"]),
3689
+ tuya.whitelabel("Moes", "XH-SY-04Z", "4 button portable remote control", ["_TZ3000_zgyzgdua"]),
3715
3690
  ],
3716
3691
  fromZigbee: [tuya.fz.on_off_action, fz.battery],
3717
3692
  exposes: [
@@ -3885,10 +3860,7 @@ exports.definitions = [
3885
3860
  model: "BAC-003",
3886
3861
  vendor: "Tuya",
3887
3862
  description: "FCU thermostat temperature controller",
3888
- fromZigbee: [tuya.fz.datapoints],
3889
- toZigbee: [tuya.tz.datapoints],
3890
- onEvent: tuya.onEventSetLocalTime,
3891
- configure: tuya.configureMagicPacket,
3863
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
3892
3864
  options: [
3893
3865
  e
3894
3866
  .enum("control_sequence_of_operation", ea.SET, ["cooling_only", "cooling_and_heating_4-pipes"])
@@ -4066,12 +4038,7 @@ exports.definitions = [
4066
4038
  vendor: "Tuya",
4067
4039
  description: "Water leak sensor",
4068
4040
  fromZigbee: [fz.ignore_basic_report, fz.ignore_tuya_raw, legacy.fromZigbee.wls100z_water_leak],
4069
- toZigbee: [],
4070
- onEvent: tuya.onEventSetTime,
4071
- configure: async (device, coordinatorEndpoint) => {
4072
- const endpoint = device.getEndpoint(1);
4073
- await reporting.bind(endpoint, coordinatorEndpoint, ["genBasic"]);
4074
- },
4041
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000", bindBasicOnConfigure: true })],
4075
4042
  exposes: [e.battery(), e.water_leak()],
4076
4043
  },
4077
4044
  {
@@ -4140,14 +4107,14 @@ exports.definitions = [
4140
4107
  tuya.whitelabel("Nous", "L6Z", "Switch with power monitoring", ["_TZ3000_qaabwu5c", "_TZ3000_1adss9de"]),
4141
4108
  tuya.whitelabel("Tuya", "XSH01A", "1 gang switch", ["_TZ3000_x3ewpzyr"]),
4142
4109
  ],
4143
- onEvent: async (type, data, device, options) => {
4144
- if (["_TZ3000_x3ewpzyr"].includes(device.manufacturerName)) {
4145
- await tuya.onEventMeasurementPoll(type, data, device, options, true, true);
4146
- }
4147
- else if (["_TZ3000_xkap8wtb"].includes(device.manufacturerName) && [162, 100].includes(device.applicationVersion)) {
4148
- await tuya.onEventMeasurementPoll(type, data, device, options, true, true);
4149
- }
4150
- },
4110
+ extend: [
4111
+ tuya.modernExtend.electricityMeasurementPoll({
4112
+ electricalMeasurement: (device) => device.manufacturerName === "_TZ3000_x3ewpzyr" ||
4113
+ (device.manufacturerName === "_TZ3000_xkap8wtb" && [162, 100].includes(device.applicationVersion)),
4114
+ metering: (device) => device.manufacturerName === "_TZ3000_x3ewpzyr" ||
4115
+ (device.manufacturerName === "_TZ3000_xkap8wtb" && [162, 100].includes(device.applicationVersion)),
4116
+ }),
4117
+ ],
4151
4118
  },
4152
4119
  {
4153
4120
  fingerprint: tuya.fingerprint("TS0002", ["_TZ3000_aaifmpuq", "_TZ3000_irrmjcgi", "_TZ3000_huvxrx4i"]),
@@ -4831,10 +4798,7 @@ exports.definitions = [
4831
4798
  model: "TS0601_cover_7",
4832
4799
  vendor: "Tuya",
4833
4800
  description: "Cover motor",
4834
- onEvent: tuya.onEvent(),
4835
- configure: tuya.configureMagicPacket,
4836
- fromZigbee: [tuya.fz.datapoints],
4837
- toZigbee: [tuya.tz.datapoints],
4801
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
4838
4802
  exposes: [e.cover_position().setAccess("position", ea.STATE_SET), e.battery()],
4839
4803
  meta: {
4840
4804
  tuyaDatapoints: [
@@ -4905,10 +4869,7 @@ exports.definitions = [
4905
4869
  vendor: "Tuya",
4906
4870
  description: "Window opener",
4907
4871
  options: [exposes.options.invert_cover()],
4908
- fromZigbee: [tuya.fz.datapoints],
4909
- toZigbee: [tuya.tz.datapoints],
4910
- onEvent: tuya.onEventSetTime,
4911
- configure: tuya.configureMagicPacket,
4872
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
4912
4873
  exposes: [e.cover_position().setAccess("position", ea.STATE_SET)],
4913
4874
  meta: {
4914
4875
  tuyaDatapoints: [
@@ -4931,10 +4892,7 @@ exports.definitions = [
4931
4892
  model: "TS0601_cover_9",
4932
4893
  vendor: "Tuya",
4933
4894
  description: "Cover motor",
4934
- onEvent: tuya.onEvent(),
4935
- configure: tuya.configureMagicPacket,
4936
- fromZigbee: [tuya.fz.datapoints],
4937
- toZigbee: [tuya.tz.datapoints],
4895
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
4938
4896
  exposes: [e.cover_position().setAccess("position", ea.STATE_SET), e.battery()],
4939
4897
  meta: {
4940
4898
  tuyaDatapoints: [
@@ -4966,10 +4924,7 @@ exports.definitions = [
4966
4924
  model: "_TZE284_debczeci",
4967
4925
  vendor: "iHseno",
4968
4926
  description: "Human presence sensor",
4969
- fromZigbee: [tuya.fz.datapoints],
4970
- toZigbee: [tuya.tz.datapoints],
4971
- onEvent: tuya.onEventSetLocalTime,
4972
- configure: tuya.configureMagicPacket,
4927
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
4973
4928
  exposes: [
4974
4929
  e.presence().withDescription("Human presence detected"),
4975
4930
  e.battery().withDescription("Battery percentage"),
@@ -4990,10 +4945,7 @@ exports.definitions = [
4990
4945
  model: "TS0601_cover_10",
4991
4946
  vendor: "Tuya",
4992
4947
  description: "Cover motor",
4993
- onEvent: tuya.onEvent(),
4994
- configure: tuya.configureMagicPacket,
4995
- fromZigbee: [tuya.fz.datapoints],
4996
- toZigbee: [tuya.tz.datapoints],
4948
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
4997
4949
  exposes: [
4998
4950
  e.cover_position().setAccess("position", ea.STATE_SET),
4999
4951
  e.enum("motor_direction", ea.STATE_SET, ["normal", "reversed"]).withDescription("Set the motor direction"),
@@ -5090,10 +5042,7 @@ exports.definitions = [
5090
5042
  model: "BX82-TYZ1",
5091
5043
  vendor: "Manhot",
5092
5044
  description: "Cover motor",
5093
- onEvent: tuya.onEvent(),
5094
- configure: tuya.configureMagicPacket,
5095
- fromZigbee: [tuya.fz.datapoints],
5096
- toZigbee: [tuya.tz.datapoints],
5045
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
5097
5046
  exposes: [
5098
5047
  e.cover_position().setAccess("position", ea.STATE_SET),
5099
5048
  e.enum("motor_direction", ea.STATE_SET, ["normal", "reversed"]).withDescription("Set the motor direction"),
@@ -5127,10 +5076,7 @@ exports.definitions = [
5127
5076
  model: "MB60L-ZG-ZT-TY",
5128
5077
  vendor: "Manhot",
5129
5078
  description: "Smart blinds motor",
5130
- onEvent: tuya.onEvent(),
5131
- configure: tuya.configureMagicPacket,
5132
- fromZigbee: [tuya.fz.datapoints],
5133
- toZigbee: [tuya.tz.datapoints],
5079
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
5134
5080
  exposes: [
5135
5081
  e.battery(),
5136
5082
  e.cover_position().setAccess("position", ea.STATE_SET),
@@ -5216,7 +5162,7 @@ exports.definitions = [
5216
5162
  tuyaThermostatSystemMode: legacy.thermostatSystemModes3,
5217
5163
  },
5218
5164
  ota: true,
5219
- onEvent: tuya.onEventSetLocalTime,
5165
+ extend: [tuya.modernExtend.tuyaBase({ forceTimeUpdates: true })],
5220
5166
  fromZigbee: [legacy.fromZigbee.tuya_thermostat, fz.ignore_basic_report, fz.ignore_tuya_set_time],
5221
5167
  toZigbee: [
5222
5168
  legacy.toZigbee.tuya_thermostat_child_lock,
@@ -5281,10 +5227,7 @@ exports.definitions = [
5281
5227
  model: "BAB-1413_Pro",
5282
5228
  vendor: "Tuya",
5283
5229
  description: "Thermostat radiator valve",
5284
- fromZigbee: [tuya.fz.datapoints],
5285
- toZigbee: [tuya.tz.datapoints],
5286
- onEvent: tuya.onEventSetTime,
5287
- configure: tuya.configureMagicPacket,
5230
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
5288
5231
  ota: true,
5289
5232
  exposes: [
5290
5233
  e.battery(),
@@ -5401,10 +5344,7 @@ exports.definitions = [
5401
5344
  model: "PO-THCO-EAU",
5402
5345
  vendor: "Powernity",
5403
5346
  description: "Thermostat radiator valve",
5404
- fromZigbee: [tuya.fz.datapoints],
5405
- toZigbee: [tuya.tz.datapoints],
5406
- onEvent: tuya.onEventSetTime,
5407
- configure: tuya.configureMagicPacket,
5347
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
5408
5348
  exposes: [
5409
5349
  e.battery().withUnit("%"),
5410
5350
  e.child_lock(),
@@ -5484,11 +5424,8 @@ exports.definitions = [
5484
5424
  model: "TS0601_cover_3",
5485
5425
  vendor: "Tuya",
5486
5426
  description: "Cover motor",
5487
- fromZigbee: [tuya.fz.datapoints],
5488
- toZigbee: [tuya.tz.datapoints],
5489
- onEvent: tuya.onEventSetTime,
5427
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
5490
5428
  options: [exposes.options.invert_cover()],
5491
- configure: tuya.configureMagicPacket,
5492
5429
  exposes: [
5493
5430
  e.battery(),
5494
5431
  e.cover_position().setAccess("position", ea.STATE_SET),
@@ -5630,10 +5567,7 @@ exports.definitions = [
5630
5567
  tuya.whitelabel("GIEX", "TV06", "Thermostat radiator valve", ["_TZE200_py4cm3he"]),
5631
5568
  ],
5632
5569
  ota: true,
5633
- fromZigbee: [tuya.fz.datapoints],
5634
- toZigbee: [tuya.tz.datapoints],
5635
- onEvent: tuya.onEventSetLocalTime,
5636
- configure: tuya.configureMagicPacket,
5570
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
5637
5571
  exposes: [
5638
5572
  e.battery_low(),
5639
5573
  e.child_lock(),
@@ -5742,10 +5676,7 @@ exports.definitions = [
5742
5676
  vendor: "Tuya",
5743
5677
  description: "Thermostat radiator valve",
5744
5678
  whiteLabel: [{ vendor: "S366", model: "Cloud Even" }],
5745
- fromZigbee: [tuya.fz.datapoints],
5746
- toZigbee: [tuya.tz.datapoints],
5747
- onEvent: tuya.onEventSetLocalTime,
5748
- configure: tuya.configureMagicPacket,
5679
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
5749
5680
  meta: {
5750
5681
  tuyaDatapoints: [
5751
5682
  [1, "system_mode", tuya.valueConverterBasic.lookup({ heat: true, off: false })],
@@ -5817,8 +5748,6 @@ exports.definitions = [
5817
5748
  model: "TS0601_thermostat_3",
5818
5749
  vendor: "Tuya",
5819
5750
  description: "Thermostatic radiator valve",
5820
- fromZigbee: [tuya.fz.datapoints],
5821
- toZigbee: [tuya.tz.datapoints],
5822
5751
  whiteLabel: [
5823
5752
  tuya.whitelabel("AVATTO", "ME167", "Thermostatic radiator valve", [
5824
5753
  "_TZE200_p3dbf6qs",
@@ -5838,8 +5767,7 @@ exports.definitions = [
5838
5767
  "_TZE200_suxywabt",
5839
5768
  ]),
5840
5769
  ],
5841
- onEvent: tuya.onEventSetTime,
5842
- configure: tuya.configureMagicPacket,
5770
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
5843
5771
  exposes: [
5844
5772
  e.child_lock(),
5845
5773
  e.battery_low(),
@@ -5906,10 +5834,7 @@ exports.definitions = [
5906
5834
  model: "TS0601_thermostat_4",
5907
5835
  vendor: "Tuya",
5908
5836
  description: "Thermostatic radiator valve",
5909
- fromZigbee: [tuya.fz.datapoints],
5910
- toZigbee: [tuya.tz.datapoints],
5911
- onEvent: tuya.onEventSetLocalTime,
5912
- configure: tuya.configureMagicPacket,
5837
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
5913
5838
  exposes: [
5914
5839
  e.child_lock(),
5915
5840
  e.battery(),
@@ -5999,7 +5924,7 @@ exports.definitions = [
5999
5924
  legacy.toZigbee.tuya_thermostat_current_heating_setpoint,
6000
5925
  legacy.toZigbee.tuya_thermostat_weekly_schedule,
6001
5926
  ],
6002
- onEvent: tuya.onEventSetTime,
5927
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
6003
5928
  meta: {
6004
5929
  thermostat: {
6005
5930
  weeklyScheduleMaxTransitions: 4,
@@ -6036,7 +5961,7 @@ exports.definitions = [
6036
5961
  legacy.toZigbee.tuya_thermostat_current_heating_setpoint,
6037
5962
  legacy.toZigbee.tuya_thermostat_weekly_schedule,
6038
5963
  ],
6039
- onEvent: tuya.onEventSetTime,
5964
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
6040
5965
  meta: {
6041
5966
  timeout: 20000, // TRV wakes up every 10sec
6042
5967
  thermostat: {
@@ -6066,10 +5991,7 @@ exports.definitions = [
6066
5991
  tuya.whitelabel("id3", "GTZ06", "Thermostatic radiator valve", ["_TZE200_z1tyspqw"]),
6067
5992
  tuya.whitelabel("AVATTO", "TRV07", "Thermostatic radiator valve", ["_TZE200_bvrlmajk"]),
6068
5993
  ],
6069
- onEvent: tuya.onEventSetLocalTime,
6070
- fromZigbee: [tuya.fz.datapoints],
6071
- toZigbee: [tuya.tz.datapoints],
6072
- configure: tuya.configureMagicPacket,
5994
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
6073
5995
  exposes: [
6074
5996
  e.battery(),
6075
5997
  e.child_lock(),
@@ -6153,10 +6075,7 @@ exports.definitions = [
6153
6075
  vendor: "Tuya",
6154
6076
  whiteLabel: [tuya.whitelabel("Sber", "SBDV-00185", "Thermostatic radiator valve", ["_TZE204_cvcu2p6e"])],
6155
6077
  description: "Thermostatic radiator valve",
6156
- onEvent: tuya.onEventSetLocalTime,
6157
- fromZigbee: [tuya.fz.datapoints],
6158
- toZigbee: [tuya.tz.datapoints],
6159
- configure: tuya.configureMagicPacket,
6078
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
6160
6079
  exposes: [
6161
6080
  e.battery(),
6162
6081
  e.child_lock(),
@@ -6232,10 +6151,7 @@ exports.definitions = [
6232
6151
  vendor: "Tuya",
6233
6152
  description: "Thermostatic radiator valve.",
6234
6153
  whiteLabel: [tuya.whitelabel("Moes", "TRV801", "Thermostatic radiator valve", ["_TZE204_9mjy74mp", "_TZE200_9mjy74mp"])],
6235
- onEvent: tuya.onEventSetLocalTime,
6236
- fromZigbee: [tuya.fz.datapoints],
6237
- toZigbee: [tuya.tz.datapoints],
6238
- configure: tuya.configureMagicPacket,
6154
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
6239
6155
  exposes: [
6240
6156
  e.battery(),
6241
6157
  e.child_lock(),
@@ -6464,10 +6380,7 @@ exports.definitions = [
6464
6380
  model: "ZHT-002",
6465
6381
  vendor: "Moes",
6466
6382
  description: "ZHT series thermostat",
6467
- fromZigbee: [tuya.fz.datapoints],
6468
- toZigbee: [tuya.tz.datapoints],
6469
- onEvent: tuya.onEventSetTime,
6470
- configure: tuya.configureMagicPacket,
6383
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
6471
6384
  exposes: [
6472
6385
  e.binary("state", ea.STATE_SET, "ON", "OFF").withDescription("Turn the thermostat ON/OFF"),
6473
6386
  e.child_lock(),
@@ -6566,10 +6479,7 @@ exports.definitions = [
6566
6479
  model: "TRV603-WZ",
6567
6480
  vendor: "Tuya",
6568
6481
  description: "Thermostatic radiator valve.",
6569
- fromZigbee: [tuya.fz.datapoints],
6570
- toZigbee: [tuya.tz.datapoints],
6571
- onEvent: tuya.onEventSetLocalTime,
6572
- configure: tuya.configureMagicPacket,
6482
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
6573
6483
  exposes: [
6574
6484
  e.battery(),
6575
6485
  e.child_lock(),
@@ -6696,7 +6606,6 @@ exports.definitions = [
6696
6606
  }
6697
6607
  await endpoint.read("genOnOff", ["onOff", "moesStartUpOnOff", "tuyaBacklightMode"]);
6698
6608
  },
6699
- options: [exposes.options.measurement_poll_interval()],
6700
6609
  // This device doesn't support reporting correctly.
6701
6610
  // https://github.com/Koenkk/zigbee-herdsman-converters/pull/1270
6702
6611
  exposes: [
@@ -6708,7 +6617,7 @@ exports.definitions = [
6708
6617
  e.enum("power_outage_memory", ea.ALL, ["on", "off", "restore"]).withDescription("Recover state after power outage"),
6709
6618
  e.enum("indicator_mode", ea.ALL, ["off", "off/on", "on/off"]).withDescription("LED indicator mode"),
6710
6619
  ],
6711
- onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false),
6620
+ extend: [tuya.modernExtend.electricityMeasurementPoll()],
6712
6621
  },
6713
6622
  {
6714
6623
  fingerprint: tuya.fingerprint("TS0111", ["_TYZB01_ymcdbl3u"]),
@@ -6737,7 +6646,7 @@ exports.definitions = [
6737
6646
  { vendor: "Aubess", model: "TS011F_plug_1" },
6738
6647
  tuya.whitelabel("BSEED", "FK86ZEUSK1W", "Wall-mounted electrical socket", ["_TZ3000_4ux0ondb"]),
6739
6648
  tuya.whitelabel("Nous", "A1Z", "Smart plug (with power monitoring)", ["_TZ3000_2putqrmw", "_TZ3000_ksw8qtmt"]),
6740
- tuya.whitelabel("Moes", "MOES_plug", "Smart plug (with power monitoring)", ["_TZ3000_yujkchbz"]),
6649
+ tuya.whitelabel("Moes", "Moes_plug", "Smart plug (with power monitoring)", ["_TZ3000_yujkchbz"]),
6741
6650
  tuya.whitelabel("Moes", "ZK-EU", "Smart wallsocket (with power monitoring)", ["_TZ3000_ss98ec5d"]),
6742
6651
  tuya.whitelabel("Elivco", "LSPA9", "Smart plug (with power monitoring)", ["_TZ3000_okaz9tjs"]),
6743
6652
  tuya.whitelabel("PSMART", "T440", "Smart wallsocket (with power monitoring)", ["_TZ3000_y4ona9me"]),
@@ -6835,6 +6744,9 @@ exports.definitions = [
6835
6744
  indicatorMode: true,
6836
6745
  childLock: true,
6837
6746
  }),
6747
+ tuya.modernExtend.electricityMeasurementPoll({
6748
+ metering: (device) => [100, 160].includes(device.applicationVersion) || ["1.0.5\u0000"].includes(device.softwareBuildID), // polling for energy
6749
+ }),
6838
6750
  ],
6839
6751
  configure: async (device, coordinatorEndpoint) => {
6840
6752
  await tuya.configureMagicPacket(device, coordinatorEndpoint);
@@ -6850,9 +6762,6 @@ exports.definitions = [
6850
6762
  utils.attachOutputCluster(device, "genOta");
6851
6763
  device.save();
6852
6764
  },
6853
- options: [exposes.options.measurement_poll_interval()],
6854
- onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, // polling for voltage, current and power
6855
- [100, 160].includes(device.applicationVersion) || ["1.0.5\u0000"].includes(device.softwareBuildID)),
6856
6765
  },
6857
6766
  {
6858
6767
  fingerprint: tuya.fingerprint("TS011F", ["_TZ3000_in5s3wn1", "_TZ3000_wbloefbf"]),
@@ -6938,15 +6847,35 @@ exports.definitions = [
6938
6847
  ],
6939
6848
  },
6940
6849
  },
6850
+ {
6851
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE284_ai4rqhky"]),
6852
+ model: "HS2SA-1",
6853
+ vendor: "Heiman",
6854
+ description: "Photoelectric Smoke Alarm",
6855
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
6856
+ exposes: [
6857
+ e.smoke(),
6858
+ e.battery(),
6859
+ tuya.exposes.batteryState(),
6860
+ e.binary("silence", ea.STATE_SET, "ON", "OFF"),
6861
+ e.enum("self_test", ea.STATE, ["checking", "check_success", "check_failure"]),
6862
+ ],
6863
+ meta: {
6864
+ tuyaDatapoints: [
6865
+ [1, "smoke", tuya.valueConverter.trueFalse0],
6866
+ [9, "self_test", tuya.valueConverterBasic.lookup({ checking: 0, check_success: 1, check_failure: 2 })],
6867
+ [14, "battery_state", tuya.valueConverter.batteryState],
6868
+ [15, "battery", tuya.valueConverter.raw],
6869
+ [16, "silence", tuya.valueConverter.onOff],
6870
+ ],
6871
+ },
6872
+ },
6941
6873
  {
6942
6874
  fingerprint: tuya.fingerprint("TS0601", ["_TZE200_m9skfctm", "_TZE200_rccxox8p", "_TZE284_rccxox8p"]),
6943
6875
  model: "PA-44Z",
6944
6876
  vendor: "Tuya",
6945
6877
  description: "Photoelectric smoke detector",
6946
- fromZigbee: [tuya.fz.datapoints],
6947
- toZigbee: [tuya.tz.datapoints],
6948
- onEvent: tuya.onEventSetTime,
6949
- configure: tuya.configureMagicPacket,
6878
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
6950
6879
  exposes: [
6951
6880
  e.smoke(),
6952
6881
  e.battery(),
@@ -7041,10 +6970,7 @@ exports.definitions = [
7041
6970
  model: "ZS-301Z",
7042
6971
  vendor: "Arteco",
7043
6972
  description: "Soil moisture sensor",
7044
- fromZigbee: [tuya.fz.datapoints],
7045
- toZigbee: [tuya.tz.datapoints],
7046
- onEvent: tuya.onEventSetTime,
7047
- configure: tuya.configureMagicPacket,
6973
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
7048
6974
  exposes: [
7049
6975
  e.enum("battery_state", ea.STATE, ["low", "middle", "high"]).withDescription("low: 1-25%, middle: 26-50%, high: 51-100%"),
7050
6976
  e.temperature(),
@@ -7082,10 +7008,7 @@ exports.definitions = [
7082
7008
  model: "ZSS-QY-SSD-A-EN",
7083
7009
  vendor: "Tuya",
7084
7010
  description: "Smart smoke alarm",
7085
- fromZigbee: [tuya.fz.datapoints],
7086
- toZigbee: [tuya.tz.datapoints],
7087
- onEvent: tuya.onEventSetTime,
7088
- configure: tuya.configureMagicPacket,
7011
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
7089
7012
  exposes: [
7090
7013
  e.smoke(),
7091
7014
  tuya.exposes.faultAlarm(),
@@ -7122,16 +7045,14 @@ exports.definitions = [
7122
7045
  e.binary("alarm", ea.STATE_SET, true, false).withDescription("Enable the alarm"),
7123
7046
  e.binary("silence_siren", ea.STATE_SET, true, false).withDescription("Silence the siren"),
7124
7047
  ],
7125
- onEvent: tuya.onEventSetTime,
7048
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
7126
7049
  },
7127
7050
  {
7128
7051
  fingerprint: tuya.fingerprint("TS0601", ["_TZE204_cjbofhxw", "_TZE284_cjbofhxw"]),
7129
7052
  model: "PJ-MGW1203",
7130
7053
  vendor: "Tuya",
7131
7054
  description: "Clamp meter",
7132
- fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
7133
- toZigbee: [tuya.tz.datapoints],
7134
- configure: tuya.configureMagicPacket,
7055
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
7135
7056
  exposes: [e.current(), e.power(), e.voltage(), e.energy()],
7136
7057
  meta: {
7137
7058
  tuyaDatapoints: [
@@ -8367,7 +8288,7 @@ exports.definitions = [
8367
8288
  description: "Wall-mount thermostat",
8368
8289
  fromZigbee: [legacy.fromZigbee.hy_thermostat, fz.ignore_basic_report],
8369
8290
  toZigbee: [legacy.toZigbee.hy_thermostat],
8370
- onEvent: tuya.onEventSetTime,
8291
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
8371
8292
  exposes: [
8372
8293
  e
8373
8294
  .climate()
@@ -8382,10 +8303,7 @@ exports.definitions = [
8382
8303
  model: "ZWT07",
8383
8304
  vendor: "Tuya",
8384
8305
  description: "Wall-mount thermostat",
8385
- fromZigbee: [tuya.fz.datapoints],
8386
- toZigbee: [tuya.tz.datapoints],
8387
- onEvent: tuya.onEvent({ timeStart: "1970" }),
8388
- configure: tuya.configureMagicPacket,
8306
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
8389
8307
  exposes: [
8390
8308
  e
8391
8309
  .climate()
@@ -8472,7 +8390,7 @@ exports.definitions = [
8472
8390
  .withValueStep(1)
8473
8391
  .withPreset("default", 60, "Default value"),
8474
8392
  ],
8475
- onEvent: tuya.onEventSetTime,
8393
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
8476
8394
  },
8477
8395
  {
8478
8396
  fingerprint: tuya.fingerprint("TS0601", [
@@ -8486,13 +8404,7 @@ exports.definitions = [
8486
8404
  model: "ZWT198/ZWT100-BH",
8487
8405
  vendor: "Tuya",
8488
8406
  description: "Wall thermostat",
8489
- onEvent: tuya.onEvent({
8490
- timeStart: "1970",
8491
- respondToMcuVersionResponse: false,
8492
- }),
8493
- fromZigbee: [tuya.fz.datapoints],
8494
- toZigbee: [tuya.tz.datapoints],
8495
- configure: tuya.configureMagicPacket,
8407
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, respondToMcuVersionResponse: false })],
8496
8408
  exposes: [
8497
8409
  e.binary("factory_reset", ea.STATE_SET, "ON", "OFF").withDescription("Full factory reset, use with caution!"),
8498
8410
  e.child_lock(),
@@ -8642,10 +8554,7 @@ exports.definitions = [
8642
8554
  model: "TGM50-ZB",
8643
8555
  vendor: "Tuya",
8644
8556
  description: "Beok wall thermostat",
8645
- onEvent: tuya.onEvent({ timeStart: "1970" }),
8646
- fromZigbee: [tuya.fz.datapoints],
8647
- toZigbee: [tuya.tz.datapoints],
8648
- configure: tuya.configureMagicPacket,
8557
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
8649
8558
  exposes: [
8650
8559
  e.child_lock(),
8651
8560
  e.temperature_sensor_select(["internal", "external", "both"]),
@@ -8772,6 +8681,14 @@ exports.definitions = [
8772
8681
  configure: tuya.configureMagicPacket,
8773
8682
  extend: [m.illuminance()],
8774
8683
  },
8684
+ {
8685
+ fingerprint: tuya.fingerprint("TS0222", ["_TZ3000_j6adk9id"]),
8686
+ model: "TS0222_solar_light",
8687
+ vendor: "Tuya",
8688
+ description: "Solar light sensor",
8689
+ configure: tuya.configureMagicPacket,
8690
+ extend: [m.illuminance(), m.battery()],
8691
+ },
8775
8692
  {
8776
8693
  zigbeeModel: ["TS0210"],
8777
8694
  model: "TS0210",
@@ -8910,8 +8827,7 @@ exports.definitions = [
8910
8827
  e.enum("power_outage_memory", ea.ALL, ["on", "off", "restore"]).withDescription("Recover state after power outage"),
8911
8828
  e.enum("indicator_mode", ea.STATE_SET, ["off", "on_off", "off_on"]).withDescription("Relay LED indicator mode"),
8912
8829
  ],
8913
- options: [exposes.options.measurement_poll_interval()],
8914
- onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false),
8830
+ extend: [tuya.modernExtend.electricityMeasurementPoll()],
8915
8831
  },
8916
8832
  {
8917
8833
  fingerprint: [...tuya.fingerprint("TS011F", ["_TZ3000_7issjl2q"]), ...tuya.fingerprint("TS0011", ["_TZ3000_gzvniqjb"])],
@@ -9059,7 +8975,7 @@ exports.definitions = [
9059
8975
  "genPowerCfg",
9060
8976
  "msTemperatureMeasurement",
9061
8977
  "msRelativeHumidity",
9062
- "manuSpecificTuya_2",
8978
+ "manuSpecificTuya2",
9063
8979
  ]);
9064
8980
  },
9065
8981
  exposes: [
@@ -9276,10 +9192,9 @@ exports.definitions = [
9276
9192
  fz.tuya_operation_mode,
9277
9193
  ],
9278
9194
  toZigbee: [tz.tuya_operation_mode],
9279
- onEvent: tuya.onEventSetLocalTime,
9195
+ extend: [tuya.modernExtend.tuyaBase({ forceTimeUpdates: true })],
9280
9196
  configure: async (device, coordinatorEndpoint) => {
9281
9197
  const endpoint = device.getEndpoint(1);
9282
- await endpoint.read("genBasic", [0x0004, 0x000, 0x0001, 0x0005, 0x0007, 0xfffe]);
9283
9198
  await endpoint.write("genOnOff", { tuyaOperationMode: 1 });
9284
9199
  await endpoint.read("genOnOff", ["tuyaOperationMode"]);
9285
9200
  try {
@@ -9631,10 +9546,7 @@ exports.definitions = [
9631
9546
  model: "Y1_IN",
9632
9547
  vendor: "Tuya",
9633
9548
  description: "Smart human presence sensor 24G",
9634
- fromZigbee: [tuya.fz.datapoints],
9635
- toZigbee: [tuya.tz.datapoints],
9636
- onEvent: tuya.onEventSetTime,
9637
- configure: tuya.configureMagicPacket,
9549
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
9638
9550
  exposes: [
9639
9551
  e.presence(),
9640
9552
  e.illuminance(),
@@ -9776,10 +9688,7 @@ exports.definitions = [
9776
9688
  model: "WZ-M100",
9777
9689
  vendor: "Wenzhi",
9778
9690
  description: "Human presence sensor",
9779
- fromZigbee: [tuya.fz.datapoints],
9780
- toZigbee: [tuya.tz.datapoints],
9781
- onEvent: tuya.onEventSetTime,
9782
- configure: tuya.configureMagicPacket,
9691
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
9783
9692
  exposes: [
9784
9693
  e.illuminance(),
9785
9694
  e.presence(),
@@ -9966,11 +9875,7 @@ exports.definitions = [
9966
9875
  description: "Temperature & humidity sensor with clock",
9967
9876
  fromZigbee: [legacy.fromZigbee.nous_lcd_temperature_humidity_sensor, fz.ignore_tuya_set_time],
9968
9877
  toZigbee: [legacy.toZigbee.nous_lcd_temperature_humidity_sensor],
9969
- onEvent: tuya.onEventSetLocalTime,
9970
- configure: async (device, coordinatorEndpoint) => {
9971
- const endpoint = device.getEndpoint(1);
9972
- await reporting.bind(endpoint, coordinatorEndpoint, ["genBasic"]);
9973
- },
9878
+ extend: [tuya.modernExtend.tuyaBase({ forceTimeUpdates: true, bindBasicOnConfigure: true })],
9974
9879
  exposes: [
9975
9880
  e.temperature(),
9976
9881
  e.humidity(),
@@ -9998,7 +9903,7 @@ exports.definitions = [
9998
9903
  description: "Tubular motor",
9999
9904
  fromZigbee: [legacy.fromZigbee.zb_sm_cover, fz.ignore_basic_report],
10000
9905
  toZigbee: [legacy.toZigbee.zb_sm_cover],
10001
- onEvent: tuya.onEventSetTime,
9906
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
10002
9907
  exposes: [
10003
9908
  e.cover_position().setAccess("position", ea.STATE_SET),
10004
9909
  e.enum("goto_positon", ea.SET, ["25", "50", "75", "FAVORITE"]),
@@ -10048,7 +9953,7 @@ exports.definitions = [
10048
9953
  description: "Temperature & humidity sensor with LCD",
10049
9954
  fromZigbee: [fz.temperature, fzLocal.humidity10, fzLocal.temperature_unit, fz.battery, fz.ignore_tuya_set_time],
10050
9955
  toZigbee: [tzLocal.temperature_unit],
10051
- onEvent: tuya.onEventSetLocalTime,
9956
+ extend: [tuya.modernExtend.tuyaBase({ forceTimeUpdates: true })],
10052
9957
  exposes: [
10053
9958
  e.temperature(),
10054
9959
  e.humidity(),
@@ -10070,7 +9975,7 @@ exports.definitions = [
10070
9975
  description: "Human presence sensor Zigbee",
10071
9976
  fromZigbee: [legacy.fromZigbee.hpsz],
10072
9977
  toZigbee: [legacy.toZigbee.hpsz],
10073
- onEvent: tuya.onEventSetLocalTime,
9978
+ extend: [tuya.modernExtend.tuyaBase({ forceTimeUpdates: true })],
10074
9979
  exposes: [
10075
9980
  e.presence(),
10076
9981
  e.numeric("duration_of_attendance", ea.STATE).withUnit("min").withDescription("Shows the presence duration in minutes"),
@@ -10276,13 +10181,7 @@ exports.definitions = [
10276
10181
  model: "RSH-HS06",
10277
10182
  vendor: "Tuya",
10278
10183
  description: "Temperature and humidity sensor",
10279
- fromZigbee: [tuya.fz.datapoints],
10280
- toZigbee: [tuya.tz.datapoints],
10281
- onEvent: tuya.onEvent({ queryOnDeviceAnnounce: true }),
10282
- configure: async (device, coordinatorEndpoint) => {
10283
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
10284
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
10285
- },
10184
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryOnDeviceAnnounce: true, queryOnConfigure: true })],
10286
10185
  exposes: [
10287
10186
  e.temperature(),
10288
10187
  e.humidity(),
@@ -10356,11 +10255,15 @@ exports.definitions = [
10356
10255
  model: "TS0601_pir",
10357
10256
  vendor: "Tuya",
10358
10257
  description: "Haozee PIR sensor",
10359
- fromZigbee: [tuya.fz.datapoints],
10360
- toZigbee: [tuya.tz.datapoints],
10361
- onEvent: tuya.onEvent(),
10362
- configure: tuya.configureMagicPacket,
10363
- exposes: [e.occupancy(), e.illuminance(), e.battery()],
10258
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
10259
+ exposes: (device, options) => {
10260
+ const exposes = [e.occupancy(), e.illuminance()];
10261
+ // https://github.com/Koenkk/zigbee2mqtt.io/pull/4018
10262
+ if (device.manufacturerName !== "_TZE200_ghynnvos") {
10263
+ exposes.push(e.battery());
10264
+ }
10265
+ return exposes;
10266
+ },
10364
10267
  whiteLabel: [
10365
10268
  tuya.whitelabel("Immax", "07527L", "NEO Smart PIR sensor 2v1 Zigbee 3.0", ["_TZE200_me6wtiqs"]),
10366
10269
  tuya.whitelabel("Conecto", "COZIGPMS", "PIR Motion Sensor", ["_TZE200_ghynnvos"]),
@@ -10893,10 +10796,7 @@ exports.definitions = [
10893
10796
  model: "TS0049",
10894
10797
  vendor: "Tuya",
10895
10798
  description: "Water valve",
10896
- fromZigbee: [tuya.fz.datapoints],
10897
- toZigbee: [tuya.tz.datapoints],
10898
- onEvent: tuya.onEventSetLocalTime,
10899
- configure: tuya.configureMagicPacket,
10799
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
10900
10800
  exposes: [
10901
10801
  tuya.exposes.errorStatus(),
10902
10802
  tuya.exposes.switch(),
@@ -10918,10 +10818,8 @@ exports.definitions = [
10918
10818
  model: "TS0601_water_switch",
10919
10819
  vendor: "Tuya",
10920
10820
  description: "Dual water valve",
10921
- fromZigbee: [tuya.fz.datapoints, fz.battery],
10922
- toZigbee: [tuya.tz.datapoints],
10923
- onEvent: tuya.onEventSetTime,
10924
- configure: tuya.configureMagicPacket,
10821
+ fromZigbee: [fz.battery],
10822
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
10925
10823
  exposes: [
10926
10824
  e.enum("valve_status", ea.STATE, ["manual", "auto", "idle"]).withDescription("Valve 1 status (manual, auto, idle)").withEndpoint("l1"),
10927
10825
  e.enum("valve_status", ea.STATE, ["manual", "auto", "idle"]).withDescription("Valve 2 status (manual, auto, idle)").withEndpoint("l2"),
@@ -12244,10 +12142,7 @@ exports.definitions = [
12244
12142
  model: "TS0601_bidirectional_energy meter",
12245
12143
  vendor: "Tuya",
12246
12144
  description: "Bidirectional energy meter with 150A Current Clamp",
12247
- fromZigbee: [tuya.fz.datapoints],
12248
- toZigbee: [tuya.tz.datapoints],
12249
- onEvent: tuya.onEventSetTime,
12250
- configure: tuya.configureMagicPacket,
12145
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
12251
12146
  exposes: [
12252
12147
  e.energy(),
12253
12148
  e.produced_energy(),
@@ -12472,6 +12367,7 @@ exports.definitions = [
12472
12367
  childLock: true,
12473
12368
  endpoints: ["l1", "l2"],
12474
12369
  }),
12370
+ tuya.modernExtend.electricityMeasurementPoll(),
12475
12371
  ],
12476
12372
  endpoint: (device) => {
12477
12373
  return { l1: 1, l2: 2 };
@@ -12493,8 +12389,6 @@ exports.definitions = [
12493
12389
  });
12494
12390
  device.save();
12495
12391
  },
12496
- options: [exposes.options.measurement_poll_interval()],
12497
- onEvent: (type, data, device, options) => tuya.onEventMeasurementPoll(type, data, device, options, true, false),
12498
12392
  whiteLabel: [tuya.whitelabel("Nous", "A4Z", "2 gang outdoor plug", ["_TZ3000_rqbjepe8", "_TZ3000_uwkja6z1"])],
12499
12393
  },
12500
12394
  {
@@ -12637,9 +12531,7 @@ exports.definitions = [
12637
12531
  model: "ZS-TYG3-SM-61Z",
12638
12532
  vendor: "Tuya",
12639
12533
  description: "Smart switch (4 gang + 2 scene) with backlight and neutral wire",
12640
- fromZigbee: [tuya.fz.datapoints],
12641
- toZigbee: [tuya.tz.datapoints],
12642
- configure: tuya.configureMagicPacket,
12534
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
12643
12535
  exposes: [
12644
12536
  tuya.exposes.switch().withDescription("All Switches"),
12645
12537
  tuya.exposes.switch().withEndpoint("l1"),
@@ -12657,7 +12549,6 @@ exports.definitions = [
12657
12549
  tuya.exposes.countdown().withEndpoint("l6"),
12658
12550
  e.power_on_behavior().withAccess(ea.STATE_SET),
12659
12551
  ],
12660
- onEvent: tuya.onEventSetTime,
12661
12552
  endpoint: (device) => {
12662
12553
  return {
12663
12554
  l1: 1,
@@ -12696,9 +12587,7 @@ exports.definitions = [
12696
12587
  model: "ZS-TYG3-SM-21Z",
12697
12588
  vendor: "Tuya",
12698
12589
  description: "2 gang smart switch with backlight and neutral wire",
12699
- fromZigbee: [tuya.fz.datapoints],
12700
- toZigbee: [tuya.tz.datapoints],
12701
- configure: tuya.configureMagicPacket,
12590
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
12702
12591
  exposes: [
12703
12592
  tuya.exposes.switch().withDescription("All Switches"),
12704
12593
  tuya.exposes.switch().withEndpoint("l1"),
@@ -12708,7 +12597,6 @@ exports.definitions = [
12708
12597
  tuya.exposes.countdown().withEndpoint("l2"),
12709
12598
  e.power_on_behavior().withAccess(ea.STATE_SET),
12710
12599
  ],
12711
- onEvent: tuya.onEventSetTime,
12712
12600
  endpoint: (device) => {
12713
12601
  return { l1: 1, l2: 1, state: 1, backlight: 1 };
12714
12602
  },
@@ -12730,9 +12618,6 @@ exports.definitions = [
12730
12618
  model: "ZS-TYG3-SM-31Z",
12731
12619
  vendor: "Tuya",
12732
12620
  description: "3 gang smart switch with backlight and neutral wire",
12733
- fromZigbee: [tuya.fz.datapoints],
12734
- toZigbee: [tuya.tz.datapoints],
12735
- configure: tuya.configureMagicPacket,
12736
12621
  exposes: [
12737
12622
  tuya.exposes.switch().withDescription("All Switches"),
12738
12623
  tuya.exposes.switch().withEndpoint("l1"),
@@ -12744,7 +12629,7 @@ exports.definitions = [
12744
12629
  tuya.exposes.countdown().withEndpoint("l3"),
12745
12630
  e.power_on_behavior(["off", "on", "previous"]).withAccess(ea.STATE_SET),
12746
12631
  ],
12747
- onEvent: tuya.onEventSetTime,
12632
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
12748
12633
  endpoint: (device) => {
12749
12634
  return { l1: 1, l2: 1, l3: 1, state: 1, backlight: 1 };
12750
12635
  },
@@ -12768,9 +12653,7 @@ exports.definitions = [
12768
12653
  model: "ZS-TYG3-SM-41Z",
12769
12654
  vendor: "Tuya",
12770
12655
  description: "4 gang smart switch with backlight and neutral wire",
12771
- fromZigbee: [tuya.fz.datapoints],
12772
- toZigbee: [tuya.tz.datapoints],
12773
- configure: tuya.configureMagicPacket,
12656
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
12774
12657
  exposes: [
12775
12658
  tuya.exposes.switch().withDescription("All Switches"),
12776
12659
  tuya.exposes.switch().withEndpoint("l1"),
@@ -12784,7 +12667,6 @@ exports.definitions = [
12784
12667
  tuya.exposes.countdown().withEndpoint("l4"),
12785
12668
  e.power_on_behavior(["off", "on", "previous"]).withAccess(ea.STATE_SET),
12786
12669
  ],
12787
- onEvent: tuya.onEventSetTime,
12788
12670
  endpoint: (device) => {
12789
12671
  return { l1: 1, l2: 1, l3: 1, l4: 1, state: 1, backlight: 1 };
12790
12672
  },
@@ -13616,8 +13498,7 @@ exports.definitions = [
13616
13498
  description: "Bidirectional energy meter with 80A current clamp",
13617
13499
  fromZigbee: [fzLocal.PJ1203A_strict_fz_datapoints, fzLocal.PJ1203A_sync_time_increase_seq],
13618
13500
  toZigbee: [tuya.tz.datapoints],
13619
- onEvent: tuya.onEventSetTime,
13620
- configure: tuya.configureMagicPacket,
13501
+ extend: [tuya.modernExtend.tuyaBase({ timeStart: "2000" })],
13621
13502
  options: [
13622
13503
  e
13623
13504
  .binary("late_energy_flow_a", ea.SET, true, false)
@@ -13691,10 +13572,7 @@ exports.definitions = [
13691
13572
  model: "PC311-Z-TY",
13692
13573
  vendor: "Tuya",
13693
13574
  description: "Bidirectional energy meter with 80A current clamp",
13694
- fromZigbee: [tuya.fz.datapoints],
13695
- toZigbee: [tuya.tz.datapoints],
13696
- onEvent: tuya.onEventSetTime,
13697
- configure: tuya.configureMagicPacket,
13575
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
13698
13576
  exposes: [
13699
13577
  e.ac_frequency(),
13700
13578
  e.voltage(),
@@ -13740,10 +13618,7 @@ exports.definitions = [
13740
13618
  model: "TYBAC-006",
13741
13619
  vendor: "Tuya",
13742
13620
  description: "Wall-mount thermostat for 2-pipe fan-coil unit",
13743
- fromZigbee: [tuya.fz.datapoints],
13744
- toZigbee: [tuya.tz.datapoints],
13745
- onEvent: tuya.onEventSetLocalTime,
13746
- configure: tuya.configureMagicPacket,
13621
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
13747
13622
  options: [
13748
13623
  e
13749
13624
  .enum("control_sequence_of_operation", ea.SET, ["cooling_only", "cooling_and_heating_4-pipes"])
@@ -13869,10 +13744,7 @@ exports.definitions = [
13869
13744
  model: "rtsc11r",
13870
13745
  vendor: "Tuya",
13871
13746
  description: "5.8G human presence sensor with relay",
13872
- configure: tuya.configureMagicPacket,
13873
- fromZigbee: [tuya.fz.datapoints],
13874
- toZigbee: [tuya.tz.datapoints],
13875
- onEvent: tuya.onEventSetTime,
13747
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
13876
13748
  exposes: [
13877
13749
  e.presence(),
13878
13750
  e.illuminance().withUnit("lx"),
@@ -13990,21 +13862,27 @@ exports.definitions = [
13990
13862
  vendor: "Tuya",
13991
13863
  description: "Smart WiFi Zigbee chlorine meter",
13992
13864
  whiteLabel: [tuya.whitelabel("Tuya", "YK-S03", "Smart pH and Chlorine Tester for Swimming Pool", ["_TZE200_d9mzkhoq"])],
13993
- fromZigbee: [tuya.fz.datapoints],
13994
- toZigbee: [tuya.tz.datapoints],
13995
13865
  // Don't query too often. Values are not always updated. https://github.com/Koenkk/zigbee2mqtt/issues/18704
13996
- onEvent: tuya.onEvent({
13997
- queryOnDeviceAnnounce: true,
13998
- // https://github.com/Koenkk/zigbee2mqtt/issues/23946#issuecomment-2941182834
13999
- queryIntervalSeconds: 20 * 60,
14000
- }),
14001
- configure: async (device, coordinatorEndpoint) => {
14002
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
14003
- const endpoint = device.endpoints[0];
14004
- // Needed to make the device report reliable
14005
- // https://github.com/Koenkk/zigbee2mqtt/issues/18704#issuecomment-3109695384
14006
- await endpoint.write("genBasic", { 65502: { value: 0x13, type: zigbee_herdsman_1.Zcl.DataType.UINT8 } });
14007
- },
13866
+ extend: [
13867
+ tuya.modernExtend.tuyaBase({
13868
+ dp: true,
13869
+ queryOnDeviceAnnounce: true,
13870
+ // https://github.com/Koenkk/zigbee2mqtt/issues/23946#issuecomment-2941182834
13871
+ queryIntervalSeconds: 10 * 60,
13872
+ }),
13873
+ m.poll({
13874
+ key: "backlight",
13875
+ defaultIntervalSeconds: 30 * 60,
13876
+ poll: async (device) => {
13877
+ // Set backlight ever 30 mins, otherwise device stops updating.
13878
+ // https://github.com/Koenkk/zigbee2mqtt/issues/23946#issuecomment-3176121660
13879
+ const ep = device.getEndpoint(1);
13880
+ await tuya.sendDataPointValue(ep, 105, 0, "dataRequest", 1);
13881
+ await utils.sleep(2000);
13882
+ await tuya.sendDataPointValue(ep, 105, 0, "dataRequest", 0);
13883
+ },
13884
+ }),
13885
+ ],
14008
13886
  exposes: [
14009
13887
  e.numeric("tds", ea.STATE).withUnit("ppm").withDescription("Total Dissolved Solids"),
14010
13888
  e.temperature(),
@@ -14065,11 +13943,8 @@ exports.definitions = [
14065
13943
  .withDescription("Free Chlorine minimal value")
14066
13944
  .withValueMin(0)
14067
13945
  .withValueMax(15),
14068
- e
14069
- .numeric("salinity", ea.STATE)
14070
- .withUnit("ppm")
14071
- .withDescription("Salt value"),
14072
- // e.numeric('backlightvalue', ea.STATE).withUnit('gg').withDescription('Backlight Value'),
13946
+ e.numeric("salinity", ea.STATE).withUnit("ppm").withDescription("Salt value"),
13947
+ e.numeric("backlightvalue", ea.STATE_SET).withUnit("gg").withDescription("Backlight Value").withValueMin(0).withValueMax(1),
14073
13948
  ],
14074
13949
  meta: {
14075
13950
  // All datapoints go in here
@@ -14077,19 +13952,19 @@ exports.definitions = [
14077
13952
  [1, "tds", tuya.valueConverter.raw],
14078
13953
  [2, "temperature", tuya.valueConverter.divideBy10],
14079
13954
  [7, "battery", tuya.valueConverter.raw],
14080
- [10, "ph", tuya.valueConverter.divideBy100],
13955
+ [10, "ph", tuya.valueConverter.divideBy10],
14081
13956
  [11, "ec", tuya.valueConverter.raw],
14082
13957
  [101, "orp", tuya.valueConverter.raw],
14083
- [102, "free_chlorine", tuya.valueConverter.divideBy10],
14084
- // [105, 'backlightvalue', tuya.valueConverter.raw],
13958
+ [102, "free_chlorine", tuya.valueConverter.raw],
13959
+ [105, "backlightvalue", tuya.valueConverter.raw],
14085
13960
  [106, "ph_max", tuya.valueConverter.divideBy10],
14086
13961
  [107, "ph_min", tuya.valueConverter.divideBy10],
14087
13962
  [108, "ec_max", tuya.valueConverter.raw],
14088
13963
  [109, "ec_min", tuya.valueConverter.raw],
14089
13964
  [110, "orp_max", tuya.valueConverter.raw],
14090
13965
  [111, "orp_min", tuya.valueConverter.raw],
14091
- [112, "free_chlorine_max", tuya.valueConverter.divideBy10],
14092
- [113, "free_chlorine_min", tuya.valueConverter.divideBy10],
13966
+ [112, "free_chlorine_max", tuya.valueConverter.raw],
13967
+ [113, "free_chlorine_min", tuya.valueConverter.raw],
14093
13968
  [117, "salinity", tuya.valueConverter.raw],
14094
13969
  ],
14095
13970
  },
@@ -14099,10 +13974,7 @@ exports.definitions = [
14099
13974
  model: "SP02-ZB001",
14100
13975
  vendor: "iAlarm",
14101
13976
  description: "Infrared motion sensor",
14102
- fromZigbee: [tuya.fz.datapoints],
14103
- toZigbee: [tuya.tz.datapoints],
14104
- onEvent: tuya.onEventSetTime,
14105
- configure: tuya.configureMagicPacket,
13977
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14106
13978
  exposes: [e.tamper(), e.battery(), e.occupancy()],
14107
13979
  meta: {
14108
13980
  tuyaDatapoints: [
@@ -14134,10 +14006,7 @@ exports.definitions = [
14134
14006
  model: "DCR-RQJ",
14135
14007
  vendor: "Tuya",
14136
14008
  description: "Carbon monoxide sensor gas leak detector",
14137
- fromZigbee: [tuya.fz.datapoints],
14138
- toZigbee: [tuya.tz.datapoints],
14139
- onEvent: tuya.onEventSetTime,
14140
- configure: tuya.configureMagicPacket,
14009
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14141
14010
  exposes: [e.gas(), tuya.exposes.gasValue().withUnit("LEL %"), e.carbon_monoxide(), e.co()],
14142
14011
  meta: {
14143
14012
  tuyaDatapoints: [
@@ -14167,10 +14036,7 @@ exports.definitions = [
14167
14036
  model: "SZR07U",
14168
14037
  vendor: "Tuya",
14169
14038
  description: "24GHz millimeter wave radar",
14170
- configure: tuya.configureMagicPacket,
14171
- fromZigbee: [tuya.fz.datapoints],
14172
- toZigbee: [tuya.tz.datapoints],
14173
- onEvent: tuya.onEventSetTime,
14039
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14174
14040
  exposes: [
14175
14041
  e.presence(),
14176
14042
  e
@@ -14261,13 +14127,7 @@ exports.definitions = [
14261
14127
  model: "TOWSMR1",
14262
14128
  vendor: "Tongou",
14263
14129
  description: "Single-phase multifunction RCBO (DIN Module)",
14264
- fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
14265
- toZigbee: [tuya.tz.datapoints],
14266
- configure: async (device, coordinatorEndpoint) => {
14267
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
14268
- // Required to get the device to start reporting
14269
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
14270
- },
14130
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryOnConfigure: true, queryIntervalSeconds: 10, respondToMcuVersionResponse: false })],
14271
14131
  whiteLabel: [tuya.whitelabel("Tongou", "TOSA1", "Single-phase multifunction RCBO (DIN Module)", ["_TZE284_432zhuwe"])],
14272
14132
  exposes: [
14273
14133
  tuya.exposes.switch(),
@@ -14469,27 +14329,13 @@ exports.definitions = [
14469
14329
  [145, "overpower_recloser", tuya.valueConverter.onOff],
14470
14330
  ],
14471
14331
  },
14472
- onEvent: tuya.onEvent({
14473
- respondToMcuVersionResponse: false,
14474
- queryIntervalSeconds: 10,
14475
- }),
14476
14332
  },
14477
14333
  {
14478
14334
  fingerprint: [{ modelID: "TS0601", manufacturerName: "_TZE284_6ocnqlhn" }],
14479
14335
  model: "TO-Q-SYS-JZT",
14480
14336
  vendor: "Tongou",
14481
14337
  description: "Din rail smart meter",
14482
- fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
14483
- toZigbee: [tuya.tz.datapoints],
14484
- onEvent: tuya.onEvent({
14485
- respondToMcuVersionResponse: false,
14486
- queryIntervalSeconds: 10,
14487
- }),
14488
- configure: async (device, coordinatorEndpoint) => {
14489
- await tuya.configureMagicPacket(device, coordinatorEndpoint);
14490
- // Required to get the device to start reporting
14491
- await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
14492
- },
14338
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryOnConfigure: true, queryIntervalSeconds: 10, respondToMcuVersionResponse: false })],
14493
14339
  exposes: [
14494
14340
  tuya.exposes.switch(),
14495
14341
  e.power(),
@@ -14671,9 +14517,7 @@ exports.definitions = [
14671
14517
  model: "EA4161C-BI",
14672
14518
  vendor: "Tuya",
14673
14519
  description: "Single-phase multifunction energy meter (DIN Module)",
14674
- fromZigbee: [tuya.fz.datapoints, tuya.fz.gateway_connection_status],
14675
- toZigbee: [tuya.tz.datapoints],
14676
- configure: tuya.configureMagicPacket,
14520
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
14677
14521
  exposes: [e.current(), e.power(), e.voltage(), e.energy(), e.text("meter_id", ea.STATE).withDescription("Meter ID (ID of device)")],
14678
14522
  meta: {
14679
14523
  tuyaDatapoints: [
@@ -14715,12 +14559,9 @@ exports.definitions = [
14715
14559
  fingerprint: tuya.fingerprint("TS0601", ["_TZE200_pl31aqf5", "_TZE200_xpvamyfz", "_TZE284_xpvamyfz"]),
14716
14560
  model: "ZR360CDB",
14717
14561
  vendor: "Zorro Alert",
14718
- fromZigbee: [tuya.fz.datapoints],
14719
- toZigbee: [tuya.tz.datapoints],
14720
14562
  description: "Multifunctional CO2 detector",
14563
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14721
14564
  whiteLabel: [tuya.whitelabel("Nous", "E10", "Multifunctional CO2 detector", ["_TZE200_xpvamyfz", "_TZE284_xpvamyfz"])],
14722
- onEvent: tuya.onEventSetTime,
14723
- configure: tuya.configureMagicPacket,
14724
14565
  exposes: [
14725
14566
  e.humidity(),
14726
14567
  e.temperature(),
@@ -14779,10 +14620,7 @@ exports.definitions = [
14779
14620
  model: "TS0601_floor_thermostat",
14780
14621
  vendor: "Tuya",
14781
14622
  description: "Zigbee thermostat for electric floors",
14782
- fromZigbee: [tuya.fz.datapoints],
14783
- toZigbee: [tuya.tz.datapoints],
14784
- onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
14785
- configure: tuya.configureMagicPacket,
14623
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14786
14624
  exposes: [
14787
14625
  e
14788
14626
  .climate()
@@ -14832,10 +14670,7 @@ exports.definitions = [
14832
14670
  model: "TE-1Z",
14833
14671
  vendor: "Tuya",
14834
14672
  description: "Floor heating thermostat",
14835
- fromZigbee: [tuya.fz.datapoints],
14836
- toZigbee: [tuya.tz.datapoints],
14837
- onEvent: tuya.onEventSetTime,
14838
- configure: tuya.configureMagicPacket,
14673
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14839
14674
  exposes: [
14840
14675
  // e.binary('system_mode', ea.STATE_SET, 'ON', 'OFF')
14841
14676
  // .withDescription('Turn system on or standby mode'),
@@ -14944,10 +14779,7 @@ exports.definitions = [
14944
14779
  model: "PRO-900Z",
14945
14780
  vendor: "ElectSmart",
14946
14781
  description: "Thermostat for electric floor",
14947
- fromZigbee: [tuya.fz.datapoints],
14948
- toZigbee: [tuya.tz.datapoints],
14949
- onEvent: tuya.onEventSetTime,
14950
- configure: tuya.configureMagicPacket,
14782
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
14951
14783
  exposes: [
14952
14784
  e.binary("child_lock", ea.STATE_SET, "ON", "OFF").withLabel("Child lock"),
14953
14785
  e.binary("eco_mode", ea.STATE_SET, "OFF", "ON").withLabel("ECO mode").withDescription("Default: Off"),
@@ -15106,10 +14938,7 @@ exports.definitions = [
15106
14938
  model: "ZPV-01",
15107
14939
  vendor: "Novato",
15108
14940
  description: "Battery powered smart valve",
15109
- fromZigbee: [tuya.fz.datapoints],
15110
- toZigbee: [tuya.tz.datapoints],
15111
- onEvent: tuya.onEventSetTime,
15112
- configure: tuya.configureMagicPacket,
14941
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
15113
14942
  exposes: [
15114
14943
  e.switch().setAccess("state", ea.STATE_SET),
15115
14944
  e.enum("valve_state", ea.STATE, ["Closed", "Unknown", "Open"]).withDescription("Valve Status"),
@@ -15272,15 +15101,9 @@ exports.definitions = [
15272
15101
  model: "TOQCB2-80",
15273
15102
  vendor: "Tongou",
15274
15103
  description: "Smart circuit breaker",
15275
- fromZigbee: [tuya.fz.datapoints],
15276
- toZigbee: [tuya.tz.datapoints],
15277
15104
  // Important: respondToMcuVersionResponse should be false otherwise there is an avalanche of commandMcuVersionResponse messages every second.
15278
15105
  // queryIntervalSeconds: is doing a pooling to update the device's parameters, now defined to update data every 3 minutes.
15279
- onEvent: tuya.onEvent({
15280
- respondToMcuVersionResponse: false,
15281
- queryIntervalSeconds: 3 * 60,
15282
- }),
15283
- configure: tuya.configureMagicPacket,
15106
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, queryIntervalSeconds: 3 * 60, respondToMcuVersionResponse: false })],
15284
15107
  exposes: [
15285
15108
  tuya.exposes.switch(),
15286
15109
  e.energy(),
@@ -15459,10 +15282,7 @@ exports.definitions = [
15459
15282
  model: "ZY-M100-S_3",
15460
15283
  vendor: "Tuya",
15461
15284
  description: "Human presence detector",
15462
- fromZigbee: [tuya.fz.datapoints],
15463
- toZigbee: [tuya.tz.datapoints],
15464
- onEvent: tuya.onEventSetTime,
15465
- configure: tuya.configureMagicPacket,
15285
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
15466
15286
  exposes: [
15467
15287
  e.presence(),
15468
15288
  e.illuminance(),
@@ -15501,9 +15321,7 @@ exports.definitions = [
15501
15321
  model: "ZG-205Z",
15502
15322
  vendor: "Tuya",
15503
15323
  description: "5.8 GHz human presence sensor",
15504
- fromZigbee: [tuya.fz.datapoints],
15505
- toZigbee: [tuya.tz.datapoints],
15506
- onEvent: tuya.onEventSetTime,
15324
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
15507
15325
  exposes: [
15508
15326
  e.presence(),
15509
15327
  e
@@ -15669,7 +15487,7 @@ exports.definitions = [
15669
15487
  },
15670
15488
  },
15671
15489
  {
15672
- fingerprint: tuya.fingerprint("TS0601", ["_TZE204_zqq3cipq"]),
15490
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE204_zqq3cipq", "_TZE284_zqq3cipq"]),
15673
15491
  model: "PN16",
15674
15492
  vendor: "ZSVIOT",
15675
15493
  description: "16-way controller",
@@ -16333,10 +16151,7 @@ exports.definitions = [
16333
16151
  model: "TS0601_GTZ10",
16334
16152
  vendor: "Tuya",
16335
16153
  description: "Thermostat radiator valve",
16336
- fromZigbee: [tuya.fz.datapoints],
16337
- toZigbee: [tuya.tz.datapoints],
16338
- onEvent: tuya.onEventSetLocalTime,
16339
- configure: tuya.configureMagicPacket,
16154
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
16340
16155
  ota: true,
16341
16156
  exposes: [
16342
16157
  e.battery(),
@@ -16503,10 +16318,7 @@ exports.definitions = [
16503
16318
  model: "ME201WZ",
16504
16319
  vendor: "Tuya",
16505
16320
  description: "Water level sensor",
16506
- fromZigbee: [tuya.fz.datapoints],
16507
- toZigbee: [tuya.tz.datapoints],
16508
- onEvent: tuya.onEventSetLocalTime,
16509
- configure: tuya.configureMagicPacket,
16321
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
16510
16322
  exposes: [
16511
16323
  e.numeric("liquid_level_percent", ea.STATE).withUnit("%").withDescription("Liquid level ratio"),
16512
16324
  e.numeric("liquid_depth", ea.STATE).withUnit("m").withDescription("Liquid Depth"),
@@ -16565,11 +16377,7 @@ exports.definitions = [
16565
16377
  model: "TLC2206",
16566
16378
  vendor: "Tuya",
16567
16379
  description: "Water level sensor",
16568
- extend: [m.forcePowerSource({ powerSource: "Mains (single phase)" })],
16569
- fromZigbee: [tuya.fz.datapoints],
16570
- toZigbee: [tuya.tz.datapoints],
16571
- onEvent: tuya.onEventSetLocalTime,
16572
- configure: tuya.configureMagicPacket,
16380
+ extend: [m.forcePowerSource({ powerSource: "Mains (single phase)" }), tuya.modernExtend.tuyaBase({ dp: true, forceTimeUpdates: true })],
16573
16381
  exposes: [
16574
16382
  e.numeric("liquid_level_percent", ea.STATE).withUnit("%").withDescription("Liquid level ratio"),
16575
16383
  e.numeric("liquid_depth", ea.STATE).withUnit("cm").withDescription("Liquid depth"),
@@ -16628,10 +16436,7 @@ exports.definitions = [
16628
16436
  model: "HHST001",
16629
16437
  vendor: "HeatHUB",
16630
16438
  description: "Fan coil thermostat",
16631
- fromZigbee: [tuya.fz.datapoints],
16632
- toZigbee: [tuya.tz.datapoints],
16633
- onEvent: tuya.onEventSetTime,
16634
- configure: tuya.configureMagicPacket,
16439
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
16635
16440
  exposes: [
16636
16441
  e.binary("state", ea.STATE_SET, "ON", "OFF").withDescription("Turn the thermostat ON/OFF"),
16637
16442
  e
@@ -17400,10 +17205,7 @@ exports.definitions = [
17400
17205
  model: "AE-940K",
17401
17206
  vendor: "ACMELEC",
17402
17207
  description: "Compatible with Daikin vrv system",
17403
- fromZigbee: [tuya.fz.datapoints],
17404
- toZigbee: [tuya.tz.datapoints],
17405
- onEvent: tuya.onEventSetTime,
17406
- configure: tuya.configureMagicPacket,
17208
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
17407
17209
  exposes: [
17408
17210
  e.binary("state", ea.STATE_SET, "ON", "OFF").withDescription("Turn the thermostat ON/OFF"),
17409
17211
  e
@@ -17447,10 +17249,7 @@ exports.definitions = [
17447
17249
  model: "AE-669K",
17448
17250
  vendor: "ACMELEC",
17449
17251
  description: "Compatible with Mitsubishi Electric vrf system",
17450
- fromZigbee: [tuya.fz.datapoints],
17451
- toZigbee: [tuya.tz.datapoints],
17452
- onEvent: tuya.onEventSetTime,
17453
- configure: tuya.configureMagicPacket,
17252
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
17454
17253
  exposes: [
17455
17254
  e.binary("state", ea.STATE_SET, "ON", "OFF").withDescription("Turn the thermostat ON/OFF"),
17456
17255
  e
@@ -17724,10 +17523,7 @@ exports.definitions = [
17724
17523
  model: "HY-SZLUMPIR",
17725
17524
  vendor: "Homcloud",
17726
17525
  description: "PIR sensor",
17727
- fromZigbee: [tuya.fz.datapoints],
17728
- toZigbee: [tuya.tz.datapoints],
17729
- onEvent: tuya.onEvent(),
17730
- configure: tuya.configureMagicPacket,
17526
+ extend: [tuya.modernExtend.tuyaBase({ dp: true })],
17731
17527
  exposes: [e.occupancy(), e.illuminance(), e.battery()],
17732
17528
  meta: {
17733
17529
  tuyaDatapoints: [
@@ -17742,10 +17538,7 @@ exports.definitions = [
17742
17538
  model: "XZ-AKT101",
17743
17539
  vendor: "Tuya",
17744
17540
  description: "Intelligent air conditioning wall switch",
17745
- fromZigbee: [tuya.fz.datapoints],
17746
- toZigbee: [tuya.tz.datapoints],
17747
- onEvent: tuya.onEventSetTime,
17748
- configure: tuya.configureMagicPacket,
17541
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
17749
17542
  ota: true,
17750
17543
  exposes: [
17751
17544
  e.binary("air_switch", ea.STATE_SET, true, false),
@@ -17890,10 +17683,7 @@ exports.definitions = [
17890
17683
  model: "EPJ-ZB",
17891
17684
  vendor: "Nova Digital",
17892
17685
  description: "Smart sliding window pusher",
17893
- fromZigbee: [tuya.fz.datapoints],
17894
- toZigbee: [tuya.tz.datapoints],
17895
- onEvent: tuya.onEventSetTime,
17896
- configure: tuya.configureMagicPacket,
17686
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
17897
17687
  exposes: [
17898
17688
  e.battery(),
17899
17689
  e.cover_position(),
@@ -18060,10 +17850,7 @@ exports.definitions = [
18060
17850
  model: "RD24G01",
18061
17851
  vendor: "Tuya",
18062
17852
  description: "24GHz human presence sensor",
18063
- fromZigbee: [tuya.fz.datapoints],
18064
- toZigbee: [tuya.tz.datapoints],
18065
- onEvent: tuya.onEventSetTime,
18066
- configure: tuya.configureMagicPacket,
17853
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
18067
17854
  exposes: [
18068
17855
  exposes
18069
17856
  .enum("presence_state", exposes.access.STATE, ["none", "motion", "stationary"])
@@ -18112,10 +17899,7 @@ exports.definitions = [
18112
17899
  model: "M515EGBZTN",
18113
17900
  vendor: "Quoya",
18114
17901
  description: "Zigbee roller blind",
18115
- fromZigbee: [tuya.fz.datapoints],
18116
- toZigbee: [tuya.tz.datapoints],
18117
- onEvent: tuya.onEventSetTime,
18118
- configure: tuya.configureMagicPacket,
17902
+ extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: "2000" })],
18119
17903
  options: [exposes.options.invert_cover()],
18120
17904
  exposes: [
18121
17905
  e.cover_position().setAccess("position", ea.STATE_SET),