zigbee-herdsman-converters 15.0.13 → 15.0.14
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/converters/fromZigbee.js +1 -1
- package/converters/toZigbee.js +2 -0
- package/devices/centralite.js +16 -0
- package/devices/heiman.js +1 -1
- package/devices/iris.js +0 -16
- package/devices/legrand.js +3 -1
- package/devices/philips.js +14 -7
- package/devices/sinope.js +64 -22
- package/devices/xiaomi.js +29 -9
- package/lib/ota/common.js +4 -4
- package/package.json +1 -1
package/converters/fromZigbee.js
CHANGED
package/converters/toZigbee.js
CHANGED
|
@@ -2139,6 +2139,7 @@ const converters = {
|
|
|
2139
2139
|
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
|
|
2140
2140
|
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
|
|
2141
2141
|
'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
|
|
2142
|
+
'WS-USC02', 'WS-USC04',
|
|
2142
2143
|
].includes(meta.mapped.model)) {
|
|
2143
2144
|
await entity.write('aqaraOpple', {0x0201: {value: value ? 1 : 0, type: 0x10}}, manufacturerOptions.xiaomi);
|
|
2144
2145
|
} else if (['ZNCZ02LM', 'QBCZ11LM', 'LLKZMK11LM'].includes(meta.mapped.model)) {
|
|
@@ -2163,6 +2164,7 @@ const converters = {
|
|
|
2163
2164
|
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
|
|
2164
2165
|
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
|
|
2165
2166
|
'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
|
|
2167
|
+
'WS-USC02', 'WS-USC04',
|
|
2166
2168
|
].includes(meta.mapped.model)) {
|
|
2167
2169
|
await entity.read('aqaraOpple', [0x0201]);
|
|
2168
2170
|
} else if (['ZNCZ02LM', 'QBCZ11LM', 'ZNCZ11LM'].includes(meta.mapped.model)) {
|
package/devices/centralite.js
CHANGED
|
@@ -340,4 +340,20 @@ module.exports = [
|
|
|
340
340
|
await reporting.activePower(endpoint, {change: 2});
|
|
341
341
|
},
|
|
342
342
|
},
|
|
343
|
+
{
|
|
344
|
+
zigbeeModel: ['3315-Geu'],
|
|
345
|
+
model: '3315-Geu',
|
|
346
|
+
vendor: 'Centralite',
|
|
347
|
+
description: 'Water sensor',
|
|
348
|
+
fromZigbee: [fz.temperature, fz.ias_water_leak_alarm_1, fz.battery],
|
|
349
|
+
exposes: [e.temperature(), e.water_leak(), e.battery_low(), e.tamper(), e.battery()],
|
|
350
|
+
toZigbee: [],
|
|
351
|
+
meta: {battery: {voltageToPercentage: '3V_2500'}},
|
|
352
|
+
configure: async (device, coordinatorEndpoint, logger) => {
|
|
353
|
+
const endpoint = device.getEndpoint(1);
|
|
354
|
+
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
|
|
355
|
+
await reporting.temperature(endpoint);
|
|
356
|
+
await reporting.batteryVoltage(endpoint);
|
|
357
|
+
},
|
|
358
|
+
},
|
|
343
359
|
];
|
package/devices/heiman.js
CHANGED
package/devices/iris.js
CHANGED
|
@@ -177,20 +177,4 @@ module.exports = [
|
|
|
177
177
|
await reporting.batteryVoltage(endpoint);
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
|
-
{
|
|
181
|
-
zigbeeModel: ['3315-Geu'],
|
|
182
|
-
model: '3315-Geu',
|
|
183
|
-
vendor: 'Iris',
|
|
184
|
-
description: 'Water sensor',
|
|
185
|
-
fromZigbee: [fz.temperature, fz.ias_water_leak_alarm_1, fz.battery],
|
|
186
|
-
exposes: [e.temperature(), e.water_leak(), e.battery_low(), e.tamper(), e.battery()],
|
|
187
|
-
toZigbee: [],
|
|
188
|
-
meta: {battery: {voltageToPercentage: '3V_2500'}},
|
|
189
|
-
configure: async (device, coordinatorEndpoint, logger) => {
|
|
190
|
-
const endpoint = device.getEndpoint(1);
|
|
191
|
-
await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
|
|
192
|
-
await reporting.temperature(endpoint);
|
|
193
|
-
await reporting.batteryVoltage(endpoint);
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
180
|
];
|
package/devices/legrand.js
CHANGED
|
@@ -130,7 +130,9 @@ module.exports = [
|
|
|
130
130
|
await reporting.bind(endpoint, coordinatorEndpoint, ['genBinaryInput', 'closuresWindowCovering', 'genIdentify']);
|
|
131
131
|
await reporting.currentPositionLiftPercentage(endpoint);
|
|
132
132
|
},
|
|
133
|
-
exposes: [e.cover_position()
|
|
133
|
+
exposes: [e.cover_position(),
|
|
134
|
+
exposes.binary('led_in_dark', ea.ALL, 'ON', 'OFF').withDescription(`Enables the LED when the power socket is turned off,
|
|
135
|
+
allowing to see it in the dark`)],
|
|
134
136
|
},
|
|
135
137
|
{
|
|
136
138
|
// swbuildid 001a requires coverInverted: https://github.com/Koenkk/zigbee2mqtt/issues/15101#issuecomment-1356787490
|
package/devices/philips.js
CHANGED
|
@@ -458,7 +458,7 @@ module.exports = [
|
|
|
458
458
|
model: '929002994901',
|
|
459
459
|
vendor: 'Philips',
|
|
460
460
|
description: 'Hue gradient lightstrip',
|
|
461
|
-
extend: hueExtend.
|
|
461
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
462
462
|
},
|
|
463
463
|
{
|
|
464
464
|
zigbeeModel: ['929003045401'],
|
|
@@ -789,6 +789,13 @@ module.exports = [
|
|
|
789
789
|
description: 'Hue white E12',
|
|
790
790
|
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
|
|
791
791
|
},
|
|
792
|
+
{
|
|
793
|
+
zigbeeModel: ['LTE004'],
|
|
794
|
+
model: '9290031451',
|
|
795
|
+
vendor: 'Philips',
|
|
796
|
+
description: 'Hue white ambiance filament E12 with Bluetooth',
|
|
797
|
+
extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
|
|
798
|
+
},
|
|
792
799
|
{
|
|
793
800
|
zigbeeModel: ['LWA007'],
|
|
794
801
|
model: '929002277501',
|
|
@@ -1960,14 +1967,14 @@ module.exports = [
|
|
|
1960
1967
|
model: '915005986901',
|
|
1961
1968
|
vendor: 'Philips',
|
|
1962
1969
|
description: 'Hue White and color ambiance Gradient Signe table lamp (white)',
|
|
1963
|
-
extend: hueExtend.
|
|
1970
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
1964
1971
|
},
|
|
1965
1972
|
{
|
|
1966
1973
|
zigbeeModel: ['915005987001'],
|
|
1967
1974
|
model: '915005987001',
|
|
1968
1975
|
vendor: 'Philips',
|
|
1969
1976
|
description: 'Hue White and color ambiance Gradient Signe table lamp (black)',
|
|
1970
|
-
extend: hueExtend.
|
|
1977
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
1971
1978
|
},
|
|
1972
1979
|
{
|
|
1973
1980
|
zigbeeModel: ['5060730P7_01', '5060730P7_02', '5060730P7_03', '5060730P7_04', '5060730P7_05'],
|
|
@@ -2721,21 +2728,21 @@ module.exports = [
|
|
|
2721
2728
|
model: '929002422702',
|
|
2722
2729
|
vendor: 'Philips',
|
|
2723
2730
|
description: 'Hue Play gradient lightstrip 55',
|
|
2724
|
-
extend: hueExtend.
|
|
2731
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
2725
2732
|
},
|
|
2726
2733
|
{
|
|
2727
2734
|
zigbeeModel: ['LCX002'],
|
|
2728
2735
|
model: '929002422801',
|
|
2729
2736
|
vendor: 'Philips',
|
|
2730
2737
|
description: 'Hue Play gradient lightstrip 65',
|
|
2731
|
-
extend: hueExtend.
|
|
2738
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
2732
2739
|
},
|
|
2733
2740
|
{
|
|
2734
2741
|
zigbeeModel: ['LCX003'],
|
|
2735
2742
|
model: '929002422901',
|
|
2736
2743
|
vendor: 'Philips',
|
|
2737
2744
|
description: 'Hue Play gradient lightstrip 75',
|
|
2738
|
-
extend: hueExtend.
|
|
2745
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color_gradient({colorTempRange: [153, 500]}),
|
|
2739
2746
|
},
|
|
2740
2747
|
{
|
|
2741
2748
|
zigbeeModel: ['929003099301'],
|
|
@@ -2935,7 +2942,7 @@ module.exports = [
|
|
|
2935
2942
|
model: '929002966501',
|
|
2936
2943
|
vendor: 'Philips',
|
|
2937
2944
|
description: 'Hue White and Color Ambiance Surimu rectangle panel',
|
|
2938
|
-
extend: hueExtend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
|
|
2945
|
+
extend: hueExtend.light_onoff_brightness_colortemp_color({disableHueEffects: false, colorTempRange: [153, 500]}),
|
|
2939
2946
|
},
|
|
2940
2947
|
{
|
|
2941
2948
|
zigbeeModel: ['5060930P7_01', '5060930P7_02', '5060930P7_03', '5060930P7_04'],
|
package/devices/sinope.js
CHANGED
|
@@ -155,6 +155,18 @@ const fzLocal = {
|
|
|
155
155
|
if (msg.data.hasOwnProperty('pumpProtection')) {
|
|
156
156
|
result.pump_protection = msg.data['pumpProtection'] == 1 ? 'ON' : 'OFF';
|
|
157
157
|
}
|
|
158
|
+
if (msg.data.hasOwnProperty('dimmerTimmer')) {
|
|
159
|
+
result.timer_seconds = msg.data['dimmerTimmer'];
|
|
160
|
+
}
|
|
161
|
+
if (msg.data.hasOwnProperty('ledIntensityOn')) {
|
|
162
|
+
result.led_intensity_on = msg.data['ledIntensityOn'];
|
|
163
|
+
}
|
|
164
|
+
if (msg.data.hasOwnProperty('ledIntensityOff')) {
|
|
165
|
+
result.led_intensity_off = msg.data['ledIntensityOff'];
|
|
166
|
+
}
|
|
167
|
+
if (msg.data.hasOwnProperty('minimumBrightness')) {
|
|
168
|
+
result.minimum_brightness = msg.data['minimumBrightness'];
|
|
169
|
+
}
|
|
158
170
|
return result;
|
|
159
171
|
},
|
|
160
172
|
},
|
|
@@ -380,6 +392,10 @@ const tzLocal = {
|
|
|
380
392
|
if (value >= 0 && value <= 100) {
|
|
381
393
|
await entity.write('manuSpecificSinope', {ledIntensityOn: value});
|
|
382
394
|
}
|
|
395
|
+
return {readAfterWriteTime: 250, state: {ledIntensityOn: value}};
|
|
396
|
+
},
|
|
397
|
+
convertGet: async (entity, key, meta) => {
|
|
398
|
+
await entity.read('manuSpecificSinope', ['ledIntensityOn']);
|
|
383
399
|
},
|
|
384
400
|
},
|
|
385
401
|
led_intensity_off: {
|
|
@@ -389,6 +405,10 @@ const tzLocal = {
|
|
|
389
405
|
if (value >= 0 && value <= 100) {
|
|
390
406
|
await entity.write('manuSpecificSinope', {ledIntensityOff: value});
|
|
391
407
|
}
|
|
408
|
+
return {readAfterWriteTime: 250, state: {ledIntensityOff: value}};
|
|
409
|
+
},
|
|
410
|
+
convertGet: async (entity, key, meta) => {
|
|
411
|
+
await entity.read('manuSpecificSinope', ['ledIntensityOff']);
|
|
392
412
|
},
|
|
393
413
|
},
|
|
394
414
|
led_color_on: {
|
|
@@ -422,6 +442,23 @@ const tzLocal = {
|
|
|
422
442
|
if (value >= 0 && value <= 3000) {
|
|
423
443
|
await entity.write('manuSpecificSinope', {minimumBrightness: value});
|
|
424
444
|
}
|
|
445
|
+
return {readAfterWriteTime: 250, state: {minimumBrightness: value}};
|
|
446
|
+
},
|
|
447
|
+
convertGet: async (entity, key, meta) => {
|
|
448
|
+
await entity.read('manuSpecificSinope', ['minimumBrightness']);
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
timer_seconds: {
|
|
452
|
+
// DM2500ZB and SW2500ZB
|
|
453
|
+
key: ['timer_seconds'],
|
|
454
|
+
convertSet: async (entity, key, value, meta) => {
|
|
455
|
+
if (value >= 0 && value <= 10800) {
|
|
456
|
+
await entity.write('manuSpecificSinope', {dimmerTimmer: value});
|
|
457
|
+
}
|
|
458
|
+
return {readAfterWriteTime: 250, state: {dimmerTimmer: value}};
|
|
459
|
+
},
|
|
460
|
+
convertGet: async (entity, key, meta) => {
|
|
461
|
+
await entity.read('manuSpecificSinope', ['dimmerTimmer']);
|
|
425
462
|
},
|
|
426
463
|
},
|
|
427
464
|
};
|
|
@@ -819,22 +856,25 @@ module.exports = [
|
|
|
819
856
|
model: 'SW2500ZB',
|
|
820
857
|
vendor: 'Sinopé',
|
|
821
858
|
description: 'Zigbee smart light switch',
|
|
822
|
-
fromZigbee: [fz.on_off, fz.electrical_measurement],
|
|
823
|
-
toZigbee: [tz.on_off, tzLocal.
|
|
859
|
+
fromZigbee: [fz.on_off, fz.electrical_measurement, fzLocal.sinope],
|
|
860
|
+
toZigbee: [tz.on_off, tzLocal.timer_seconds, tzLocal.led_intensity_on, tzLocal.led_intensity_off,
|
|
861
|
+
tzLocal.led_color_on, tzLocal.led_color_off],
|
|
824
862
|
exposes: [e.switch(),
|
|
825
|
-
exposes.numeric('
|
|
863
|
+
exposes.numeric('timer_seconds', ea.ALL).withValueMin(0).withValueMax(10800)
|
|
864
|
+
.withDescription('Automatically turn off load after x seconds'),
|
|
865
|
+
exposes.numeric('led_intensity_on', ea.ALL).withValueMin(0).withValueMax(100)
|
|
826
866
|
.withDescription('Control status LED intensity when load ON'),
|
|
827
|
-
exposes.numeric('led_intensity_off', ea.
|
|
867
|
+
exposes.numeric('led_intensity_off', ea.ALL).withValueMin(0).withValueMax(100)
|
|
828
868
|
.withDescription('Control status LED intensity when load OFF'),
|
|
829
869
|
exposes.composite('led_color_on', 'led_color_on')
|
|
830
|
-
.withFeature(exposes.numeric('r', ea.
|
|
831
|
-
.withFeature(exposes.numeric('g', ea.
|
|
832
|
-
.withFeature(exposes.numeric('b', ea.
|
|
870
|
+
.withFeature(exposes.numeric('r', ea.SET))
|
|
871
|
+
.withFeature(exposes.numeric('g', ea.SET))
|
|
872
|
+
.withFeature(exposes.numeric('b', ea.SET))
|
|
833
873
|
.withDescription('Control status LED color when load ON'),
|
|
834
874
|
exposes.composite('led_color_off', 'led_color_off')
|
|
835
|
-
.withFeature(exposes.numeric('r', ea.
|
|
836
|
-
.withFeature(exposes.numeric('g', ea.
|
|
837
|
-
.withFeature(exposes.numeric('b', ea.
|
|
875
|
+
.withFeature(exposes.numeric('r', ea.SET))
|
|
876
|
+
.withFeature(exposes.numeric('g', ea.SET))
|
|
877
|
+
.withFeature(exposes.numeric('b', ea.SET))
|
|
838
878
|
.withDescription('Control status LED color when load OFF')],
|
|
839
879
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
840
880
|
const endpoint = device.getEndpoint(1);
|
|
@@ -848,25 +888,27 @@ module.exports = [
|
|
|
848
888
|
model: 'DM2500ZB',
|
|
849
889
|
vendor: 'Sinopé',
|
|
850
890
|
description: 'Zigbee smart dimmer',
|
|
851
|
-
fromZigbee: [fz.on_off, fz.brightness, fz.electrical_measurement],
|
|
852
|
-
toZigbee: [tz.light_onoff_brightness, tzLocal.
|
|
853
|
-
tzLocal.led_color_on, tzLocal.led_color_off],
|
|
891
|
+
fromZigbee: [fz.on_off, fz.brightness, fz.electrical_measurement, fzLocal.sinope],
|
|
892
|
+
toZigbee: [tz.light_onoff_brightness, tzLocal.timer_seconds, tzLocal.led_intensity_on, tzLocal.led_intensity_off,
|
|
893
|
+
tzLocal.minimum_brightness, tzLocal.led_color_on, tzLocal.led_color_off],
|
|
854
894
|
exposes: [e.light_brightness(),
|
|
855
|
-
exposes.numeric('
|
|
895
|
+
exposes.numeric('timer_seconds', ea.ALL).withValueMin(0).withValueMax(10800)
|
|
896
|
+
.withDescription('Automatically turn off load after x seconds'),
|
|
897
|
+
exposes.numeric('led_intensity_on', ea.ALL).withValueMin(0).withValueMax(100)
|
|
856
898
|
.withDescription('Control status LED when load ON'),
|
|
857
|
-
exposes.numeric('led_intensity_off', ea.
|
|
899
|
+
exposes.numeric('led_intensity_off', ea.ALL).withValueMin(0).withValueMax(100)
|
|
858
900
|
.withDescription('Control status LED when load OFF'),
|
|
859
|
-
exposes.numeric('minimum_brightness', ea.
|
|
901
|
+
exposes.numeric('minimum_brightness', ea.ALL).withValueMin(0).withValueMax(3000)
|
|
860
902
|
.withDescription('Control minimum dimmer brightness'),
|
|
861
903
|
exposes.composite('led_color_on', 'led_color_on')
|
|
862
|
-
.withFeature(exposes.numeric('r', ea.
|
|
863
|
-
.withFeature(exposes.numeric('g', ea.
|
|
864
|
-
.withFeature(exposes.numeric('b', ea.
|
|
904
|
+
.withFeature(exposes.numeric('r', ea.SET))
|
|
905
|
+
.withFeature(exposes.numeric('g', ea.SET))
|
|
906
|
+
.withFeature(exposes.numeric('b', ea.SET))
|
|
865
907
|
.withDescription('Control status LED color when load ON'),
|
|
866
908
|
exposes.composite('led_color_off', 'led_color_off')
|
|
867
|
-
.withFeature(exposes.numeric('r', ea.
|
|
868
|
-
.withFeature(exposes.numeric('g', ea.
|
|
869
|
-
.withFeature(exposes.numeric('b', ea.
|
|
909
|
+
.withFeature(exposes.numeric('r', ea.SET))
|
|
910
|
+
.withFeature(exposes.numeric('g', ea.SET))
|
|
911
|
+
.withFeature(exposes.numeric('b', ea.SET))
|
|
870
912
|
.withDescription('Control status LED color when load OFF')],
|
|
871
913
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
872
914
|
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
|
package/devices/xiaomi.js
CHANGED
|
@@ -710,7 +710,9 @@ module.exports = [
|
|
|
710
710
|
vendor: 'Xiaomi',
|
|
711
711
|
description: 'Aqara smart wall switch (no neutral, double rocker)',
|
|
712
712
|
fromZigbee: [fz.on_off, fz.xiaomi_multistate_action, fz.aqara_opple],
|
|
713
|
-
toZigbee: [
|
|
713
|
+
toZigbee: [
|
|
714
|
+
tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_flip_indicator_light,
|
|
715
|
+
tz.xiaomi_switch_power_outage_memory, tz.aqara_switch_mode_switch],
|
|
714
716
|
exposes: [
|
|
715
717
|
e.switch().withEndpoint('top'),
|
|
716
718
|
e.switch().withEndpoint('bottom'),
|
|
@@ -728,6 +730,7 @@ module.exports = [
|
|
|
728
730
|
e.power_outage_count(),
|
|
729
731
|
e.device_temperature().withAccess(ea.STATE),
|
|
730
732
|
e.flip_indicator_light(),
|
|
733
|
+
e.power_outage_memory(),
|
|
731
734
|
e.action(['single_top', 'single_bottom', 'single_both', 'double_top', 'double_bottom', 'double_both'])],
|
|
732
735
|
meta: {multiEndpoint: true},
|
|
733
736
|
endpoint: (device) => {
|
|
@@ -759,19 +762,36 @@ module.exports = [
|
|
|
759
762
|
model: 'WS-USC04',
|
|
760
763
|
vendor: 'Xiaomi',
|
|
761
764
|
description: 'Aqara smart wall switch (neutral, double rocker)',
|
|
762
|
-
|
|
763
|
-
|
|
765
|
+
fromZigbee: [fz.on_off, fz.xiaomi_power, fz.xiaomi_multistate_action, fz.aqara_opple],
|
|
766
|
+
toZigbee: [
|
|
767
|
+
tz.on_off, tz.xiaomi_power, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_switch_power_outage_memory,
|
|
768
|
+
tz.xiaomi_flip_indicator_light],
|
|
769
|
+
exposes: [
|
|
770
|
+
e.switch().withEndpoint('top'),
|
|
771
|
+
e.switch().withEndpoint('bottom'),
|
|
772
|
+
exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
|
|
773
|
+
.withDescription('Decoupled mode for top button')
|
|
774
|
+
.withEndpoint('top'),
|
|
775
|
+
exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
|
|
776
|
+
.withDescription('Decoupled mode for bottom button')
|
|
777
|
+
.withEndpoint('bottom'),
|
|
778
|
+
e.power_outage_count(),
|
|
779
|
+
e.device_temperature().withAccess(ea.STATE),
|
|
780
|
+
e.flip_indicator_light(),
|
|
781
|
+
e.power().withAccess(ea.STATE_GET),
|
|
782
|
+
e.energy(),
|
|
783
|
+
e.voltage(),
|
|
784
|
+
e.power_outage_memory(),
|
|
785
|
+
e.action(['single_top', 'single_bottom', 'single_both', 'double_top', 'double_bottom', 'double_both'])],
|
|
764
786
|
meta: {multiEndpoint: true},
|
|
765
787
|
endpoint: (device) => {
|
|
766
788
|
return {'top': 1, 'bottom': 2};
|
|
767
789
|
},
|
|
790
|
+
onEvent: preventReset,
|
|
768
791
|
configure: async (device, coordinatorEndpoint, logger) => {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
const endpoint2 = device.getEndpoint(2);
|
|
773
|
-
await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']);
|
|
774
|
-
await reporting.onOff(endpoint2);
|
|
792
|
+
await device.getEndpoint(1).write(
|
|
793
|
+
'aqaraOpple', {mode: 1}, {manufacturerCode: 0x115f, disableResponse: true},
|
|
794
|
+
);
|
|
775
795
|
},
|
|
776
796
|
ota: ota.zigbeeOTA,
|
|
777
797
|
},
|
package/lib/ota/common.js
CHANGED
|
@@ -248,12 +248,12 @@ async function isUpdateAvailable(device, logger, isNewImageAvailable, requestPay
|
|
|
248
248
|
requestPayload = request.payload;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
const
|
|
252
|
-
logger.debug(`Update available for '${device.ieeeAddr}': ${available < 0 ? 'YES' : 'NO'}`);
|
|
253
|
-
if (available > 0) {
|
|
251
|
+
const availableResult = await isNewImageAvailable(requestPayload, logger, device, getImageMeta);
|
|
252
|
+
logger.debug(`Update available for '${device.ieeeAddr}': ${availableResult.available < 0 ? 'YES' : 'NO'}`);
|
|
253
|
+
if (availableResult.available > 0) {
|
|
254
254
|
logger.warn(`Firmware on '${device.ieeeAddr}' is newer than latest firmware online.`);
|
|
255
255
|
}
|
|
256
|
-
return {...
|
|
256
|
+
return {...availableResult, available: availableResult.available < 0};
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
async function isNewImageAvailable(current, logger, device, getImageMeta) {
|