zigbee-herdsman-converters 23.70.0 → 23.71.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.
@@ -1 +1 @@
1
- {"version":3,"file":"tuya.d.ts","sourceRoot":"","sources":["../../src/devices/tuya.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,oBAAoB,EAA4D,MAAM,cAAc,CAAC;AA80BlH,eAAO,MAAM,WAAW,EAAE,oBAAoB,EAk+hB7C,CAAC"}
1
+ {"version":3,"file":"tuya.d.ts","sourceRoot":"","sources":["../../src/devices/tuya.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAC,oBAAoB,EAA4D,MAAM,cAAc,CAAC;AA+3BlH,eAAO,MAAM,WAAW,EAAE,oBAAoB,EAk+hB7C,CAAC"}
@@ -648,6 +648,49 @@ const tzLocal = {
648
648
  return await legacy.toZigbee.tuya_cover_control.convertSet(entity, key, newValue, meta);
649
649
  },
650
650
  },
651
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
652
+ TS0505B_1_transitionFixesOnOffBrightness: {
653
+ ...tz.light_onoff_brightness,
654
+ convertSet: async (entity, key, value, meta) => {
655
+ // This light has two issues:
656
+ // 1. If passing transition = 0, it will behave as if transition = 1s.
657
+ // 2. If turning off with a transition, and turning on during the transition, it will turn off
658
+ // at the end of the first transition timer, despite order to turn on
659
+ // Workaround for issue 1: patch transition in input message
660
+ const transition = utils.getTransition(entity, "brightness", meta);
661
+ let transitionSeconds = transition.time / 10;
662
+ let newMeta = meta;
663
+ if (transitionSeconds === 0) {
664
+ const { message } = meta;
665
+ const wantedState = message.state != null ? (typeof message.state === "string" ? message.state.toLowerCase() : null) : undefined;
666
+ newMeta = { ...meta }; // Clone meta to avoid modifying the original
667
+ if (wantedState === "off") {
668
+ // Erase transition because that way we get actual instant turn off
669
+ newMeta.message = { state: "OFF" };
670
+ }
671
+ else {
672
+ // Best we can do is set the transition to 0.1 seconds
673
+ // That is the same thing as is done for TS0505B_2
674
+ transitionSeconds = 0.1;
675
+ newMeta.message = { ...message, transition: transitionSeconds }; // Will get re-parsed by original light_onoff_brightness
676
+ }
677
+ }
678
+ const ret = await tz.light_onoff_brightness.convertSet(entity, key, value, newMeta);
679
+ // Workaround for issue 2:
680
+ // Get the current state of the light after transition time + 0.1s
681
+ // This won't fix the light's state, but at least it will make us aware that it's off,
682
+ // allowing user apps to turn it on again if needed.
683
+ // This could probably be improved by actually turning it on again if necessary.
684
+ if (transitionSeconds !== 0) {
685
+ setTimeout(() => {
686
+ tz.on_off.convertGet(entity, "state", meta).catch((error) => {
687
+ logger_1.logger.warning(`Error getting state of TS0505B_1 after transition: ${error.message}`, NS);
688
+ });
689
+ }, transitionSeconds * 1000 + 100);
690
+ }
691
+ return ret;
692
+ },
693
+ },
651
694
  };
652
695
  const fzLocal = {
653
696
  // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
@@ -1158,6 +1201,7 @@ exports.definitions = [
1158
1201
  "_TZE284_yjjdcqsq",
1159
1202
  "_TZE284_hdyjyqjm",
1160
1203
  "_TZE284_d7lpruvi",
1204
+ "_TZE284_upagmta9",
1161
1205
  ]),
1162
1206
  model: "TS0601_temperature_humidity_sensor_2",
1163
1207
  vendor: "Tuya",
@@ -1183,7 +1227,7 @@ exports.definitions = [
1183
1227
  tuya.whitelabel("Tuya", "ZTH01", "Temperature and humidity sensor", ["_TZE200_yjjdcqsq", "_TZE204_yjjdcqsq", "_TZE284_yjjdcqsq"]),
1184
1228
  tuya.whitelabel("Tuya", "SZTH02", "Temperature and humidity sensor", ["_TZE200_utkemkbs", "_TZE204_utkemkbs", "_TZE284_utkemkbs"]),
1185
1229
  tuya.whitelabel("Tuya", "ZTH02", "Temperature and humidity sensor", ["_TZE200_9yapgbuv", "_TZE204_9yapgbuv"]),
1186
- tuya.whitelabel("Tuya", "ZTH05", "Temperature and humidity sensor", ["_TZE204_upagmta9", "_TZE200_upagmta9"]),
1230
+ tuya.whitelabel("Tuya", "ZTH05", "Temperature and humidity sensor", ["_TZE204_upagmta9", "_TZE200_upagmta9", "_TZE284_upagmta9"]),
1187
1231
  tuya.whitelabel("Tuya", "ZTH08-E", "Temperature and humidity sensor", ["_TZE200_cirvgep4", "_TZE204_cirvgep4"]),
1188
1232
  tuya.whitelabel("Tuya", "ZTH08", "Temperature and humidity sensor", ["_TZE204_d7lpruvi", "_TZE284_d7lpruvi", "_TZE284_hdyjyqjm"]),
1189
1233
  ],
@@ -1352,7 +1396,7 @@ exports.definitions = [
1352
1396
  description: "Air quality sensor",
1353
1397
  fromZigbee: [legacy.fromZigbee.tuya_air_quality],
1354
1398
  toZigbee: [],
1355
- exposes: [e.temperature(), e.humidity(), e.co2(), e.voc().withUnit("ppm"), e.formaldehyd()],
1399
+ exposes: [e.temperature(), e.humidity(), e.co2(), e.voc().withUnit("ppb"), e.formaldehyd().withUnit("µg/m³")],
1356
1400
  },
1357
1401
  {
1358
1402
  fingerprint: tuya.fingerprint("TS0601", ["_TZE200_rbbx5mfq"]),
@@ -1759,6 +1803,7 @@ exports.definitions = [
1759
1803
  color: true,
1760
1804
  }),
1761
1805
  ],
1806
+ toZigbee: [tzLocal.TS0505B_1_transitionFixesOnOffBrightness],
1762
1807
  configure: (device, coordinatorEndpoint) => {
1763
1808
  device.getEndpoint(1).saveClusterAttributeKeyValue("lightingColorCtrl", {
1764
1809
  colorCapabilities: 29,
@@ -4463,7 +4508,7 @@ exports.definitions = [
4463
4508
  },
4464
4509
  },
4465
4510
  {
4466
- fingerprint: tuya.fingerprint("TS0004", ["_TZ3000_ltt60asa", "_TZ3000_mmkbptmx"]),
4511
+ fingerprint: tuya.fingerprint("TS0004", ["_TZ3000_ltt60asa", "_TZ3000_mmkbptmx", "_TZ3000_liygxtcq"]),
4467
4512
  model: "TS0004_switch_module",
4468
4513
  vendor: "Tuya",
4469
4514
  description: "4 gang switch module",
@@ -10720,10 +10765,8 @@ exports.definitions = [
10720
10765
  e.numeric("valve_duration", ea.STATE).withUnit("s").withDescription("Valve 1 irrigation last duration in seconds").withEndpoint("l1"),
10721
10766
  e.numeric("valve_duration", ea.STATE).withUnit("s").withDescription("Valve 2 irrigation last duration in seconds").withEndpoint("l2"),
10722
10767
  e.battery(),
10723
- e.battery_voltage(),
10724
10768
  ],
10725
10769
  meta: {
10726
- tuyaSendCommand: "sendData",
10727
10770
  tuyaDatapoints: [
10728
10771
  [1, "state_l1", tuya.valueConverter.onOff], // Valve 1 on/off
10729
10772
  [2, "state_l2", tuya.valueConverter.onOff], // Valve 2 on/off
@@ -10733,6 +10776,7 @@ exports.definitions = [
10733
10776
  [26, "valve_duration_l2", tuya.valueConverter.raw], // Valve 2 duration
10734
10777
  [104, "valve_status_l1", tuya.valueConverterBasic.lookup({ manual: 0, auto: 1, idle: 2 })], // Valve 1 status
10735
10778
  [105, "valve_status_l2", tuya.valueConverterBasic.lookup({ manual: 0, auto: 1, idle: 2 })], // Valve 2 status
10779
+ [59, "battery", tuya.valueConverter.raw],
10736
10780
  ],
10737
10781
  multiEndpoint: true, // Enable multi-endpoint support
10738
10782
  },
@@ -15526,7 +15570,7 @@ exports.definitions = [
15526
15570
  },
15527
15571
  {
15528
15572
  zigbeeModel: ["ZG-103Z"],
15529
- fingerprint: tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot"]),
15573
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot", "_TZE200_afycb3cg"]),
15530
15574
  model: "ZG-103Z",
15531
15575
  vendor: "Tuya",
15532
15576
  description: "Vibration sensor",
@@ -18036,6 +18080,7 @@ exports.definitions = [
18036
18080
  e.enum("adjustment_mode", ea.STATE_SET, ["brightness", "color_temp"]).withDescription("Adjustment mode"),
18037
18081
  ],
18038
18082
  meta: {
18083
+ multiEndpoint: true,
18039
18084
  tuyaDatapoints: [
18040
18085
  [102, "state", tuya.valueConverter.onOff],
18041
18086
  [103, "brightness", tuya.valueConverterBasic.scale(0, 254, 0, 1000)],
@@ -18047,8 +18092,6 @@ exports.definitions = [
18047
18092
  },
18048
18093
  configure: tuya.configureMagicPacket,
18049
18094
  endpoint: (device) => ({
18050
- l1: 1,
18051
- l2: 1,
18052
18095
  default: 1,
18053
18096
  }),
18054
18097
  },