zigbee-herdsman-converters 23.46.1-dev.0 → 23.47.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 +18 -0
- package/dist/devices/sonoff.d.ts.map +1 -1
- package/dist/devices/sonoff.js +353 -9
- package/dist/devices/sonoff.js.map +1 -1
- package/dist/lib/ota.d.ts +0 -1
- package/dist/lib/ota.d.ts.map +1 -1
- package/dist/lib/ota.js +4 -4
- package/dist/lib/ota.js.map +1 -1
- package/dist/lib/types.d.ts +0 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/models-index.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [23.47.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v23.46.0...v23.47.0) (2025-05-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **add:** 067797 ([#9366](https://github.com/Koenkk/zigbee-herdsman-converters/issues/9366)) ([7fee57d](https://github.com/Koenkk/zigbee-herdsman-converters/commit/7fee57d383149b4f14ab0d67a22d6752eb157284))
|
|
9
|
+
* **add:** 5717 ([#9364](https://github.com/Koenkk/zigbee-herdsman-converters/issues/9364)) ([59c942e](https://github.com/Koenkk/zigbee-herdsman-converters/commit/59c942eddc399ff1401355f929ebb7b2afaeb5b9))
|
|
10
|
+
* **add:** ZC-LP01 ([#9365](https://github.com/Koenkk/zigbee-herdsman-converters/issues/9365)) ([71a98bb](https://github.com/Koenkk/zigbee-herdsman-converters/commit/71a98bb62566bb8265de411d9389f7674d5d8de4))
|
|
11
|
+
* SONOFF S60ZBTPF and S60ZBTPG: expose more features ([#9263](https://github.com/Koenkk/zigbee-herdsman-converters/issues/9263)) ([6f82625](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6f82625178c8eb41e0aecc22b1e72fa24ff8c77d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **detect:** Detect `_TZE204_tdhnhhiy` as Tuya TS0601_switch_8 https://github.com/Koenkk/zigbee2mqtt/issues/27454 ([9bb691a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/9bb691a4841d2543db2334a755d2b7467efd97ed))
|
|
17
|
+
* **detect:** Detect `_TZE284_6ycgarab` as Tuya ZSS-QY-SSD-A-EN https://github.com/Koenkk/zigbee-herdsman-converters/issues/9289 ([64e063a](https://github.com/Koenkk/zigbee-herdsman-converters/commit/64e063a6226089ae4c8c984abdbee9dd720444fa))
|
|
18
|
+
* Fix RADION TriTech ZB typo https://github.com/Koenkk/zigbee2mqtt/discussions/27455 ([6edb338](https://github.com/Koenkk/zigbee-herdsman-converters/commit/6edb33873930a6bf67aa00b2f69aa96cdd37e9fc))
|
|
19
|
+
* Tuya MG-ZG01W: simplify integration ([#9363](https://github.com/Koenkk/zigbee-herdsman-converters/issues/9363)) ([a60a23f](https://github.com/Koenkk/zigbee-herdsman-converters/commit/a60a23fc36ed62fd1b56694980e206960ef62bb3))
|
|
20
|
+
|
|
3
21
|
## [23.46.0](https://github.com/Koenkk/zigbee-herdsman-converters/compare/v23.45.0...v23.46.0) (2025-05-18)
|
|
4
22
|
|
|
5
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonoff.d.ts","sourceRoot":"","sources":["../../src/devices/sonoff.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,oBAAoB,EAA8C,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sonoff.d.ts","sourceRoot":"","sources":["../../src/devices/sonoff.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,oBAAoB,EAA8C,MAAM,cAAc,CAAC;AA88BpG,eAAO,MAAM,WAAW,EAAE,oBAAoB,EAwtC7C,CAAC"}
|
package/dist/devices/sonoff.js
CHANGED
|
@@ -86,6 +86,13 @@ const sonoffExtend = {
|
|
|
86
86
|
deviceWorkMode: { ID: 0x0018, type: zigbee_herdsman_1.Zcl.DataType.UINT8 },
|
|
87
87
|
detachRelayMode2: { ID: 0x0019, type: zigbee_herdsman_1.Zcl.DataType.BITMAP8 },
|
|
88
88
|
lackWaterCloseValveTimeout: { ID: 0x5011, type: zigbee_herdsman_1.Zcl.DataType.UINT16 },
|
|
89
|
+
acCurrentCurrentValue: { ID: 0x7004, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
90
|
+
acCurrentVoltageValue: { ID: 0x7005, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
91
|
+
acCurrentPowerValue: { ID: 0x7006, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
92
|
+
outlet_control_protect: { ID: 0x7007, type: zigbee_herdsman_1.Zcl.DataType.UINT8 },
|
|
93
|
+
energyToday: { ID: 0x7009, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
94
|
+
energyMonth: { ID: 0x700a, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
95
|
+
energyYesterday: { ID: 0x700b, type: zigbee_herdsman_1.Zcl.DataType.UINT32 },
|
|
89
96
|
},
|
|
90
97
|
commands: {
|
|
91
98
|
protocolData: { ID: 0x01, parameters: [{ name: "data", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.LIST_UINT8 }] },
|
|
@@ -600,6 +607,265 @@ const sonoffExtend = {
|
|
|
600
607
|
isModernExtend: true,
|
|
601
608
|
};
|
|
602
609
|
},
|
|
610
|
+
overloadProtection: (powerMaxLimit, currentMaxLimit) => {
|
|
611
|
+
const clusterName = "customClusterEwelink";
|
|
612
|
+
const exposes = e
|
|
613
|
+
.composite("overload_protection", "overload_protection", ea.ALL)
|
|
614
|
+
.withDescription("Over load protection, max power and max current are required,other is optional")
|
|
615
|
+
.withFeature(e
|
|
616
|
+
.numeric("max_power", ea.SET)
|
|
617
|
+
.withDescription("max power")
|
|
618
|
+
.withUnit("W")
|
|
619
|
+
.withValueMin(0.1)
|
|
620
|
+
.withValueMax(powerMaxLimit)
|
|
621
|
+
.withValueStep(0.1))
|
|
622
|
+
.withFeature(e.binary("enable_min_power", ea.SET, "ENABLE", "DISABLE").withDescription("Enable/disable lower limit of power overload protection."))
|
|
623
|
+
.withFeature(e
|
|
624
|
+
.numeric("min_power", ea.SET)
|
|
625
|
+
.withDescription("Lower limit of power overload protection")
|
|
626
|
+
.withUnit("W")
|
|
627
|
+
.withValueMin(0.1)
|
|
628
|
+
.withValueMax(powerMaxLimit)
|
|
629
|
+
.withValueStep(0.1))
|
|
630
|
+
.withFeature(e
|
|
631
|
+
.binary("enable_max_voltage", ea.SET, "ENABLE", "DISABLE")
|
|
632
|
+
.withDescription("Enable/disable upper limit of voltage overload protection.."))
|
|
633
|
+
.withFeature(e
|
|
634
|
+
.numeric("max_voltage", ea.SET)
|
|
635
|
+
.withDescription("Upper limit of voltage overload protection.")
|
|
636
|
+
.withUnit("V")
|
|
637
|
+
.withValueMin(165)
|
|
638
|
+
.withValueMax(277)
|
|
639
|
+
.withValueStep(1))
|
|
640
|
+
.withFeature(e
|
|
641
|
+
.binary("enable_min_voltage", ea.SET, "ENABLE", "DISABLE")
|
|
642
|
+
.withDescription("Enable/disable lower limit of voltage overload protection."))
|
|
643
|
+
.withFeature(e
|
|
644
|
+
.numeric("min_voltage", ea.SET)
|
|
645
|
+
.withDescription("Lower limit of voltage overload protection.")
|
|
646
|
+
.withUnit("V")
|
|
647
|
+
.withValueMin(165)
|
|
648
|
+
.withValueMax(277)
|
|
649
|
+
.withValueStep(1))
|
|
650
|
+
.withFeature(e
|
|
651
|
+
.numeric("max_current", ea.SET)
|
|
652
|
+
.withDescription("Upper limit of current overload protection.")
|
|
653
|
+
.withUnit("A")
|
|
654
|
+
.withValueMin(0.1)
|
|
655
|
+
.withValueMax(currentMaxLimit)
|
|
656
|
+
.withValueStep(0.1))
|
|
657
|
+
.withFeature(e
|
|
658
|
+
.binary("enable_min_current", ea.SET, "ENABLE", "DISABLE")
|
|
659
|
+
.withDescription("Enable/disable lower limit of current overload protection."))
|
|
660
|
+
.withFeature(e
|
|
661
|
+
.numeric("min_current", ea.SET)
|
|
662
|
+
.withDescription("Lower limit of current overload protection.")
|
|
663
|
+
.withUnit("A")
|
|
664
|
+
.withValueMin(0.1)
|
|
665
|
+
.withValueMax(currentMaxLimit)
|
|
666
|
+
.withValueStep(0.1));
|
|
667
|
+
const fromZigbee = [
|
|
668
|
+
{
|
|
669
|
+
cluster: "customClusterEwelink",
|
|
670
|
+
type: ["attributeReport", "readResponse"],
|
|
671
|
+
convert: (model, msg, publish, options, meta) => {
|
|
672
|
+
const attributeKey = 0x7003; // attr
|
|
673
|
+
if (attributeKey in msg.data) {
|
|
674
|
+
// "enable_max_voltage": "ENABLE",
|
|
675
|
+
// "enable_min_current": "ENABLE",
|
|
676
|
+
// "enable_min_power": "ENABLE",
|
|
677
|
+
// "enable_min_voltage": "ENABLE",
|
|
678
|
+
// "max_current": 23,
|
|
679
|
+
// "max_power": 23,
|
|
680
|
+
// "max_voltage": 23,
|
|
681
|
+
// "min_current": 23,
|
|
682
|
+
// "min_power": 23,
|
|
683
|
+
// "min_voltage": 23
|
|
684
|
+
// }: value:
|
|
685
|
+
logger_1.logger.debug("attr_value is:", JSON.stringify(msg.data[attributeKey]));
|
|
686
|
+
const buffer = Buffer.from(msg.data[attributeKey], "binary");
|
|
687
|
+
const hexString = buffer.toString("hex").toUpperCase();
|
|
688
|
+
console.log(`Hex: ${hexString}`);
|
|
689
|
+
let index = 0;
|
|
690
|
+
let enableMaxVoltageBuffer = "DISABLE";
|
|
691
|
+
let enableMinCurrentBuffer = "DISABLE";
|
|
692
|
+
let enableMinPowerBuffer = "DISABLE";
|
|
693
|
+
let enableMinVoltageBuffer = "DISABLE";
|
|
694
|
+
const tag = buffer[index++];
|
|
695
|
+
const len = buffer[index++];
|
|
696
|
+
if (buffer[index++] === 3) {
|
|
697
|
+
enableMinCurrentBuffer = "ENABLE";
|
|
698
|
+
}
|
|
699
|
+
const voltage_set_flag = buffer[index++];
|
|
700
|
+
if (voltage_set_flag & 0x01) {
|
|
701
|
+
enableMaxVoltageBuffer = "ENABLE";
|
|
702
|
+
}
|
|
703
|
+
if (voltage_set_flag & 0x02) {
|
|
704
|
+
enableMinVoltageBuffer = "ENABLE";
|
|
705
|
+
}
|
|
706
|
+
if (buffer[index++] === 3) {
|
|
707
|
+
enableMinPowerBuffer = "ENABLE";
|
|
708
|
+
}
|
|
709
|
+
let minCurrentBuffer = 0;
|
|
710
|
+
let maxVoltageBuffer = 0;
|
|
711
|
+
let minVoltageBuffer = 0;
|
|
712
|
+
let maxPowerBuffer = 0;
|
|
713
|
+
let minPowerBuffer = 0;
|
|
714
|
+
let maxCurrentBuffer = buffer[index++];
|
|
715
|
+
maxCurrentBuffer |= buffer[index++] << 8;
|
|
716
|
+
maxCurrentBuffer |= buffer[index++] << 16;
|
|
717
|
+
maxCurrentBuffer |= buffer[index++] << 24;
|
|
718
|
+
maxCurrentBuffer /= 1000;
|
|
719
|
+
if (enableMinCurrentBuffer === "ENABLE") {
|
|
720
|
+
minCurrentBuffer = buffer[index++];
|
|
721
|
+
minCurrentBuffer |= buffer[index++] << 8;
|
|
722
|
+
minCurrentBuffer |= buffer[index++] << 16;
|
|
723
|
+
minCurrentBuffer |= buffer[index++] << 24;
|
|
724
|
+
minCurrentBuffer /= 1000;
|
|
725
|
+
}
|
|
726
|
+
if (enableMaxVoltageBuffer === "ENABLE") {
|
|
727
|
+
for (let i = 0; i < 4; i++) {
|
|
728
|
+
logger_1.logger.debug("max voltage is:", JSON.stringify(buffer[index + i]));
|
|
729
|
+
}
|
|
730
|
+
logger_1.logger.debug("index is", JSON.stringify(index));
|
|
731
|
+
maxVoltageBuffer = buffer[index++];
|
|
732
|
+
maxVoltageBuffer |= buffer[index++] << 8;
|
|
733
|
+
maxVoltageBuffer |= buffer[index++] << 16;
|
|
734
|
+
maxVoltageBuffer |= buffer[index++] << 24;
|
|
735
|
+
maxVoltageBuffer /= 1000;
|
|
736
|
+
}
|
|
737
|
+
if (enableMinVoltageBuffer === "ENABLE") {
|
|
738
|
+
minVoltageBuffer = buffer[index++];
|
|
739
|
+
minVoltageBuffer |= buffer[index++] << 8;
|
|
740
|
+
minVoltageBuffer |= buffer[index++] << 16;
|
|
741
|
+
minVoltageBuffer |= buffer[index++] << 24;
|
|
742
|
+
minVoltageBuffer /= 1000;
|
|
743
|
+
}
|
|
744
|
+
maxPowerBuffer = buffer[index++];
|
|
745
|
+
maxPowerBuffer |= buffer[index++] << 8;
|
|
746
|
+
maxPowerBuffer |= buffer[index++] << 16;
|
|
747
|
+
maxPowerBuffer |= buffer[index++] << 24;
|
|
748
|
+
maxPowerBuffer /= 1000;
|
|
749
|
+
if (enableMinPowerBuffer === "ENABLE") {
|
|
750
|
+
minPowerBuffer = buffer[index++];
|
|
751
|
+
minPowerBuffer |= buffer[index++] << 8;
|
|
752
|
+
minPowerBuffer |= buffer[index++] << 16;
|
|
753
|
+
minPowerBuffer |= buffer[index++] << 24;
|
|
754
|
+
minPowerBuffer /= 1000;
|
|
755
|
+
}
|
|
756
|
+
return {
|
|
757
|
+
overload_protection: {
|
|
758
|
+
enable_max_voltage: enableMaxVoltageBuffer,
|
|
759
|
+
enable_min_current: enableMinCurrentBuffer,
|
|
760
|
+
enable_min_power: enableMinPowerBuffer,
|
|
761
|
+
enable_min_voltage: enableMinPowerBuffer,
|
|
762
|
+
max_current: maxCurrentBuffer,
|
|
763
|
+
max_power: maxPowerBuffer,
|
|
764
|
+
max_voltage: maxVoltageBuffer,
|
|
765
|
+
min_current: minCurrentBuffer,
|
|
766
|
+
min_power: minPowerBuffer,
|
|
767
|
+
min_voltage: minVoltageBuffer,
|
|
768
|
+
},
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
},
|
|
773
|
+
];
|
|
774
|
+
const toZigbee = [
|
|
775
|
+
{
|
|
776
|
+
key: ["overload_protection"],
|
|
777
|
+
convertSet: async (entity, key, value, meta) => {
|
|
778
|
+
logger_1.logger.debug("value:", JSON.stringify(value, null, 2)); // 将 value 转换为格式化的 JSON 字符串
|
|
779
|
+
const maxC = 1000 * value["max_current"];
|
|
780
|
+
const minC = 1000 * value["min_current"];
|
|
781
|
+
const maxV = 1000 * value["max_voltage"];
|
|
782
|
+
const minV = 1000 * value["min_voltage"];
|
|
783
|
+
const maxP = 1000 * value["max_power"];
|
|
784
|
+
const minP = 1000 * value["min_power"];
|
|
785
|
+
const enMinC = value["enable_min_current"];
|
|
786
|
+
const enMaxV = value["enable_max_voltage"];
|
|
787
|
+
const enMinV = value["enable_min_voltage"];
|
|
788
|
+
const enMinP = value["enable_min_power"];
|
|
789
|
+
const params = { maxC, minC, maxV, minV, maxP, minP, enMinC, enMaxV, enMinV, enMinP };
|
|
790
|
+
logger_1.logger.debug("value:", JSON.stringify(params));
|
|
791
|
+
const payloadValue = [];
|
|
792
|
+
let index = 0;
|
|
793
|
+
const length = 0;
|
|
794
|
+
payloadValue[index++] = 0;
|
|
795
|
+
payloadValue[index++] = 0x04;
|
|
796
|
+
payloadValue[index++] = 27;
|
|
797
|
+
payloadValue[index++] = 1;
|
|
798
|
+
payloadValue[index++] = 0;
|
|
799
|
+
payloadValue[index++] = 1;
|
|
800
|
+
payloadValue[index++] = maxC & 0xff;
|
|
801
|
+
payloadValue[index++] = (maxC >> 8) & 0xff;
|
|
802
|
+
payloadValue[index++] = (maxC >> 16) & 0xff;
|
|
803
|
+
payloadValue[index++] = (maxC >> 24) & 0xff;
|
|
804
|
+
if (enMinC === "ENABLE") {
|
|
805
|
+
payloadValue[3] |= 2;
|
|
806
|
+
payloadValue[index++] = minC & 0xff;
|
|
807
|
+
payloadValue[index++] = (minC >> 8) & 0xff;
|
|
808
|
+
payloadValue[index++] = (minC >> 16) & 0xff;
|
|
809
|
+
payloadValue[index++] = (minC >> 24) & 0xff;
|
|
810
|
+
}
|
|
811
|
+
if (enMaxV === "ENABLE") {
|
|
812
|
+
payloadValue[4] |= 1;
|
|
813
|
+
payloadValue[index++] = maxV & 0xff;
|
|
814
|
+
payloadValue[index++] = (maxV >> 8) & 0xff;
|
|
815
|
+
payloadValue[index++] = (maxV >> 16) & 0xff;
|
|
816
|
+
payloadValue[index++] = (maxV >> 24) & 0xff;
|
|
817
|
+
}
|
|
818
|
+
if (enMinV === "ENABLE") {
|
|
819
|
+
payloadValue[4] |= 2;
|
|
820
|
+
payloadValue[index++] = minV & 0xff;
|
|
821
|
+
payloadValue[index++] = (minV >> 8) & 0xff;
|
|
822
|
+
payloadValue[index++] = (minV >> 16) & 0xff;
|
|
823
|
+
payloadValue[index++] = (minV >> 24) & 0xff;
|
|
824
|
+
}
|
|
825
|
+
payloadValue[index++] = maxP & 0xff;
|
|
826
|
+
payloadValue[index++] = (maxP >> 8) & 0xff;
|
|
827
|
+
payloadValue[index++] = (maxP >> 16) & 0xff;
|
|
828
|
+
payloadValue[index++] = (maxP >> 24) & 0xff;
|
|
829
|
+
if (enMinP === "ENABLE") {
|
|
830
|
+
payloadValue[5] |= 2;
|
|
831
|
+
payloadValue[index++] = minP & 0xff;
|
|
832
|
+
payloadValue[index++] = (minP >> 8) & 0xff;
|
|
833
|
+
payloadValue[index++] = (minP >> 16) & 0xff;
|
|
834
|
+
payloadValue[index++] = (minP >> 24) & 0xff;
|
|
835
|
+
}
|
|
836
|
+
payloadValue[0] = index - 1;
|
|
837
|
+
payloadValue[2] = payloadValue[0] - 2;
|
|
838
|
+
if (payloadValue[3] === 3) {
|
|
839
|
+
if (minC >= maxC) {
|
|
840
|
+
throw new Error("Invalid input: maximum current must be greater than the minimum current ");
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
if (payloadValue[4] === 3) {
|
|
844
|
+
if (minV >= maxV) {
|
|
845
|
+
throw new Error("Invalid input: maximum voltage must be greater than the minimum voltage ");
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
if (payloadValue[5] === 3) {
|
|
849
|
+
if (minP >= maxP) {
|
|
850
|
+
throw new Error("Invalid input: maximum power must be greater than the minimum power ");
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
const payload = { [0x7003]: { value: payloadValue, type: 0x42 } };
|
|
854
|
+
await entity.write("customClusterEwelink", payload, defaultResponseOptions);
|
|
855
|
+
return { state: { [key]: value } };
|
|
856
|
+
},
|
|
857
|
+
convertGet: async (entity, key, meta) => {
|
|
858
|
+
await entity.read("customClusterEwelink", [0x7003], defaultResponseOptions);
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
];
|
|
862
|
+
return {
|
|
863
|
+
exposes: [exposes],
|
|
864
|
+
toZigbee,
|
|
865
|
+
fromZigbee,
|
|
866
|
+
isModernExtend: true,
|
|
867
|
+
};
|
|
868
|
+
},
|
|
603
869
|
};
|
|
604
870
|
exports.definitions = [
|
|
605
871
|
{
|
|
@@ -1469,18 +1735,96 @@ exports.definitions = [
|
|
|
1469
1735
|
},
|
|
1470
1736
|
},
|
|
1471
1737
|
{
|
|
1472
|
-
zigbeeModel: ["S60ZBTPF"],
|
|
1738
|
+
zigbeeModel: ["S60ZBTPF", "S60ZBTPG"],
|
|
1473
1739
|
model: "S60ZBTPF",
|
|
1474
1740
|
vendor: "SONOFF",
|
|
1475
1741
|
description: "Zigbee smart plug",
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1742
|
+
whiteLabel: [{ vendor: "SONOFF", model: "S60ZBTPG", fingerprint: [{ modelID: "S60ZBTPG" }] }],
|
|
1743
|
+
extend: [
|
|
1744
|
+
m.onOff({
|
|
1745
|
+
powerOnBehavior: true,
|
|
1746
|
+
skipDuplicateTransaction: true,
|
|
1747
|
+
configureReporting: true,
|
|
1748
|
+
}),
|
|
1749
|
+
// m.electricityMeter({current: {divisor: 100}, voltage: {divisor: 100}, power: {divisor: 1}, energy: {divisor: 1000}}),
|
|
1750
|
+
sonoffExtend.addCustomClusterEwelink(),
|
|
1751
|
+
m.numeric({
|
|
1752
|
+
name: "current",
|
|
1753
|
+
cluster: "customClusterEwelink",
|
|
1754
|
+
attribute: "acCurrentCurrentValue",
|
|
1755
|
+
description: "Current",
|
|
1756
|
+
unit: "A",
|
|
1757
|
+
scale: 1000,
|
|
1758
|
+
access: "STATE_GET",
|
|
1759
|
+
}),
|
|
1760
|
+
m.numeric({
|
|
1761
|
+
name: "voltage",
|
|
1762
|
+
cluster: "customClusterEwelink",
|
|
1763
|
+
attribute: "acCurrentVoltageValue",
|
|
1764
|
+
description: "Voltage",
|
|
1765
|
+
unit: "V",
|
|
1766
|
+
scale: 1000,
|
|
1767
|
+
access: "STATE_GET",
|
|
1768
|
+
}),
|
|
1769
|
+
m.numeric({
|
|
1770
|
+
name: "power",
|
|
1771
|
+
cluster: "customClusterEwelink",
|
|
1772
|
+
attribute: "acCurrentPowerValue",
|
|
1773
|
+
description: "Active power",
|
|
1774
|
+
unit: "W",
|
|
1775
|
+
scale: 1000,
|
|
1776
|
+
access: "STATE_GET",
|
|
1777
|
+
}),
|
|
1778
|
+
m.numeric({
|
|
1779
|
+
name: "energy_yesterday",
|
|
1780
|
+
cluster: "customClusterEwelink",
|
|
1781
|
+
attribute: "energyYesterday",
|
|
1782
|
+
description: "Electricity consumption for the yesterday",
|
|
1783
|
+
unit: "kWh",
|
|
1784
|
+
scale: 1000,
|
|
1785
|
+
access: "STATE_GET",
|
|
1786
|
+
}),
|
|
1787
|
+
m.numeric({
|
|
1788
|
+
name: "energy_today",
|
|
1789
|
+
cluster: "customClusterEwelink",
|
|
1790
|
+
attribute: "energyToday",
|
|
1791
|
+
description: "Electricity consumption for the day",
|
|
1792
|
+
unit: "kWh",
|
|
1793
|
+
scale: 1000,
|
|
1794
|
+
access: "STATE_GET",
|
|
1795
|
+
}),
|
|
1796
|
+
m.numeric({
|
|
1797
|
+
name: "energy_month",
|
|
1798
|
+
cluster: "customClusterEwelink",
|
|
1799
|
+
attribute: "energyMonth",
|
|
1800
|
+
description: "Electricity consumption for the month",
|
|
1801
|
+
unit: "kWh",
|
|
1802
|
+
scale: 1000,
|
|
1803
|
+
access: "STATE_GET",
|
|
1804
|
+
}),
|
|
1805
|
+
sonoffExtend.inchingControlSet(),
|
|
1806
|
+
m.binary({
|
|
1807
|
+
name: "outlet_control_protect",
|
|
1808
|
+
cluster: "customClusterEwelink",
|
|
1809
|
+
attribute: "outlet_control_protect",
|
|
1810
|
+
description: "Outlet overload protection Settings",
|
|
1811
|
+
valueOff: [false, 0],
|
|
1812
|
+
valueOn: [true, 1],
|
|
1813
|
+
}),
|
|
1814
|
+
sonoffExtend.overloadProtection(4000, 17),
|
|
1815
|
+
],
|
|
1816
|
+
ota: true,
|
|
1817
|
+
configure: async (device, coordinatorEndpoint) => {
|
|
1818
|
+
const endpoint = device.getEndpoint(1);
|
|
1819
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ["genOnOff", "customClusterEwelink"]);
|
|
1820
|
+
await reporting.onOff(endpoint, { min: 1, max: 1800, change: 0 });
|
|
1821
|
+
await endpoint.read("customClusterEwelink", ["acCurrentCurrentValue", "acCurrentVoltageValue", "acCurrentPowerValue", 0x7003, "outlet_control_protect"], defaultResponseOptions);
|
|
1822
|
+
await endpoint.configureReporting("customClusterEwelink", [
|
|
1823
|
+
{ attribute: "energyMonth", minimumReportInterval: 60, maximumReportInterval: 3600, reportableChange: 50 },
|
|
1824
|
+
{ attribute: "energyYesterday", minimumReportInterval: 60, maximumReportInterval: 3600, reportableChange: 50 },
|
|
1825
|
+
{ attribute: "energyToday", minimumReportInterval: 60, maximumReportInterval: 3600, reportableChange: 50 },
|
|
1826
|
+
]);
|
|
1827
|
+
},
|
|
1484
1828
|
},
|
|
1485
1829
|
{
|
|
1486
1830
|
zigbeeModel: ["SWV"],
|