zigbee-herdsman-converters 25.65.0 → 25.67.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.
- package/CHANGELOG.md +39 -0
- package/dist/devices/bega.d.ts.map +1 -1
- package/dist/devices/bega.js +7 -0
- package/dist/devices/bega.js.map +1 -1
- package/dist/devices/easyiot.d.ts.map +1 -1
- package/dist/devices/easyiot.js +2 -3
- package/dist/devices/easyiot.js.map +1 -1
- package/dist/devices/ecodim.js +1 -1
- package/dist/devices/ecodim.js.map +1 -1
- package/dist/devices/innr.d.ts.map +1 -1
- package/dist/devices/innr.js +7 -0
- package/dist/devices/innr.js.map +1 -1
- package/dist/devices/konke.js +1 -1
- package/dist/devices/konke.js.map +1 -1
- package/dist/devices/ledvance.d.ts.map +1 -1
- package/dist/devices/ledvance.js +1 -0
- package/dist/devices/ledvance.js.map +1 -1
- package/dist/devices/moes.js +1 -1
- package/dist/devices/philips.d.ts.map +1 -1
- package/dist/devices/philips.js +22 -1
- package/dist/devices/philips.js.map +1 -1
- package/dist/devices/somfy.d.ts.map +1 -1
- package/dist/devices/somfy.js +7 -0
- package/dist/devices/somfy.js.map +1 -1
- package/dist/devices/sonoff.d.ts.map +1 -1
- package/dist/devices/sonoff.js +38 -0
- package/dist/devices/sonoff.js.map +1 -1
- package/dist/devices/tuya.d.ts.map +1 -1
- package/dist/devices/tuya.js +207 -3
- package/dist/devices/tuya.js.map +1 -1
- package/dist/models-index.json +1 -1
- package/package.json +4 -4
package/dist/devices/tuya.js
CHANGED
|
@@ -358,6 +358,21 @@ const convLocal = {
|
|
|
358
358
|
return new node_util_1.TextDecoder("utf-8").decode(hexToBytes);
|
|
359
359
|
},
|
|
360
360
|
},
|
|
361
|
+
nameTrunc: {
|
|
362
|
+
to: (v, meta, len = 8) => {
|
|
363
|
+
const truncated = v.slice(0, len);
|
|
364
|
+
const utf8bytes = new node_util_1.TextEncoder().encode(truncated);
|
|
365
|
+
return Array.from(utf8bytes, (utf8bytes) => utf8bytes.toString(16).padStart(4, "0")).join("");
|
|
366
|
+
},
|
|
367
|
+
from: (v, meta) => {
|
|
368
|
+
const bytes = [];
|
|
369
|
+
for (let i = 0; i < v.length; i += 4) {
|
|
370
|
+
bytes.push(Number.parseInt(v.slice(i, i + 4), 16));
|
|
371
|
+
}
|
|
372
|
+
const hexToBytes = Uint8Array.from(bytes);
|
|
373
|
+
return new node_util_1.TextDecoder("utf-8").decode(hexToBytes);
|
|
374
|
+
},
|
|
375
|
+
},
|
|
361
376
|
};
|
|
362
377
|
const tzLocal = {
|
|
363
378
|
ts0049_countdown: {
|
|
@@ -2271,7 +2286,7 @@ exports.definitions = [
|
|
|
2271
2286
|
zigbeeModel: ["CK-BL702-AL-01(7009_Z102LG03-1)", "CK-BL702-AL-01(7009_Z102LG04-1)", "CK-BL702-AL-01(7009_Z102LG04-2)"],
|
|
2272
2287
|
model: "CK-BL702-AL-01",
|
|
2273
2288
|
vendor: "Tuya",
|
|
2274
|
-
description: "Zigbee LED bulb",
|
|
2289
|
+
description: "GU-10 5W 350lm Zigbee RGBCCW LED bulb",
|
|
2275
2290
|
extend: [
|
|
2276
2291
|
tuya.modernExtend.tuyaLight({
|
|
2277
2292
|
colorTemp: { range: [142, 500] },
|
|
@@ -7578,6 +7593,7 @@ exports.definitions = [
|
|
|
7578
7593
|
tuya.modernExtend.tuyaOnOff({
|
|
7579
7594
|
electricalMeasurements: true,
|
|
7580
7595
|
powerOutageMemory: true,
|
|
7596
|
+
onOffCountdown: true,
|
|
7581
7597
|
indicatorMode: true,
|
|
7582
7598
|
childLock: true,
|
|
7583
7599
|
}),
|
|
@@ -13500,7 +13516,7 @@ exports.definitions = [
|
|
|
13500
13516
|
],
|
|
13501
13517
|
},
|
|
13502
13518
|
{
|
|
13503
|
-
fingerprint: tuya.fingerprint("TS0001", ["_TZ3210_dse8ogfy", "_TZ3210_j4pdtz9v"]),
|
|
13519
|
+
fingerprint: tuya.fingerprint("TS0001", ["_TZ3210_dse8ogfy", "_TZ3210_j4pdtz9v", "_TZ3210_7vgttna6"]),
|
|
13504
13520
|
model: "TS0001_fingerbot",
|
|
13505
13521
|
vendor: "Tuya",
|
|
13506
13522
|
description: "Zigbee fingerbot plus",
|
|
@@ -20583,7 +20599,7 @@ exports.definitions = [
|
|
|
20583
20599
|
[
|
|
20584
20600
|
7,
|
|
20585
20601
|
"work_state",
|
|
20586
|
-
tuya.valueConverterBasic.lookup((options) => options.invert_cover ? { opening: tuya.enum(
|
|
20602
|
+
tuya.valueConverterBasic.lookup((options) => options.invert_cover ? { opening: tuya.enum(0), closing: tuya.enum(1) } : { opening: tuya.enum(1), closing: tuya.enum(0) }),
|
|
20587
20603
|
],
|
|
20588
20604
|
[12, "motor_fault", tuya.valueConverter.trueFalse1],
|
|
20589
20605
|
[13, "battery", tuya.valueConverter.raw],
|
|
@@ -20602,5 +20618,193 @@ exports.definitions = [
|
|
|
20602
20618
|
],
|
|
20603
20619
|
},
|
|
20604
20620
|
},
|
|
20621
|
+
{
|
|
20622
|
+
fingerprint: tuya.fingerprint("TS0601", ["_TZE284_iwyqtclw"]),
|
|
20623
|
+
model: "M9Pro",
|
|
20624
|
+
vendor: "Tuya",
|
|
20625
|
+
description: "Smart 4 gang switch, curtain, smart light or scene. 1x thermosat control",
|
|
20626
|
+
exposes: [
|
|
20627
|
+
...[1, 2, 3, 4].map((i) => e.switch().withEndpoint(`l${i}`).setAccess("state", ea.STATE_SET)),
|
|
20628
|
+
...[1, 2, 3].map((i) => e.enum("mode", ea.STATE_SET, ["switch", "scene", "smart_light", "curtain"]).withEndpoint(`l${i}`).withDescription(`Switch ${i} mode`)),
|
|
20629
|
+
e
|
|
20630
|
+
.enum("mode", ea.STATE_SET, ["switch", "scene", "smart_light", "curtain", "thermostat"])
|
|
20631
|
+
.withEndpoint("l4")
|
|
20632
|
+
.withDescription("Switch 4 mode"),
|
|
20633
|
+
...[1, 2, 3, 4].map((i) => e.text("name", ea.STATE_SET).withEndpoint(`l${i}`).withDescription(`Name for Switch ${i} (max 8 chars displayed)`)),
|
|
20634
|
+
...[1, 2, 3, 4].map((i) => e.text("scene_name", ea.STATE_SET).withEndpoint(`l${i}`).withDescription(`Scene name for switch ${i} (max 8 chars displayed)`)),
|
|
20635
|
+
...[1, 2, 3, 4].map((i) => e.text("dimmer_name", ea.STATE_SET).withEndpoint(`l${i}`).withDescription(`Smart Light name for switch ${i} (max 8 chars displayed)`)),
|
|
20636
|
+
...[1, 2, 3, 4].map((i) => exposes.binary("dimmer_switch", ea.STATE_SET, "ON", "OFF").withEndpoint(`l${i}`).withDescription(`Smart Light - toggle switch ${i}`)),
|
|
20637
|
+
...[1, 2, 3, 4].map((i) => e.text("curtain_name", ea.STATE_SET).withEndpoint(`l${i}`).withDescription(`Curtain name for switch ${i} (max 8 chars displayed)`)),
|
|
20638
|
+
...[1, 2, 3, 4].map((i) => exposes.binary("curtain_switch", ea.STATE_SET, "ON", "OFF").withEndpoint(`l${i}`).withDescription(`Curtain - toggle switch ${i}`)),
|
|
20639
|
+
e.power_on_behavior(["off", "on", "previous"]).withAccess(ea.STATE_SET).withDescription("Whole panel override.").withCategory("config"),
|
|
20640
|
+
...[1, 2, 3, 4].map((i) => e.power_on_behavior(["off", "on", "previous"]).withAccess(ea.STATE_SET).withEndpoint(`l${i}`)),
|
|
20641
|
+
exposes.binary("show_weather", ea.STATE_SET, "ON", "OFF").withDescription("Show time and weather (on) or just switch names (off)"),
|
|
20642
|
+
exposes.binary("backlight", ea.STATE_SET, "ON", "OFF").withDescription("Button LED backlights"),
|
|
20643
|
+
e.enum("show_screen", ea.STATE_SET, ["motion", "on_press", "on"]).withDescription("Screen display mode"),
|
|
20644
|
+
// Thermostat - Switch 4 only
|
|
20645
|
+
exposes
|
|
20646
|
+
.binary("thermostat", ea.STATE_SET, "ON", "OFF")
|
|
20647
|
+
.withDescription("Thermostat - toggle switch"),
|
|
20648
|
+
e.text("thermostat_name", ea.STATE_SET).withDescription("Name for Thermostat (max 8 chars displayed)"),
|
|
20649
|
+
e
|
|
20650
|
+
.enum("scene_switch", ea.STATE_SET, [
|
|
20651
|
+
"switch_1",
|
|
20652
|
+
"switch_2",
|
|
20653
|
+
"switch_3",
|
|
20654
|
+
"switch_4",
|
|
20655
|
+
"switch_5",
|
|
20656
|
+
"switch_6",
|
|
20657
|
+
"switch_7",
|
|
20658
|
+
"switch_8",
|
|
20659
|
+
"switch_9",
|
|
20660
|
+
])
|
|
20661
|
+
.withDescription("Scene Switch"),
|
|
20662
|
+
e.action(["scene_0", "scene_1", "scene_2", "scene_3", "scene_4", "scene_5", "scene_6", "scene_7", "scene_8"]),
|
|
20663
|
+
// Set weather
|
|
20664
|
+
// Temperature will accept decimal values e.g. 0.1 but display will round off to nearest whole number.
|
|
20665
|
+
// Best to handle rounding in HA before passing to z2m.
|
|
20666
|
+
e
|
|
20667
|
+
.numeric("temperature_1", ea.STATE_SET)
|
|
20668
|
+
.withValueMin(-65)
|
|
20669
|
+
.withValueMax(99)
|
|
20670
|
+
.withDescription("Temperature")
|
|
20671
|
+
.withValueStep(0.1),
|
|
20672
|
+
// If you need other values to match your weather provider, map them with a template in HA or
|
|
20673
|
+
// add a z2m 'External Extension' to override tuya.M8ProTuyaWeatherCondition.
|
|
20674
|
+
e
|
|
20675
|
+
.enum("condition_1", ea.STATE_SET, Object.keys(tuya.M8ProTuyaWeatherCondition))
|
|
20676
|
+
.withDescription("Weather condition"),
|
|
20677
|
+
],
|
|
20678
|
+
meta: {
|
|
20679
|
+
multiEndpoint: true,
|
|
20680
|
+
disableDefaultResponse: true,
|
|
20681
|
+
tuyaDatapoints: [
|
|
20682
|
+
[1, "action", tuya.valueConverter.static("scene_1")],
|
|
20683
|
+
[2, "action", tuya.valueConverter.static("scene_2")],
|
|
20684
|
+
[3, "action", tuya.valueConverter.static("scene_3")],
|
|
20685
|
+
[4, "action", tuya.valueConverter.static("scene_4")],
|
|
20686
|
+
[17, "action", tuya.valueConverter.static("scene_0")],
|
|
20687
|
+
[
|
|
20688
|
+
18,
|
|
20689
|
+
"mode_l1",
|
|
20690
|
+
tuya.valueConverterBasic.lookup({
|
|
20691
|
+
switch: tuya.enum(0),
|
|
20692
|
+
scene: tuya.enum(1),
|
|
20693
|
+
smart_light: tuya.enum(2),
|
|
20694
|
+
curtain: tuya.enum(3),
|
|
20695
|
+
}),
|
|
20696
|
+
],
|
|
20697
|
+
[
|
|
20698
|
+
19,
|
|
20699
|
+
"mode_l2",
|
|
20700
|
+
tuya.valueConverterBasic.lookup({
|
|
20701
|
+
switch: tuya.enum(0),
|
|
20702
|
+
scene: tuya.enum(1),
|
|
20703
|
+
smart_light: tuya.enum(2),
|
|
20704
|
+
curtain: tuya.enum(3),
|
|
20705
|
+
}),
|
|
20706
|
+
],
|
|
20707
|
+
[
|
|
20708
|
+
20,
|
|
20709
|
+
"mode_l3",
|
|
20710
|
+
tuya.valueConverterBasic.lookup({
|
|
20711
|
+
switch: tuya.enum(0),
|
|
20712
|
+
scene: tuya.enum(1),
|
|
20713
|
+
smart_light: tuya.enum(2),
|
|
20714
|
+
curtain: tuya.enum(3),
|
|
20715
|
+
}),
|
|
20716
|
+
],
|
|
20717
|
+
[
|
|
20718
|
+
21,
|
|
20719
|
+
"mode_l4",
|
|
20720
|
+
tuya.valueConverterBasic.lookup({
|
|
20721
|
+
switch: tuya.enum(0),
|
|
20722
|
+
scene: tuya.enum(1),
|
|
20723
|
+
smart_light: tuya.enum(2),
|
|
20724
|
+
curtain: tuya.enum(3),
|
|
20725
|
+
thermostat: tuya.enum(4),
|
|
20726
|
+
}),
|
|
20727
|
+
],
|
|
20728
|
+
[24, "state_l1", tuya.valueConverter.onOff],
|
|
20729
|
+
[25, "state_l2", tuya.valueConverter.onOff],
|
|
20730
|
+
[26, "state_l3", tuya.valueConverter.onOff],
|
|
20731
|
+
[27, "state_l4", tuya.valueConverter.onOff],
|
|
20732
|
+
[36, "show_weather", tuya.valueConverter.onOff],
|
|
20733
|
+
// Screen display modes.
|
|
20734
|
+
// From Tuya Dev Platform: enum "range": ["relay", "pos", "none"]. These names don't match what's happening on the device
|
|
20735
|
+
[
|
|
20736
|
+
37,
|
|
20737
|
+
"show_screen",
|
|
20738
|
+
tuya.valueConverterBasic.lookup({
|
|
20739
|
+
motion: tuya.enum(0), // Screen on/off with motion detection.
|
|
20740
|
+
on_press: tuya.enum(1), // Disable motion detection. Only show screen on physical button press.
|
|
20741
|
+
on: tuya.enum(2), // Screen stays on.
|
|
20742
|
+
}),
|
|
20743
|
+
],
|
|
20744
|
+
[38, "power_on_behavior", tuya.valueConverter.powerOnBehaviorEnum], // whole panel
|
|
20745
|
+
[39, "power_on_behavior_l1", tuya.valueConverter.powerOnBehaviorEnum],
|
|
20746
|
+
[40, "power_on_behavior_l2", tuya.valueConverter.powerOnBehaviorEnum],
|
|
20747
|
+
[41, "power_on_behavior_l3", tuya.valueConverter.powerOnBehaviorEnum],
|
|
20748
|
+
[42, "power_on_behavior_l4", tuya.valueConverter.powerOnBehaviorEnum],
|
|
20749
|
+
[101, "backlight", tuya.valueConverter.onOff], // Buttton backlights
|
|
20750
|
+
[
|
|
20751
|
+
102,
|
|
20752
|
+
"scene_switch",
|
|
20753
|
+
tuya.valueConverterBasic.lookup({
|
|
20754
|
+
switch_1: tuya.enum(0),
|
|
20755
|
+
switch_2: tuya.enum(1),
|
|
20756
|
+
switch_3: tuya.enum(2),
|
|
20757
|
+
switch_4: tuya.enum(3),
|
|
20758
|
+
switch_5: tuya.enum(4),
|
|
20759
|
+
switch_6: tuya.enum(5),
|
|
20760
|
+
switch_7: tuya.enum(6),
|
|
20761
|
+
switch_8: tuya.enum(7),
|
|
20762
|
+
switch_9: tuya.enum(8),
|
|
20763
|
+
}),
|
|
20764
|
+
],
|
|
20765
|
+
// The M9 Pro only displays first 8 chars of names, but state will hold the whole string.
|
|
20766
|
+
// I prefer that the state always equals what is displayed, so trim name to 8 chars.
|
|
20767
|
+
// Switch names
|
|
20768
|
+
[103, "name_l1", convLocal.nameTrunc],
|
|
20769
|
+
[104, "name_l2", convLocal.nameTrunc],
|
|
20770
|
+
[105, "name_l3", convLocal.nameTrunc],
|
|
20771
|
+
[106, "name_l4", convLocal.nameTrunc],
|
|
20772
|
+
// Scene names
|
|
20773
|
+
[107, "scene_name_l1", convLocal.nameTrunc],
|
|
20774
|
+
[108, "scene_name_l2", convLocal.nameTrunc],
|
|
20775
|
+
[109, "scene_name_l3", convLocal.nameTrunc],
|
|
20776
|
+
[110, "scene_name_l4", convLocal.nameTrunc],
|
|
20777
|
+
// Dimmer names
|
|
20778
|
+
[111, "dimmer_name_l1", convLocal.nameTrunc],
|
|
20779
|
+
[112, "dimmer_name_l2", convLocal.nameTrunc],
|
|
20780
|
+
[113, "dimmer_name_l3", convLocal.nameTrunc],
|
|
20781
|
+
[114, "dimmer_name_l4", convLocal.nameTrunc],
|
|
20782
|
+
// Curtain names
|
|
20783
|
+
[115, "curtain_name_l1", convLocal.nameTrunc],
|
|
20784
|
+
[116, "curtain_name_l2", convLocal.nameTrunc],
|
|
20785
|
+
[117, "curtain_name_l3", convLocal.nameTrunc],
|
|
20786
|
+
[118, "curtain_name_l4", convLocal.nameTrunc],
|
|
20787
|
+
[119, "curtain_switch_l1", tuya.valueConverter.onOff],
|
|
20788
|
+
[120, "curtain_switch_l2", tuya.valueConverter.onOff],
|
|
20789
|
+
[121, "curtain_switch_l3", tuya.valueConverter.onOff],
|
|
20790
|
+
[122, "curtain_switch_l4", tuya.valueConverter.onOff],
|
|
20791
|
+
[123, "dimmer_switch_l1", tuya.valueConverter.onOff],
|
|
20792
|
+
[124, "dimmer_switch_l2", tuya.valueConverter.onOff],
|
|
20793
|
+
[125, "dimmer_switch_l3", tuya.valueConverter.onOff],
|
|
20794
|
+
[126, "dimmer_switch_l4", tuya.valueConverter.onOff],
|
|
20795
|
+
[127, "thermostat", tuya.valueConverter.onOff],
|
|
20796
|
+
[128, "thermostat_name", convLocal.nameTrunc],
|
|
20797
|
+
],
|
|
20798
|
+
},
|
|
20799
|
+
extend: [
|
|
20800
|
+
// NOTE: M9 Pro only updates the weather condition and temperature on power cycle and once per hour.
|
|
20801
|
+
tuya.modernExtend.tuyaWeatherForecast({ includeCurrentWeather: true, numberOfForecastDays: 3, correctForNegativeValues: false }),
|
|
20802
|
+
tuya.modernExtend.tuyaBase({
|
|
20803
|
+
dp: true,
|
|
20804
|
+
timeStart: "1970", // needed else date/time doesn't sync with z2m > 2.6.2
|
|
20805
|
+
}),
|
|
20806
|
+
m.deviceEndpoints({ endpoints: { l1: 1, l2: 1, l3: 1, l4: 1 } }),
|
|
20807
|
+
],
|
|
20808
|
+
},
|
|
20605
20809
|
];
|
|
20606
20810
|
//# sourceMappingURL=tuya.js.map
|