@willieee802/zigbee-herdsman-converters 15.0.8-4.1
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/LICENSE +21 -0
- package/README.md +7 -0
- package/converters/fromZigbee.js +8439 -0
- package/converters/toZigbee.js +7162 -0
- package/devices/ITCommander.js +37 -0
- package/devices/RMC002.js +20 -0
- package/devices/acova.js +101 -0
- package/devices/acuity_brands_lighting.js +11 -0
- package/devices/adeo.js +256 -0
- package/devices/adurosmart.js +130 -0
- package/devices/aeotec.js +13 -0
- package/devices/airam.js +59 -0
- package/devices/ajax_online.js +49 -0
- package/devices/akuvox.js +28 -0
- package/devices/alchemy.js +18 -0
- package/devices/aldi.js +53 -0
- package/devices/alecto.js +98 -0
- package/devices/anchor.js +17 -0
- package/devices/atlantic.js +110 -0
- package/devices/atsmart.js +28 -0
- package/devices/aubess.js +21 -0
- package/devices/aurora_lighting.js +292 -0
- package/devices/automaton.js +44 -0
- package/devices/awox.js +184 -0
- package/devices/axis.js +22 -0
- package/devices/bankamp.js +11 -0
- package/devices/bega.js +22 -0
- package/devices/belkin.js +11 -0
- package/devices/bitron.js +334 -0
- package/devices/blaupunkt.js +27 -0
- package/devices/blitzwolf.js +47 -0
- package/devices/bosch.js +702 -0
- package/devices/brimate.js +15 -0
- package/devices/bseed.js +17 -0
- package/devices/bticino.js +118 -0
- package/devices/busch-jaeger.js +140 -0
- package/devices/byun.js +24 -0
- package/devices/calex.js +37 -0
- package/devices/candeo.js +49 -0
- package/devices/casaia.js +52 -0
- package/devices/centralite.js +359 -0
- package/devices/cleode.js +20 -0
- package/devices/cleverio.js +36 -0
- package/devices/climax.js +138 -0
- package/devices/commercial_electric.js +16 -0
- package/devices/connecte.js +46 -0
- package/devices/cree.js +11 -0
- package/devices/ctm.js +999 -0
- package/devices/current_products_corp.js +24 -0
- package/devices/custom_devices_diy.js +850 -0
- package/devices/cy-lighting.js +11 -0
- package/devices/danalock.js +26 -0
- package/devices/danfoss.js +340 -0
- package/devices/databyte.ch.js +55 -0
- package/devices/datek.js +246 -0
- package/devices/dawon_dns.js +338 -0
- package/devices/develco.js +868 -0
- package/devices/digi.js +14 -0
- package/devices/diyruz.js +305 -0
- package/devices/dlink.js +37 -0
- package/devices/dnake.js +11 -0
- package/devices/dresden_elektronik.js +47 -0
- package/devices/easyaccess.js +27 -0
- package/devices/eatonhalo_led.js +11 -0
- package/devices/echostar.js +25 -0
- package/devices/ecodim.js +145 -0
- package/devices/ecolink.js +21 -0
- package/devices/ecosmart.js +64 -0
- package/devices/ecozy.js +31 -0
- package/devices/edp.js +39 -0
- package/devices/eglo.js +25 -0
- package/devices/elko.js +176 -0
- package/devices/enbrighten.js +163 -0
- package/devices/enocean.js +52 -0
- package/devices/envilar.js +73 -0
- package/devices/essentialb.js +87 -0
- package/devices/eurotronic.js +48 -0
- package/devices/evanell.js +29 -0
- package/devices/evn.js +31 -0
- package/devices/evology.js +24 -0
- package/devices/evvr.js +17 -0
- package/devices/ewelink.js +184 -0
- package/devices/ezex.js +24 -0
- package/devices/fantem.js +77 -0
- package/devices/feibit.js +172 -0
- package/devices/fireangel.js +15 -0
- package/devices/frankever.js +23 -0
- package/devices/garza.js +11 -0
- package/devices/ge.js +111 -0
- package/devices/gewiss.js +48 -0
- package/devices/gidealed.js +11 -0
- package/devices/giderwel.js +11 -0
- package/devices/giex.js +222 -0
- package/devices/girier.js +19 -0
- package/devices/gledopto.js +756 -0
- package/devices/gmy.js +11 -0
- package/devices/gs.js +29 -0
- package/devices/halemeier.js +18 -0
- package/devices/hampton_bay.js +37 -0
- package/devices/heiman.js +805 -0
- package/devices/hej.js +107 -0
- package/devices/hfh.js +11 -0
- package/devices/hgkg.js +54 -0
- package/devices/hilux.js +11 -0
- package/devices/hive.js +524 -0
- package/devices/home_control_as.js +27 -0
- package/devices/hommyn.js +24 -0
- package/devices/honyar.js +29 -0
- package/devices/hornbach.js +53 -0
- package/devices/hzc.js +21 -0
- package/devices/hzc_electric.js +42 -0
- package/devices/icasa.js +121 -0
- package/devices/idinio.js +19 -0
- package/devices/ihorn.js +61 -0
- package/devices/ikea.js +1168 -0
- package/devices/ilightsin.js +11 -0
- package/devices/iluminize.js +262 -0
- package/devices/ilux.js +11 -0
- package/devices/immax.js +203 -0
- package/devices/innr.js +705 -0
- package/devices/inovelli.js +1315 -0
- package/devices/insta.js +110 -0
- package/devices/iolloi.js +20 -0
- package/devices/iotperfect.js +20 -0
- package/devices/iris.js +180 -0
- package/devices/istar.js +20 -0
- package/devices/jasco.js +55 -0
- package/devices/javis.js +37 -0
- package/devices/jethome.js +48 -0
- package/devices/jiawen.js +18 -0
- package/devices/jumitech.js +18 -0
- package/devices/jxuan.js +49 -0
- package/devices/kami.js +15 -0
- package/devices/keen_home.js +80 -0
- package/devices/klikaanklikuit.js +17 -0
- package/devices/kmpcil.js +148 -0
- package/devices/konke.js +141 -0
- package/devices/ksentry.js +17 -0
- package/devices/kurvia.js +17 -0
- package/devices/kwikset.js +120 -0
- package/devices/lanesto.js +11 -0
- package/devices/lds.js +11 -0
- package/devices/led_trading.js +69 -0
- package/devices/ledvance.js +353 -0
- package/devices/leedarson.js +130 -0
- package/devices/legrand.js +554 -0
- package/devices/lellki.js +146 -0
- package/devices/letsled.js +11 -0
- package/devices/letv.js +18 -0
- package/devices/leviton.js +142 -0
- package/devices/lg.js +18 -0
- package/devices/lidl.js +1000 -0
- package/devices/lifecontrol.js +92 -0
- package/devices/lightsolutions.js +37 -0
- package/devices/linkind.js +205 -0
- package/devices/livingwise.js +59 -0
- package/devices/livolo.js +286 -0
- package/devices/lixee.js +779 -0
- package/devices/lonsonho.js +218 -0
- package/devices/lubeez.js +18 -0
- package/devices/lupus.js +74 -0
- package/devices/lutron.js +32 -0
- package/devices/lux.js +40 -0
- package/devices/m-elec.js +18 -0
- package/devices/makegood.js +51 -0
- package/devices/matcall_bv.js +18 -0
- package/devices/meazon.js +47 -0
- package/devices/mercator.js +225 -0
- package/devices/miboxer.js +72 -0
- package/devices/micromatic.js +29 -0
- package/devices/moes.js +400 -0
- package/devices/mycket.js +11 -0
- package/devices/m/303/274ller_licht.js +220 -0
- package/devices/namron.js +774 -0
- package/devices/nanoleaf.js +11 -0
- package/devices/neo.js +86 -0
- package/devices/net2grid.js +29 -0
- package/devices/netvox.js +35 -0
- package/devices/niko.js +314 -0
- package/devices/ninja_blocks.js +24 -0
- package/devices/niviss.js +11 -0
- package/devices/nodon.js +109 -0
- package/devices/nordtronic.js +30 -0
- package/devices/nous.js +88 -0
- package/devices/novo.js +17 -0
- package/devices/nue_3a.js +417 -0
- package/devices/nyce.js +67 -0
- package/devices/onesti.js +59 -0
- package/devices/openlumi.js +22 -0
- package/devices/orvibo.js +515 -0
- package/devices/osram.js +519 -0
- package/devices/oujiabao.js +15 -0
- package/devices/owon.js +352 -0
- package/devices/ozsmartthings.js +11 -0
- package/devices/paul_neuhaus.js +96 -0
- package/devices/paulmann.js +158 -0
- package/devices/peq.js +24 -0
- package/devices/perenio.js +413 -0
- package/devices/philips.js +3118 -0
- package/devices/plaid.js +25 -0
- package/devices/plugwise.js +173 -0
- package/devices/popp.js +10 -0
- package/devices/profalux.js +47 -0
- package/devices/prolight.js +54 -0
- package/devices/qmotion.js +33 -0
- package/devices/qoto.js +113 -0
- package/devices/quotra.js +18 -0
- package/devices/rademacher.js +18 -0
- package/devices/rgb_genie.js +119 -0
- package/devices/robb.js +335 -0
- package/devices/roome.js +15 -0
- package/devices/rtx.js +90 -0
- package/devices/salus_controls.js +137 -0
- package/devices/samotech.js +93 -0
- package/devices/saswell.js +58 -0
- package/devices/scanproducts.js +32 -0
- package/devices/schlage.js +24 -0
- package/devices/schneider_electric.js +1039 -0
- package/devices/schwaiger.js +62 -0
- package/devices/seastar_intelligence.js +16 -0
- package/devices/securifi.js +39 -0
- package/devices/sengled.js +332 -0
- package/devices/sercomm.js +140 -0
- package/devices/shenzhen_homa.js +53 -0
- package/devices/shinasystem.js +686 -0
- package/devices/siglis.js +440 -0
- package/devices/sinope.js +1257 -0
- package/devices/siterwell.js +46 -0
- package/devices/skydance.js +112 -0
- package/devices/slv.js +27 -0
- package/devices/smart9.js +27 -0
- package/devices/smart_home_pty.js +18 -0
- package/devices/smartenit.js +42 -0
- package/devices/smartthings.js +495 -0
- package/devices/smartwings.js +24 -0
- package/devices/sohan_electric.js +13 -0
- package/devices/solaredge.js +11 -0
- package/devices/somgoms.js +47 -0
- package/devices/sonoff.js +262 -0
- package/devices/spotmau.js +36 -0
- package/devices/sprut.js +317 -0
- package/devices/stelpro.js +216 -0
- package/devices/sunricher.js +625 -0
- package/devices/swann.js +33 -0
- package/devices/sylvania.js +200 -0
- package/devices/tci.js +25 -0
- package/devices/technicolor.js +47 -0
- package/devices/terncy.js +64 -0
- package/devices/the_light_group.js +70 -0
- package/devices/third_reality.js +195 -0
- package/devices/titan_products.js +22 -0
- package/devices/tplink.js +42 -0
- package/devices/trust.js +114 -0
- package/devices/tubeszb.js +20 -0
- package/devices/tuya.js +4215 -0
- package/devices/ubisys.js +938 -0
- package/devices/uhome.js +25 -0
- package/devices/universal_electronics_inc.js +119 -0
- package/devices/urlighting.js +12 -0
- package/devices/useelink.js +52 -0
- package/devices/vbled.js +18 -0
- package/devices/vesternet.js +188 -0
- package/devices/viessmann.js +51 -0
- package/devices/villeroy_boch.js +18 -0
- package/devices/vimar.js +78 -0
- package/devices/visonic.js +80 -0
- package/devices/vrey.js +18 -0
- package/devices/wally.js +25 -0
- package/devices/waxman.js +45 -0
- package/devices/weiser.js +67 -0
- package/devices/weten.js +13 -0
- package/devices/wisdom.js +11 -0
- package/devices/woox.js +177 -0
- package/devices/wyze.js +23 -0
- package/devices/xiaomi.js +3223 -0
- package/devices/xinghuoyuan.js +11 -0
- package/devices/yale.js +227 -0
- package/devices/ynoa.js +68 -0
- package/devices/yookee.js +23 -0
- package/devices/ysrsai.js +26 -0
- package/devices/zemismart.js +254 -0
- package/devices/zen.js +34 -0
- package/devices/zipato.js +11 -0
- package/index.js +242 -0
- package/lib/color.js +784 -0
- package/lib/configureKey.js +944 -0
- package/lib/constants.js +316 -0
- package/lib/exposes.js +677 -0
- package/lib/extend.js +180 -0
- package/lib/kelvinToXy.js +1912 -0
- package/lib/legacy.js +2223 -0
- package/lib/light.js +111 -0
- package/lib/ota/OTA_URLs.md +119 -0
- package/lib/ota/common.js +476 -0
- package/lib/ota/index.js +10 -0
- package/lib/ota/inovelli.js +72 -0
- package/lib/ota/ledvance.js +52 -0
- package/lib/ota/lixee.js +57 -0
- package/lib/ota/salus.js +82 -0
- package/lib/ota/securifi.js +25 -0
- package/lib/ota/tradfri.js +45 -0
- package/lib/ota/ubisys.js +61 -0
- package/lib/ota/zigbeeOTA.js +161 -0
- package/lib/philips.js +667 -0
- package/lib/reporting.js +234 -0
- package/lib/store.js +57 -0
- package/lib/tuya.js +2027 -0
- package/lib/utils.js +527 -0
- package/lib/xiaomi.d.ts +11 -0
- package/lib/xiaomi.js +1288 -0
- package/lib/zosung.js +243 -0
- package/package.json +39 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/* eslint-disable linebreak-style */
|
|
2
|
+
const fz = require('../converters/fromZigbee');
|
|
3
|
+
const tz = require('../converters/toZigbee');
|
|
4
|
+
const exposes = require('../lib/exposes');
|
|
5
|
+
const reporting = require('../lib/reporting');
|
|
6
|
+
const e = exposes.presets;
|
|
7
|
+
const ea = exposes.access;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const zigfredEndpoint = 5;
|
|
11
|
+
|
|
12
|
+
const buttonLookup = {
|
|
13
|
+
0: 'button_1',
|
|
14
|
+
1: 'button_2',
|
|
15
|
+
2: 'button_3',
|
|
16
|
+
3: 'button_4',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const actionLookup = {
|
|
20
|
+
0: 'release',
|
|
21
|
+
1: 'single',
|
|
22
|
+
2: 'double',
|
|
23
|
+
3: 'hold',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const zifgredFromZigbeeButtonEvent = {
|
|
27
|
+
cluster: 'manuSpecificSiglisZigfred',
|
|
28
|
+
type: ['commandSiglisZigfredButtonEvent'],
|
|
29
|
+
convert: (model, msg, publish, options, meta) => {
|
|
30
|
+
const button = msg.data.button;
|
|
31
|
+
const type = msg.data.type;
|
|
32
|
+
|
|
33
|
+
const buttonName = buttonLookup[button];
|
|
34
|
+
const typeName = actionLookup[type];
|
|
35
|
+
|
|
36
|
+
if (buttonName && typeName) {
|
|
37
|
+
const action = `${buttonName}_${typeName}`;
|
|
38
|
+
return {action};
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const coverAndLightToZigbee = {
|
|
44
|
+
key: ['state', 'brightness', 'brightness_percent', 'on_time', 'position', 'tilt'],
|
|
45
|
+
options: [exposes.options.transition()],
|
|
46
|
+
convertSet: async (entity, key, value, meta) => {
|
|
47
|
+
const isCover = entity.ID === 0x0b || entity.ID === 0x0c;
|
|
48
|
+
if (isCover) {
|
|
49
|
+
if (key === 'state') {
|
|
50
|
+
return tz.cover_state.convertSet(entity, key, value, meta);
|
|
51
|
+
} else if (key === 'position' || key === 'tilt') {
|
|
52
|
+
return tz.cover_position_tilt.convertSet(entity, key, value, meta);
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
if (key === 'state' || key === 'brightness' || key === 'brightness_percent' || key === 'on_time') {
|
|
56
|
+
return tz.light_onoff_brightness.convertSet(entity, key, value, meta);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
convertGet: async (entity, key, meta) => {
|
|
61
|
+
if (key === 'state' && (entity.ID === 0x0b || entity.ID === 0x0c)) {
|
|
62
|
+
await tz.cover_position_tilt.convertGet(entity, 'position', meta);
|
|
63
|
+
} else if (key === 'brightness') {
|
|
64
|
+
await entity.read('genLevelCtrl', ['currentLevel']);
|
|
65
|
+
} else if (key === 'state') {
|
|
66
|
+
await tz.on_off.convertGet(entity, key, meta);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const buttonEventExposes = e.action([
|
|
72
|
+
'button_1_single', 'button_1_double', 'button_1_hold', 'button_1_release',
|
|
73
|
+
'button_2_single', 'button_2_double', 'button_2_hold', 'button_2_release',
|
|
74
|
+
'button_3_single', 'button_3_double', 'button_3_hold', 'button_3_release',
|
|
75
|
+
'button_4_single', 'button_4_double', 'button_4_hold', 'button_4_release',
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
function checkOption(device, options, key) {
|
|
79
|
+
if (options != null && options.hasOwnProperty(key)) {
|
|
80
|
+
if (options[key] === 'true') {
|
|
81
|
+
return true;
|
|
82
|
+
} else if (options[key] === 'false') {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return checkMetaOption(device, key);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function checkMetaOption(device, key) {
|
|
91
|
+
if (device != null) {
|
|
92
|
+
const enabled = device.meta[key];
|
|
93
|
+
if (enabled === undefined) {
|
|
94
|
+
return false;
|
|
95
|
+
} else {
|
|
96
|
+
return !!enabled;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function setMetaOption(device, key, enabled) {
|
|
104
|
+
if (device != null && key != null) {
|
|
105
|
+
device.meta[key] = enabled;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
module.exports = [
|
|
110
|
+
{
|
|
111
|
+
zigbeeModel: ['zigfred uno'],
|
|
112
|
+
model: 'ZFU-1D-CH',
|
|
113
|
+
vendor: 'Siglis',
|
|
114
|
+
description: 'zigfred uno smart in-wall switch',
|
|
115
|
+
options: [
|
|
116
|
+
exposes.enum(`front_surface_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
117
|
+
.withDescription('Front Surface LED enabled'),
|
|
118
|
+
exposes.enum(`relay_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
119
|
+
.withDescription('Relay enabled'),
|
|
120
|
+
exposes.enum(`dimmer_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
121
|
+
.withDescription('Dimmer enabled'),
|
|
122
|
+
exposes.enum(`dimmer_dimming_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
123
|
+
.withDescription('Dimmer dimmable'),
|
|
124
|
+
],
|
|
125
|
+
exposes: (device, options) => {
|
|
126
|
+
const expose = [];
|
|
127
|
+
|
|
128
|
+
expose.push(buttonEventExposes);
|
|
129
|
+
expose.push(e.linkquality());
|
|
130
|
+
|
|
131
|
+
if (checkOption(device, options, 'front_surface_enabled')) {
|
|
132
|
+
expose.push(e.light_brightness_colorxy().withEndpoint('l1'));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (checkOption(device, options, 'relay_enabled')) {
|
|
136
|
+
expose.push(e.switch().withEndpoint('l2'));
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (checkOption(device, options, 'dimmer_enabled')) {
|
|
140
|
+
if (checkOption(device, options, 'dimmer_dimming_enabled')) {
|
|
141
|
+
expose.push(e.light_brightness().withEndpoint('l3'));
|
|
142
|
+
} else {
|
|
143
|
+
expose.push(e.switch().withEndpoint('l3'));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return expose;
|
|
148
|
+
},
|
|
149
|
+
fromZigbee: [
|
|
150
|
+
zifgredFromZigbeeButtonEvent,
|
|
151
|
+
fz.color_colortemp,
|
|
152
|
+
fz.on_off,
|
|
153
|
+
fz.brightness,
|
|
154
|
+
fz.level_config,
|
|
155
|
+
fz.power_on_behavior,
|
|
156
|
+
fz.ignore_basic_report,
|
|
157
|
+
],
|
|
158
|
+
toZigbee: [
|
|
159
|
+
tz.light_onoff_brightness,
|
|
160
|
+
tz.light_color,
|
|
161
|
+
tz.ignore_transition,
|
|
162
|
+
tz.ignore_rate,
|
|
163
|
+
tz.light_brightness_move,
|
|
164
|
+
tz.light_brightness_step,
|
|
165
|
+
tz.level_config,
|
|
166
|
+
tz.power_on_behavior,
|
|
167
|
+
tz.light_hue_saturation_move,
|
|
168
|
+
tz.light_hue_saturation_step,
|
|
169
|
+
tz.light_color_options,
|
|
170
|
+
tz.light_color_mode,
|
|
171
|
+
],
|
|
172
|
+
meta: {multiEndpoint: true},
|
|
173
|
+
endpoint: (device) => {
|
|
174
|
+
return {
|
|
175
|
+
'l1': zigfredEndpoint,
|
|
176
|
+
'l2': 6,
|
|
177
|
+
'l3': 7,
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
configure: async (device, coordinatorEndpoint, logger, options) => {
|
|
181
|
+
if (device != null) {
|
|
182
|
+
const controlEp = device.getEndpoint(zigfredEndpoint);
|
|
183
|
+
const relayEp = device.getEndpoint(6);
|
|
184
|
+
const dimmerEp = device.getEndpoint(7);
|
|
185
|
+
|
|
186
|
+
// Bind Control EP (LED)
|
|
187
|
+
setMetaOption(device, 'front_surface_enabled', (await controlEp.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
188
|
+
if (checkMetaOption(device, 'front_surface_enabled')) {
|
|
189
|
+
await reporting.bind(controlEp, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'manuSpecificSiglisZigfred']);
|
|
190
|
+
await reporting.onOff(controlEp);
|
|
191
|
+
await reporting.brightness(controlEp);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Bind Relay EP
|
|
195
|
+
setMetaOption(device, 'relay_enabled', (await relayEp.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
196
|
+
if (checkMetaOption(device, 'relay_enabled')) {
|
|
197
|
+
await reporting.bind(relayEp, coordinatorEndpoint, ['genOnOff']);
|
|
198
|
+
await reporting.onOff(relayEp);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Bind Dimmer EP
|
|
202
|
+
setMetaOption(device, 'dimmer_enabled', (await dimmerEp.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
203
|
+
if (checkMetaOption(device, 'dimmer_enabled')) {
|
|
204
|
+
await reporting.bind(dimmerEp, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
205
|
+
await reporting.onOff(dimmerEp);
|
|
206
|
+
await reporting.brightness(dimmerEp);
|
|
207
|
+
}
|
|
208
|
+
setMetaOption(device, 'dimmer_dimming_enabled', true);
|
|
209
|
+
|
|
210
|
+
device.save();
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
zigbeeModel: ['zigfred plus'],
|
|
216
|
+
model: 'ZFP-1A-CH',
|
|
217
|
+
vendor: 'Siglis',
|
|
218
|
+
description: 'zigfred plus smart in-wall switch',
|
|
219
|
+
options: [
|
|
220
|
+
exposes.enum(`front_surface_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
221
|
+
.withDescription('Front Surface LED enabled'),
|
|
222
|
+
exposes.enum(`dimmer_1_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
223
|
+
.withDescription('Dimmer 1 enabled'),
|
|
224
|
+
exposes.enum(`dimmer_1_dimming_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
225
|
+
.withDescription('Dimmer 1 dimmable'),
|
|
226
|
+
exposes.enum(`dimmer_2_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
227
|
+
.withDescription('Dimmer 2 enabled'),
|
|
228
|
+
exposes.enum(`dimmer_2_dimming_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
229
|
+
.withDescription('Dimmer 2 dimmable'),
|
|
230
|
+
exposes.enum(`dimmer_3_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
231
|
+
.withDescription('Dimmer 3 enabled'),
|
|
232
|
+
exposes.enum(`dimmer_3_dimming_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
233
|
+
.withDescription('Dimmer 3 dimmable'),
|
|
234
|
+
exposes.enum(`dimmer_4_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
235
|
+
.withDescription('Dimmer 4 enabled'),
|
|
236
|
+
exposes.enum(`dimmer_4_dimming_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
237
|
+
.withDescription('Dimmer 4 dimmable'),
|
|
238
|
+
exposes.enum(`cover_1_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
239
|
+
.withDescription('Cover 1 enabled'),
|
|
240
|
+
exposes.enum(`cover_1_tilt_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
241
|
+
.withDescription('Cover 1 tiltable'),
|
|
242
|
+
exposes.enum(`cover_2_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
243
|
+
.withDescription('Cover 2 enabled'),
|
|
244
|
+
exposes.enum(`cover_2_tilt_enabled`, ea.SET, ['auto', 'true', 'false'])
|
|
245
|
+
.withDescription('Cover 2 tiltable'),
|
|
246
|
+
],
|
|
247
|
+
exposes: (device, options) => {
|
|
248
|
+
const expose = [];
|
|
249
|
+
|
|
250
|
+
expose.push(buttonEventExposes);
|
|
251
|
+
expose.push(e.linkquality());
|
|
252
|
+
|
|
253
|
+
if (checkOption(device, options, 'front_surface_enabled')) {
|
|
254
|
+
expose.push(e.light_brightness_colorxy().withEndpoint('l1'));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (checkOption(device, options, 'dimmer_1_enabled')) {
|
|
258
|
+
if (checkOption(device, options, 'dimmer_1_dimming_enabled')) {
|
|
259
|
+
expose.push(e.light_brightness().withEndpoint('l2'));
|
|
260
|
+
} else {
|
|
261
|
+
expose.push(e.switch().withEndpoint('l2'));
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (checkOption(device, options, 'dimmer_2_enabled')) {
|
|
266
|
+
if (checkOption(device, options, 'dimmer_2_dimming_enabled')) {
|
|
267
|
+
expose.push(e.light_brightness().withEndpoint('l3'));
|
|
268
|
+
} else {
|
|
269
|
+
expose.push(e.switch().withEndpoint('l3'));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (checkOption(device, options, 'dimmer_3_enabled')) {
|
|
274
|
+
if (checkOption(device, options, 'dimmer_3_dimming_enabled')) {
|
|
275
|
+
expose.push(e.light_brightness().withEndpoint('l4'));
|
|
276
|
+
} else {
|
|
277
|
+
expose.push(e.switch().withEndpoint('l4'));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (checkOption(device, options, 'dimmer_4_enabled')) {
|
|
282
|
+
if (checkOption(device, options, 'dimmer_4_dimming_enabled')) {
|
|
283
|
+
expose.push(e.light_brightness().withEndpoint('l5'));
|
|
284
|
+
} else {
|
|
285
|
+
expose.push(e.switch().withEndpoint('l5'));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (checkOption(device, options, 'cover_1_enabled')) {
|
|
290
|
+
if (checkOption(device, options, 'cover_1_tilt_enabled')) {
|
|
291
|
+
expose.push(exposes.cover()
|
|
292
|
+
.setAccess('state', exposes.access.STATE_SET | exposes.access.STATE_GET)
|
|
293
|
+
.withPosition().withTilt().withEndpoint('l6'));
|
|
294
|
+
} else {
|
|
295
|
+
expose.push(exposes.cover()
|
|
296
|
+
.setAccess('state', exposes.access.STATE_SET | exposes.access.STATE_GET)
|
|
297
|
+
.withPosition().withEndpoint('l6'));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (checkOption(device, options, 'cover_2_enabled')) {
|
|
302
|
+
if (checkOption(device, options, 'cover_2_tilt_enabled')) {
|
|
303
|
+
expose.push(exposes.cover()
|
|
304
|
+
.setAccess('state', exposes.access.STATE_SET | exposes.access.STATE_GET)
|
|
305
|
+
.withPosition().withTilt().withEndpoint('l7'));
|
|
306
|
+
} else {
|
|
307
|
+
expose.push(exposes.cover()
|
|
308
|
+
.setAccess('state', exposes.access.STATE_SET | exposes.access.STATE_GET)
|
|
309
|
+
.withPosition().withEndpoint('l7'));
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return expose;
|
|
314
|
+
},
|
|
315
|
+
fromZigbee: [
|
|
316
|
+
zifgredFromZigbeeButtonEvent,
|
|
317
|
+
fz.color_colortemp,
|
|
318
|
+
fz.on_off,
|
|
319
|
+
fz.brightness,
|
|
320
|
+
fz.level_config,
|
|
321
|
+
fz.power_on_behavior,
|
|
322
|
+
fz.ignore_basic_report,
|
|
323
|
+
fz.cover_position_tilt,
|
|
324
|
+
],
|
|
325
|
+
toZigbee: [
|
|
326
|
+
tz.light_color,
|
|
327
|
+
tz.ignore_transition,
|
|
328
|
+
tz.ignore_rate,
|
|
329
|
+
tz.light_brightness_move,
|
|
330
|
+
tz.light_brightness_step,
|
|
331
|
+
tz.level_config,
|
|
332
|
+
tz.power_on_behavior,
|
|
333
|
+
tz.light_hue_saturation_move,
|
|
334
|
+
tz.light_hue_saturation_step,
|
|
335
|
+
tz.light_color_options,
|
|
336
|
+
tz.light_color_mode,
|
|
337
|
+
coverAndLightToZigbee,
|
|
338
|
+
],
|
|
339
|
+
meta: {multiEndpoint: true},
|
|
340
|
+
endpoint: (device) => {
|
|
341
|
+
return {
|
|
342
|
+
'l1': zigfredEndpoint,
|
|
343
|
+
'l2': 7,
|
|
344
|
+
'l3': 8,
|
|
345
|
+
'l4': 9,
|
|
346
|
+
'l5': 10,
|
|
347
|
+
'l6': 11,
|
|
348
|
+
'l7': 12,
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
configure: async (device, coordinatorEndpoint, logger, options) => {
|
|
352
|
+
if (device != null) {
|
|
353
|
+
// Bind Control EP (LED)
|
|
354
|
+
const controlEp = device.getEndpoint(zigfredEndpoint);
|
|
355
|
+
setMetaOption(device, 'front_surface_enabled', (await controlEp.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
356
|
+
if (checkMetaOption(device, 'front_surface_enabled')) {
|
|
357
|
+
await reporting.bind(controlEp, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'manuSpecificSiglisZigfred']);
|
|
358
|
+
await reporting.onOff(controlEp);
|
|
359
|
+
await reporting.brightness(controlEp);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// Bind Dimmer 1 EP
|
|
363
|
+
const dimmer1Ep = device.getEndpoint(7);
|
|
364
|
+
setMetaOption(device, 'dimmer_1_enabled', (await dimmer1Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
365
|
+
if (checkMetaOption(device, 'dimmer_1_enabled')) {
|
|
366
|
+
await reporting.bind(dimmer1Ep, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
367
|
+
await reporting.onOff(dimmer1Ep);
|
|
368
|
+
await reporting.brightness(dimmer1Ep);
|
|
369
|
+
}
|
|
370
|
+
setMetaOption(device, 'dimmer_1_dimming_enabled', true);
|
|
371
|
+
|
|
372
|
+
// Bind Dimmer 2 EP
|
|
373
|
+
const dimmer2Ep = device.getEndpoint(8);
|
|
374
|
+
setMetaOption(device, 'dimmer_2_enabled', (await dimmer2Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
375
|
+
if (checkMetaOption(device, 'dimmer_2_enabled')) {
|
|
376
|
+
await reporting.bind(dimmer2Ep, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
377
|
+
await reporting.onOff(dimmer2Ep);
|
|
378
|
+
await reporting.brightness(dimmer2Ep);
|
|
379
|
+
}
|
|
380
|
+
setMetaOption(device, 'dimmer_2_dimming_enabled', true);
|
|
381
|
+
|
|
382
|
+
// Bind Dimmer 3 EP
|
|
383
|
+
const dimmer3Ep = device.getEndpoint(9);
|
|
384
|
+
setMetaOption(device, 'dimmer_3_enabled', (await dimmer3Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
385
|
+
if (checkMetaOption(device, 'dimmer_3_enabled')) {
|
|
386
|
+
await reporting.bind(dimmer3Ep, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
387
|
+
await reporting.onOff(dimmer3Ep);
|
|
388
|
+
await reporting.brightness(dimmer3Ep);
|
|
389
|
+
}
|
|
390
|
+
setMetaOption(device, 'dimmer_3_dimming_enabled', true);
|
|
391
|
+
|
|
392
|
+
// Bind Dimmer 4 EP
|
|
393
|
+
const dimmer4Ep = device.getEndpoint(10);
|
|
394
|
+
setMetaOption(device, 'dimmer_4_enabled', (await dimmer4Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
395
|
+
if (checkMetaOption(device, 'dimmer_4_enabled')) {
|
|
396
|
+
await reporting.bind(dimmer4Ep, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
|
|
397
|
+
await reporting.onOff(dimmer4Ep);
|
|
398
|
+
await reporting.brightness(dimmer4Ep);
|
|
399
|
+
}
|
|
400
|
+
setMetaOption(device, 'dimmer_4_dimming_enabled', true);
|
|
401
|
+
|
|
402
|
+
// Bind Cover 1 EP
|
|
403
|
+
const cover1Ep = device.getEndpoint(11);
|
|
404
|
+
setMetaOption(device, 'cover_1_enabled', (await cover1Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
405
|
+
if (checkMetaOption(device, 'cover_1_enabled')) {
|
|
406
|
+
await reporting.bind(cover1Ep, coordinatorEndpoint, ['closuresWindowCovering']);
|
|
407
|
+
await reporting.currentPositionLiftPercentage(cover1Ep);
|
|
408
|
+
setMetaOption(
|
|
409
|
+
device,
|
|
410
|
+
'cover_1_tilt_enabled',
|
|
411
|
+
(await cover1Ep.read('closuresWindowCovering', ['windowCoveringType'])).windowCoveringType === 0x08);
|
|
412
|
+
if (checkMetaOption(device, 'cover_1_tilt_enabled')) {
|
|
413
|
+
await reporting.currentPositionTiltPercentage(cover1Ep);
|
|
414
|
+
}
|
|
415
|
+
} else {
|
|
416
|
+
setMetaOption(device, 'cover_1_tilt_enabled', false);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Bind Cover 2 EP
|
|
420
|
+
const cover2Ep = device.getEndpoint(12);
|
|
421
|
+
setMetaOption(device, 'cover_2_enabled', (await cover2Ep.read('genBasic', ['deviceEnabled'])).deviceEnabled);
|
|
422
|
+
if (checkMetaOption(device, 'cover_2_enabled')) {
|
|
423
|
+
await reporting.bind(cover2Ep, coordinatorEndpoint, ['closuresWindowCovering']);
|
|
424
|
+
await reporting.currentPositionLiftPercentage(cover2Ep);
|
|
425
|
+
setMetaOption(
|
|
426
|
+
device,
|
|
427
|
+
'cover_2_tilt_enabled',
|
|
428
|
+
(await cover2Ep.read('closuresWindowCovering', ['windowCoveringType'])).windowCoveringType === 0x08);
|
|
429
|
+
if (checkMetaOption(device, 'cover_2_tilt_enabled')) {
|
|
430
|
+
await reporting.currentPositionTiltPercentage(cover2Ep);
|
|
431
|
+
}
|
|
432
|
+
} else {
|
|
433
|
+
setMetaOption(device, 'cover_2_tilt_enabled', false);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
device.save();
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
];
|