zigbee-herdsman-converters 23.15.0 → 23.17.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.
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.definitions = void 0;
37
+ const zigbee_herdsman_1 = require("zigbee-herdsman");
37
38
  const fz = __importStar(require("../converters/fromZigbee"));
38
39
  const tz = __importStar(require("../converters/toZigbee"));
39
40
  const libColor = __importStar(require("../lib/color"));
@@ -266,6 +267,15 @@ const convLocal = {
266
267
  },
267
268
  };
268
269
  const tzLocal = {
270
+ ts110eCountdown: {
271
+ key: ["countdown"],
272
+ convertSet: async (entity, key, value, meta) => {
273
+ utils.assertNumber(value);
274
+ const data = Buffer.alloc(4);
275
+ data.writeUInt32LE(value);
276
+ await entity.command("genOnOff", "tuyaCountdown", { data });
277
+ },
278
+ },
269
279
  // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
270
280
  TS030F_border: {
271
281
  key: ["border"],
@@ -765,95 +775,6 @@ const fzLocal = {
765
775
  },
766
776
  },
767
777
  };
768
- const modernExtendLocal = {
769
- dpTHZBSettings() {
770
- const exp = e
771
- .composite("auto_settings", "auto_settings", ea.STATE_SET)
772
- .withFeature(e.enum("enabled", ea.STATE_SET, ["on", "off", "none"]).withDescription("Enable auto settings"))
773
- .withFeature(e.enum("temp_greater_then", ea.STATE_SET, ["on", "off", "none"]).withDescription("Greater action"))
774
- .withFeature(e
775
- .numeric("temp_greater_value", ea.STATE_SET)
776
- .withValueMin(-20)
777
- .withValueMax(80)
778
- .withValueStep(0.1)
779
- .withUnit("*C")
780
- .withDescription("Temperature greater than value"))
781
- .withFeature(e.enum("temp_lower_then", ea.STATE_SET, ["on", "off", "none"]).withDescription("Lower action"))
782
- .withFeature(e
783
- .numeric("temp_lower_value", ea.STATE_SET)
784
- .withValueMin(-20)
785
- .withValueMax(80)
786
- .withValueStep(0.1)
787
- .withUnit("*C")
788
- .withDescription("Temperature lower than value"));
789
- const handlers = tuya.getHandlersForDP("auto_settings", 0x77, tuya.dataTypes.string, {
790
- from: (value) => {
791
- let result = {
792
- enabled: "none",
793
- temp_greater_then: "none",
794
- temp_greater_value: 0,
795
- temp_lower_then: "none",
796
- temp_lower_value: 0,
797
- };
798
- const buf = Buffer.from(value, "hex");
799
- if (buf.length > 0) {
800
- const enabled = buf[0];
801
- const gr = buf[1];
802
- const grValue = buf.readInt32LE(2) / 10;
803
- const grAction = buf[6];
804
- const lo = buf[7];
805
- const loValue = buf.readInt32LE(8) / 10;
806
- const loAction = buf[13];
807
- result = {
808
- enabled: { 0: "on", 128: "off" }[enabled],
809
- temp_greater_then: gr !== 0xff ? { 1: "on", 0: "off" }[grAction] : "none",
810
- temp_greater_value: grValue,
811
- temp_lower_then: lo !== 0xff ? { 1: "on", 0: "off" }[loAction] : "none",
812
- temp_lower_value: loValue,
813
- };
814
- }
815
- return result;
816
- },
817
- to: (value) => {
818
- let result = "";
819
- if (value.enabled !== "none") {
820
- const enabled = utils.getFromLookup(value.enabled, {
821
- on: 0x00,
822
- off: 0x80,
823
- });
824
- const gr = value.temp_greater_then === "none" ? 0xff : 0x00;
825
- const grAction = utils.getFromLookup(value.temp_greater_then, {
826
- on: 0x01,
827
- off: 0x00,
828
- none: 0x00,
829
- });
830
- const lo = value.temp_lower_then === "none" ? 0xff : 0x00;
831
- const loAction = utils.getFromLookup(value.temp_lower_then, {
832
- on: 0x01,
833
- off: 0x00,
834
- none: 0x00,
835
- });
836
- const buf = Buffer.alloc(13);
837
- buf.writeUInt8(enabled, 0);
838
- buf.writeUInt8(gr, 1);
839
- buf.writeInt32LE(value.temp_greater_value * 10, 2);
840
- buf.writeUInt8(grAction, 6);
841
- buf.writeUInt8(lo, 7);
842
- buf.writeInt32LE(value.temp_lower_value * 10, 8);
843
- buf.writeUInt8(loAction, 12);
844
- result = buf.toString("hex");
845
- }
846
- return result;
847
- },
848
- });
849
- return {
850
- exposes: [exp],
851
- fromZigbee: handlers[0],
852
- toZigbee: handlers[1],
853
- isModernExtend: true,
854
- };
855
- },
856
- };
857
778
  exports.definitions = [
858
779
  {
859
780
  zigbeeModel: ["TS0204"],
@@ -9064,7 +8985,7 @@ exports.definitions = [
9064
8985
  whiteLabel: [tuya.whitelabel("iHseno", "TY_24G_Sensor_V2", "Human presence sensor 24G", ["_TZE204_ztqnh5cg"])],
9065
8986
  },
9066
8987
  {
9067
- fingerprint: tuya.fingerprint("TS0601", ["_TZE204_laokfqwu", "_TZE200_clrdrnya"]),
8988
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE204_laokfqwu"]),
9068
8989
  model: "WZ-M100",
9069
8990
  vendor: "Wenzhi",
9070
8991
  description: "Human presence sensor",
@@ -9936,12 +9857,30 @@ exports.definitions = [
9936
9857
  ],
9937
9858
  ota: true,
9938
9859
  fromZigbee: [fz.TS110E, fz.TS110E_light_type, tuya.fz.power_on_behavior_1, fz.on_off],
9939
- toZigbee: [tz.TS110E_onoff_brightness, tz.TS110E_options, tuya.tz.power_on_behavior_1, tz.light_brightness_move],
9940
- exposes: [
9941
- e.light_brightness().withMinBrightness().withMaxBrightness(),
9942
- tuya.exposes.lightType().withAccess(ea.ALL),
9943
- e.power_on_behavior().withAccess(ea.ALL),
9944
- tuya.exposes.switchType(),
9860
+ toZigbee: [tz.TS110E_onoff_brightness, tz.TS110E_options, tuya.tz.power_on_behavior_1, tz.light_brightness_move, tzLocal.ts110eCountdown],
9861
+ exposes: (device, options) => {
9862
+ // https://github.com/Koenkk/zigbee2mqtt/issues/26791#issuecomment-2765734859
9863
+ const countdownValueStep = device?.manufacturerName === "_TZ3210_ngqk6jia" ? 30 : 1;
9864
+ return [
9865
+ e.light_brightness().withMinBrightness().withMaxBrightness(),
9866
+ tuya.exposes.lightType().withAccess(ea.ALL),
9867
+ e.power_on_behavior().withAccess(ea.ALL),
9868
+ tuya.exposes.switchType(),
9869
+ tuya.exposes.countdown().withValueStep(countdownValueStep),
9870
+ ];
9871
+ },
9872
+ extend: [
9873
+ m.deviceAddCustomCluster("genOnOff", {
9874
+ ID: zigbee_herdsman_1.Zcl.Clusters.genOnOff.ID,
9875
+ attributes: {},
9876
+ commands: {
9877
+ tuyaCountdown: {
9878
+ ID: 0xf0,
9879
+ parameters: [{ name: "data", type: 1008 /* BUFFER */ }],
9880
+ },
9881
+ },
9882
+ commandsResponse: {},
9883
+ }),
9945
9884
  ],
9946
9885
  configure: async (device, coordinatorEndpoint) => {
9947
9886
  await tuya.configureMagicPacket(device, coordinatorEndpoint);
@@ -12501,6 +12440,7 @@ exports.definitions = [
12501
12440
  "_TZE200_mp902om5",
12502
12441
  "_TZE204_pfayrzcw",
12503
12442
  "_TZE284_4qznlkbu",
12443
+ "_TZE200_clrdrnya",
12504
12444
  "_TZE200_sbyx0lm6",
12505
12445
  ]),
12506
12446
  model: "MTG075-ZB-RL",
@@ -12509,7 +12449,7 @@ exports.definitions = [
12509
12449
  whiteLabel: [
12510
12450
  tuya.whitelabel("Tuya", "MTG275-ZB-RL", "2.4G/5.8G MmWave radar human presence motion sensor", ["_TZE204_dtzziy1e"]),
12511
12451
  tuya.whitelabel("Tuya", "MTG035-ZB-RL", "Human presence sensor with relay", ["_TZE204_pfayrzcw"]),
12512
- tuya.whitelabel("Tuya", "MTG235-ZB-RL", "24G Human presence sensor with relay", ["_TZE204_clrdrnya"]),
12452
+ tuya.whitelabel("Tuya", "MTG235-ZB-RL", "24G Human presence sensor with relay", ["_TZE204_clrdrnya", "_TZE200_clrdrnya"]),
12513
12453
  tuya.whitelabel("QA", "QASZ24R", "mmWave 24 Ghz sensor with relay", ["_TZE284_4qznlkbu"]),
12514
12454
  ],
12515
12455
  configure: tuya.configureMagicPacket,
@@ -14209,9 +14149,9 @@ exports.definitions = [
14209
14149
  type: tuya.dataTypes.enum,
14210
14150
  valueOn: ["ON", 1],
14211
14151
  valueOff: ["OFF", 0],
14212
- description: "Manual mode or automatic",
14152
+ description: "Manual mode, ON = auto settings disabled, OFF = auto settings enabled",
14213
14153
  }),
14214
- modernExtendLocal.dpTHZBSettings(),
14154
+ tuya.modernExtend.dpTHZBSettings(),
14215
14155
  ],
14216
14156
  },
14217
14157
  {