zigbee-herdsman-converters 25.81.0 → 25.82.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.
@@ -184,6 +184,17 @@ const storeLocal = {
184
184
  this[`power_factor_${channel}`] = 100;
185
185
  this.flush(result, channel, options);
186
186
  },
187
+ // Some times the device sends a single zero value (either power or current).
188
+ // This is most likely a glitch. We flush all values but set them to null
189
+ // to indicate that they are not valid.
190
+ //
191
+ flushNull: function (result, channel, options) {
192
+ this[`sign_${channel}`] = null;
193
+ this[`power_${channel}`] = null;
194
+ this[`current_${channel}`] = null;
195
+ this[`power_factor_${channel}`] = null;
196
+ this.flush(result, channel, options);
197
+ },
187
198
  clear: () => {
188
199
  priv.sign_a = null;
189
200
  priv.sign_b = null;
@@ -193,6 +204,11 @@ const storeLocal = {
193
204
  priv.current_b = null;
194
205
  priv.power_factor_a = null;
195
206
  priv.power_factor_b = null;
207
+ // Used to detect single zero values
208
+ priv.zero_power_a = null;
209
+ priv.zero_power_b = null;
210
+ priv.zero_current_a = null;
211
+ priv.zero_current_b = null;
196
212
  },
197
213
  };
198
214
  globalStore.putValue(device, "private_state", priv);
@@ -224,8 +240,19 @@ const convLocal = {
224
240
  priv[`power_${channel}`] = v / 10;
225
241
  priv[`timestamp_${channel}`] = new Date().toISOString();
226
242
  if (v === 0) {
227
- priv.flushZero(result, channel, options);
228
- return result;
243
+ const singleZeroRemoveKey = "single_zero_remove";
244
+ const singleZeroRemove = options[singleZeroRemoveKey] != null ? options[singleZeroRemoveKey] : false;
245
+ if (singleZeroRemove && !priv[`zero_power_${channel}`]) {
246
+ logger_1.logger.info("[PJ1203A] power is zero, flushing one time", NS);
247
+ priv.flushNull(result, channel, options);
248
+ }
249
+ else {
250
+ priv.flushZero(result, channel, options);
251
+ }
252
+ priv[`zero_power_${channel}`] = true;
253
+ }
254
+ else {
255
+ priv[`zero_power_${channel}`] = false;
229
256
  }
230
257
  return result;
231
258
  },
@@ -238,8 +265,19 @@ const convLocal = {
238
265
  const result = {};
239
266
  priv[`current_${channel}`] = v / 1000;
240
267
  if (v === 0) {
241
- priv.flushZero(result, channel, options);
242
- return result;
268
+ const singleZeroRemoveKey = "single_zero_remove";
269
+ const singleZeroRemove = options[singleZeroRemoveKey] != null ? options[singleZeroRemoveKey] : false;
270
+ if (singleZeroRemove && !priv[`zero_current_${channel}`]) {
271
+ logger_1.logger.info("[PJ1203A] current is zero, flushing one time", NS);
272
+ priv.flushNull(result, channel, options);
273
+ }
274
+ else {
275
+ priv.flushZero(result, channel, options);
276
+ }
277
+ priv[`zero_current_${channel}`] = true;
278
+ }
279
+ else {
280
+ priv[`zero_current_${channel}`] = false;
243
281
  }
244
282
  return result;
245
283
  },
@@ -828,7 +866,7 @@ const fzLocal = {
828
866
  TS0201_humidity: {
829
867
  ...fz.humidity,
830
868
  convert: (model, msg, publish, options, meta) => {
831
- if (["_TZ3210_ncw88jfq", "_TZ3000_ywagc4rj", "_TZ3000_isw9u95y"].includes(meta.device.manufacturerName)) {
869
+ if (["_TZ3210_ncw88jfq", "_TZ3000_ywagc4rj", "_TZ3000_isw9u95y", "_TZ3000_yupc0pb7"].includes(meta.device.manufacturerName)) {
832
870
  msg.data.measuredValue *= 10;
833
871
  }
834
872
  return fz.humidity.convert(model, msg, publish, options, meta);
@@ -4093,7 +4131,7 @@ exports.definitions = [
4093
4131
  },
4094
4132
  },
4095
4133
  {
4096
- fingerprint: tuya.fingerprint("TS0601", ["_TZE204_2imwyigp", "_TZE200_2imwyigp"]),
4134
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE204_2imwyigp", "_TZE200_2imwyigp", "_TZE200_go3tvswy"]),
4097
4135
  model: "MG-ZG03W",
4098
4136
  vendor: "Tuya",
4099
4137
  description: "3 gang switch",
@@ -4116,7 +4154,7 @@ exports.definitions = [
4116
4154
  },
4117
4155
  },
4118
4156
  {
4119
- fingerprint: tuya.fingerprint("TS0601", ["_TZE200_go3tvswy", "_TZE200_oyti2ums"]),
4157
+ fingerprint: tuya.fingerprint("TS0601", ["_TZE200_oyti2ums"]),
4120
4158
  model: "MG-GPO04ZSLP",
4121
4159
  vendor: "Tuya",
4122
4160
  description: "2 x socket + 1 x light with master switch and metering",
@@ -4338,7 +4376,7 @@ exports.definitions = [
4338
4376
  tuya.whitelabel("Danfoss", "014G2480", "Temperature and humidity sensor", ["_TZ3000_mxzo5rhf"]),
4339
4377
  tuya.whitelabel("Tuya", "HS09", "Hanging temperature humidity sensor", ["_TZ3000_1twfmkcc"]),
4340
4378
  tuya.whitelabel("Nedis", "ZBSC10WT", "Temperature and humidity sensor", ["_TZ3000_fie1dpkm"]),
4341
- tuya.whitelabel("Tuya", "TH09Z", "Temperature and humidity sensor", ["_TZ3000_isw9u95y"]),
4379
+ tuya.whitelabel("Tuya", "TH09Z", "Temperature and humidity sensor", ["_TZ3000_isw9u95y", "_TZ3000_yupc0pb7"]),
4342
4380
  ],
4343
4381
  },
4344
4382
  {
@@ -7555,35 +7593,41 @@ exports.definitions = [
7555
7593
  exposes: [
7556
7594
  e.battery(),
7557
7595
  e.child_lock(),
7558
- e.window_detection(),
7559
- e.binary("window", ea.STATE, "OPEN", "CLOSE").withDescription("Window status closed or open "),
7560
- e.enum("mode", ea.STATE_SET, ["auto", "manual"]).withDescription("Mode"),
7561
- e.binary("holiday_mode", ea.STATE_SET, "ON", "OFF"),
7562
- e.binary("heating_stop", ea.STATE_SET, "ON", "OFF"),
7596
+ e.window_detection_bool(),
7597
+ e.window_open(),
7563
7598
  e
7564
7599
  .climate()
7565
- .withLocalTemperature(ea.STATE)
7566
7600
  .withSetpoint("current_heating_setpoint", 5, 35, 0.5, ea.STATE_SET)
7567
- .withLocalTemperatureCalibration(-30, 30, 0.1, ea.STATE_SET),
7568
- e.comfort_temperature().withValueMin(5).withValueMax(30).withDescription("Comfort mode temperature"),
7569
- e.eco_temperature().withValueMin(5).withValueMax(30).withDescription("Eco mode temperature"),
7570
- e.enum("screen_orientation", ea.STATE_SET, ["up", "right", "down", "left"]).withDescription("Screen orientation"),
7571
- tuya.exposes.frostProtection(),
7601
+ .withLocalTemperature(ea.STATE) // local_temperature
7602
+ .withLocalTemperatureCalibration(-7, 7, 0.5, ea.STATE_SET) // local_temperature_calibration
7603
+ .withSystemMode(["auto", "off"], ea.STATE_SET) // system_mode
7604
+ .withPreset(["schedule", "manual", "holiday"]), //preset
7605
+ e.comfort_temperature().withValueMin(15).withValueMax(35),
7606
+ e.eco_temperature().withValueMin(5).withValueMax(22),
7607
+ e.holiday_temperature().withValueMin(5).withValueMax(35),
7608
+ e.text("holiday_time", ea.STATE_SET).withDescription("Holiday start and end time in format YYYY/MM/DD HH:MM | YYYY/MM/DD HH:MM"),
7572
7609
  e.binary("boost_heating", ea.STATE_SET, "ON", "OFF"),
7573
- e.numeric("boost_time", ea.STATE_SET).withUnit("min").withDescription("Countdown in minutes").withValueMin(0).withValueMax(1000),
7610
+ e.numeric("boost_time", ea.STATE_SET).withUnit("min").withDescription("Countdown in minutes").withValueMin(0).withValueMax(30),
7611
+ e
7612
+ .binary("frost_protection", ea.STATE_SET, "ON", "OFF")
7613
+ .withDescription("When the room temperature is lower than 5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes."),
7614
+ ...["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"].map((day) => e.text(`schedule_${day}`, ea.STATE_SET).withDescription("Schedule in 8 segments format: HH:MM/TT.T HH:MM/TT.T ...")),
7615
+ e.enum("screen_orientation", ea.STATE_SET, ["up", "right", "down", "left"]).withDescription("Screen orientation"),
7574
7616
  e.numeric("fault_code", ea.STATE).withDescription("Raw fault code"),
7575
7617
  ],
7576
7618
  meta: {
7577
7619
  tuyaDatapoints: [
7578
7620
  [
7579
7621
  2,
7580
- "mode",
7622
+ "preset",
7581
7623
  tuya.valueConverterBasic.lookup({
7582
- auto: tuya.enum(0),
7624
+ schedule: tuya.enum(0),
7625
+ holiday: tuya.enum(1), // only possible to set during holiday_time
7583
7626
  manual: tuya.enum(2),
7584
7627
  }),
7585
7628
  ],
7586
- [4, "current_heating_setpoint", tuya.valueConverter.divideBy10],
7629
+ // when system_mode is 'off', current_heating_setpoint is set to -5000... hence limits
7630
+ [4, "current_heating_setpoint", tuya.valueConverterBasic.divideByWithLimits(10, 0, 35)],
7587
7631
  [5, "local_temperature", tuya.valueConverter.divideBy10],
7588
7632
  [6, "battery", tuya.valueConverter.raw],
7589
7633
  [
@@ -7594,29 +7638,23 @@ exports.definitions = [
7594
7638
  UNLOCK: false,
7595
7639
  }),
7596
7640
  ],
7597
- [14, "window_detection", tuya.valueConverter.onOff],
7598
- [
7599
- 15,
7600
- "window",
7601
- tuya.valueConverterBasic.lookup({
7602
- CLOSE: tuya.enum(0),
7603
- OPEN: tuya.enum(1),
7604
- }),
7605
- ],
7641
+ [14, "window_detection", tuya.valueConverter.raw],
7642
+ [15, "window_open", tuya.valueConverter.trueFalseEnum1],
7606
7643
  [21, "holiday_temperature", tuya.valueConverter.divideBy10],
7607
7644
  [36, "frost_protection", tuya.valueConverter.onOff],
7608
- [39, "switch_scale", tuya.valueConverter.raw],
7609
- [47, "local_temperature_calibration", tuya.valueConverter.localTempCalibration1],
7645
+ [39, "anti_scale", tuya.valueConverter.raw],
7646
+ [47, "local_temperature_calibration", tuya.valueConverter.localTempCalibration1], // duplicate/legacy
7647
+ [49, "valve_status", tuya.valueConverter.raw],
7610
7648
  [101, "boost_heating", tuya.valueConverter.onOff],
7611
7649
  [102, "boost_time", tuya.valueConverter.countdown],
7612
- [103, "schedule_monday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(1)],
7613
- [104, "schedule_tuesday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(2)],
7614
- [105, "schedule_wednesday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(3)],
7615
- [106, "schedule_thursday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(4)],
7616
- [107, "schedule_friday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(5)],
7617
- [108, "schedule_saturday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(6)],
7618
- [109, "schedule_sunday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber(7)],
7619
- [110, "holiday_mode", tuya.valueConverter.onOff],
7650
+ [103, "schedule_monday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7651
+ [104, "schedule_tuesday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7652
+ [105, "schedule_wednesday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7653
+ [106, "schedule_thursday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7654
+ [107, "schedule_friday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7655
+ [108, "schedule_saturday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7656
+ [109, "schedule_sunday", tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
7657
+ [110, "holiday_time", tuya.valueConverter.thermostatHolidayStartStopUnixTS],
7620
7658
  [
7621
7659
  111,
7622
7660
  "screen_orientation",
@@ -7628,7 +7666,14 @@ exports.definitions = [
7628
7666
  }),
7629
7667
  ],
7630
7668
  [112, "antifrost_temperature", tuya.valueConverter.divideBy10],
7631
- [113, "heating_stop", tuya.valueConverter.onOff],
7669
+ [
7670
+ 113,
7671
+ "system_mode",
7672
+ tuya.valueConverterBasic.lookup({
7673
+ auto: false,
7674
+ off: true,
7675
+ }),
7676
+ ],
7632
7677
  [114, "local_temperature_calibration", tuya.valueConverter.localTempCalibration1],
7633
7678
  [115, "programming_mode", tuya.valueConverter.raw],
7634
7679
  [116, "eco_temperature", tuya.valueConverter.divideBy10],
@@ -9247,7 +9292,7 @@ exports.definitions = [
9247
9292
  },
9248
9293
  },
9249
9294
  {
9250
- fingerprint: tuya.fingerprint("TS0726", ["_TZ3000_wsspgtcd", "_TZ3000_s678wazd", "_TZ3002_pzao9ls1"]),
9295
+ fingerprint: tuya.fingerprint("TS0726", ["_TZ3000_wsspgtcd", "_TZ3000_s678wazd", "_TZ3002_pzao9ls1", "_TZ3000_kfkqkjqe"]),
9251
9296
  model: "TS0726_4_gang",
9252
9297
  vendor: "Tuya",
9253
9298
  description: "4 gang switch with neutral wire",
@@ -13789,7 +13834,7 @@ exports.definitions = [
13789
13834
  ],
13790
13835
  },
13791
13836
  {
13792
- fingerprint: tuya.fingerprint("TS0001", ["_TZ3210_dse8ogfy", "_TZ3210_j4pdtz9v", "_TZ3210_7vgttna6", "_TZ3210_a04acm9s"]),
13837
+ fingerprint: tuya.fingerprint("TS0001", ["_TZ3210_dse8ogfy", "_TZ3210_j4pdtz9v", "_TZ3210_7vgttna6", "_TZ3210_a04acm9s", "_TZ3210_cm9mbpr1"]),
13793
13838
  model: "TS0001_fingerbot",
13794
13839
  vendor: "Tuya",
13795
13840
  description: "Zigbee fingerbot plus",
@@ -15017,6 +15062,9 @@ exports.definitions = [
15017
15062
  .withDescription("Report energy flow direction for channel B using signed power (default false)."),
15018
15063
  e.binary("invert_energy_flow_a", ea.SET, true, false).withDescription("Report energy flow direction inverted for channel A."),
15019
15064
  e.binary("invert_energy_flow_b", ea.SET, true, false).withDescription("Report energy flow direction inverted for channel B."),
15065
+ e
15066
+ .binary("single_zero_remove", ea.SET, true, false)
15067
+ .withDescription("If true then single-zero power or current values will be disgarded. The default is false."),
15020
15068
  ],
15021
15069
  exposes: [
15022
15070
  e.ac_frequency(),
@@ -21130,7 +21178,7 @@ exports.definitions = [
21130
21178
  fingerprint: tuya.fingerprint("TS0601", ["_TZE284_iwyqtclw"]),
21131
21179
  model: "M9Pro",
21132
21180
  vendor: "Tuya",
21133
- description: "Smart 4 gang switch, curtain, smart light or scene. 1x thermosat control",
21181
+ description: "Smart 4 gang switch, curtain, smart light or scene. 1x thermostat control",
21134
21182
  exposes: [
21135
21183
  ...[1, 2, 3, 4].map((i) => e.switch().withEndpoint(`l${i}`).setAccess("state", ea.STATE_SET)),
21136
21184
  ...[1, 2, 3].map((i) => e.enum("mode", ea.STATE_SET, ["switch", "scene", "smart_light", "curtain"]).withEndpoint(`l${i}`).withDescription(`Switch ${i} mode`)),