@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.
Files changed (312) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/converters/fromZigbee.js +8439 -0
  4. package/converters/toZigbee.js +7162 -0
  5. package/devices/ITCommander.js +37 -0
  6. package/devices/RMC002.js +20 -0
  7. package/devices/acova.js +101 -0
  8. package/devices/acuity_brands_lighting.js +11 -0
  9. package/devices/adeo.js +256 -0
  10. package/devices/adurosmart.js +130 -0
  11. package/devices/aeotec.js +13 -0
  12. package/devices/airam.js +59 -0
  13. package/devices/ajax_online.js +49 -0
  14. package/devices/akuvox.js +28 -0
  15. package/devices/alchemy.js +18 -0
  16. package/devices/aldi.js +53 -0
  17. package/devices/alecto.js +98 -0
  18. package/devices/anchor.js +17 -0
  19. package/devices/atlantic.js +110 -0
  20. package/devices/atsmart.js +28 -0
  21. package/devices/aubess.js +21 -0
  22. package/devices/aurora_lighting.js +292 -0
  23. package/devices/automaton.js +44 -0
  24. package/devices/awox.js +184 -0
  25. package/devices/axis.js +22 -0
  26. package/devices/bankamp.js +11 -0
  27. package/devices/bega.js +22 -0
  28. package/devices/belkin.js +11 -0
  29. package/devices/bitron.js +334 -0
  30. package/devices/blaupunkt.js +27 -0
  31. package/devices/blitzwolf.js +47 -0
  32. package/devices/bosch.js +702 -0
  33. package/devices/brimate.js +15 -0
  34. package/devices/bseed.js +17 -0
  35. package/devices/bticino.js +118 -0
  36. package/devices/busch-jaeger.js +140 -0
  37. package/devices/byun.js +24 -0
  38. package/devices/calex.js +37 -0
  39. package/devices/candeo.js +49 -0
  40. package/devices/casaia.js +52 -0
  41. package/devices/centralite.js +359 -0
  42. package/devices/cleode.js +20 -0
  43. package/devices/cleverio.js +36 -0
  44. package/devices/climax.js +138 -0
  45. package/devices/commercial_electric.js +16 -0
  46. package/devices/connecte.js +46 -0
  47. package/devices/cree.js +11 -0
  48. package/devices/ctm.js +999 -0
  49. package/devices/current_products_corp.js +24 -0
  50. package/devices/custom_devices_diy.js +850 -0
  51. package/devices/cy-lighting.js +11 -0
  52. package/devices/danalock.js +26 -0
  53. package/devices/danfoss.js +340 -0
  54. package/devices/databyte.ch.js +55 -0
  55. package/devices/datek.js +246 -0
  56. package/devices/dawon_dns.js +338 -0
  57. package/devices/develco.js +868 -0
  58. package/devices/digi.js +14 -0
  59. package/devices/diyruz.js +305 -0
  60. package/devices/dlink.js +37 -0
  61. package/devices/dnake.js +11 -0
  62. package/devices/dresden_elektronik.js +47 -0
  63. package/devices/easyaccess.js +27 -0
  64. package/devices/eatonhalo_led.js +11 -0
  65. package/devices/echostar.js +25 -0
  66. package/devices/ecodim.js +145 -0
  67. package/devices/ecolink.js +21 -0
  68. package/devices/ecosmart.js +64 -0
  69. package/devices/ecozy.js +31 -0
  70. package/devices/edp.js +39 -0
  71. package/devices/eglo.js +25 -0
  72. package/devices/elko.js +176 -0
  73. package/devices/enbrighten.js +163 -0
  74. package/devices/enocean.js +52 -0
  75. package/devices/envilar.js +73 -0
  76. package/devices/essentialb.js +87 -0
  77. package/devices/eurotronic.js +48 -0
  78. package/devices/evanell.js +29 -0
  79. package/devices/evn.js +31 -0
  80. package/devices/evology.js +24 -0
  81. package/devices/evvr.js +17 -0
  82. package/devices/ewelink.js +184 -0
  83. package/devices/ezex.js +24 -0
  84. package/devices/fantem.js +77 -0
  85. package/devices/feibit.js +172 -0
  86. package/devices/fireangel.js +15 -0
  87. package/devices/frankever.js +23 -0
  88. package/devices/garza.js +11 -0
  89. package/devices/ge.js +111 -0
  90. package/devices/gewiss.js +48 -0
  91. package/devices/gidealed.js +11 -0
  92. package/devices/giderwel.js +11 -0
  93. package/devices/giex.js +222 -0
  94. package/devices/girier.js +19 -0
  95. package/devices/gledopto.js +756 -0
  96. package/devices/gmy.js +11 -0
  97. package/devices/gs.js +29 -0
  98. package/devices/halemeier.js +18 -0
  99. package/devices/hampton_bay.js +37 -0
  100. package/devices/heiman.js +805 -0
  101. package/devices/hej.js +107 -0
  102. package/devices/hfh.js +11 -0
  103. package/devices/hgkg.js +54 -0
  104. package/devices/hilux.js +11 -0
  105. package/devices/hive.js +524 -0
  106. package/devices/home_control_as.js +27 -0
  107. package/devices/hommyn.js +24 -0
  108. package/devices/honyar.js +29 -0
  109. package/devices/hornbach.js +53 -0
  110. package/devices/hzc.js +21 -0
  111. package/devices/hzc_electric.js +42 -0
  112. package/devices/icasa.js +121 -0
  113. package/devices/idinio.js +19 -0
  114. package/devices/ihorn.js +61 -0
  115. package/devices/ikea.js +1168 -0
  116. package/devices/ilightsin.js +11 -0
  117. package/devices/iluminize.js +262 -0
  118. package/devices/ilux.js +11 -0
  119. package/devices/immax.js +203 -0
  120. package/devices/innr.js +705 -0
  121. package/devices/inovelli.js +1315 -0
  122. package/devices/insta.js +110 -0
  123. package/devices/iolloi.js +20 -0
  124. package/devices/iotperfect.js +20 -0
  125. package/devices/iris.js +180 -0
  126. package/devices/istar.js +20 -0
  127. package/devices/jasco.js +55 -0
  128. package/devices/javis.js +37 -0
  129. package/devices/jethome.js +48 -0
  130. package/devices/jiawen.js +18 -0
  131. package/devices/jumitech.js +18 -0
  132. package/devices/jxuan.js +49 -0
  133. package/devices/kami.js +15 -0
  134. package/devices/keen_home.js +80 -0
  135. package/devices/klikaanklikuit.js +17 -0
  136. package/devices/kmpcil.js +148 -0
  137. package/devices/konke.js +141 -0
  138. package/devices/ksentry.js +17 -0
  139. package/devices/kurvia.js +17 -0
  140. package/devices/kwikset.js +120 -0
  141. package/devices/lanesto.js +11 -0
  142. package/devices/lds.js +11 -0
  143. package/devices/led_trading.js +69 -0
  144. package/devices/ledvance.js +353 -0
  145. package/devices/leedarson.js +130 -0
  146. package/devices/legrand.js +554 -0
  147. package/devices/lellki.js +146 -0
  148. package/devices/letsled.js +11 -0
  149. package/devices/letv.js +18 -0
  150. package/devices/leviton.js +142 -0
  151. package/devices/lg.js +18 -0
  152. package/devices/lidl.js +1000 -0
  153. package/devices/lifecontrol.js +92 -0
  154. package/devices/lightsolutions.js +37 -0
  155. package/devices/linkind.js +205 -0
  156. package/devices/livingwise.js +59 -0
  157. package/devices/livolo.js +286 -0
  158. package/devices/lixee.js +779 -0
  159. package/devices/lonsonho.js +218 -0
  160. package/devices/lubeez.js +18 -0
  161. package/devices/lupus.js +74 -0
  162. package/devices/lutron.js +32 -0
  163. package/devices/lux.js +40 -0
  164. package/devices/m-elec.js +18 -0
  165. package/devices/makegood.js +51 -0
  166. package/devices/matcall_bv.js +18 -0
  167. package/devices/meazon.js +47 -0
  168. package/devices/mercator.js +225 -0
  169. package/devices/miboxer.js +72 -0
  170. package/devices/micromatic.js +29 -0
  171. package/devices/moes.js +400 -0
  172. package/devices/mycket.js +11 -0
  173. package/devices/m/303/274ller_licht.js +220 -0
  174. package/devices/namron.js +774 -0
  175. package/devices/nanoleaf.js +11 -0
  176. package/devices/neo.js +86 -0
  177. package/devices/net2grid.js +29 -0
  178. package/devices/netvox.js +35 -0
  179. package/devices/niko.js +314 -0
  180. package/devices/ninja_blocks.js +24 -0
  181. package/devices/niviss.js +11 -0
  182. package/devices/nodon.js +109 -0
  183. package/devices/nordtronic.js +30 -0
  184. package/devices/nous.js +88 -0
  185. package/devices/novo.js +17 -0
  186. package/devices/nue_3a.js +417 -0
  187. package/devices/nyce.js +67 -0
  188. package/devices/onesti.js +59 -0
  189. package/devices/openlumi.js +22 -0
  190. package/devices/orvibo.js +515 -0
  191. package/devices/osram.js +519 -0
  192. package/devices/oujiabao.js +15 -0
  193. package/devices/owon.js +352 -0
  194. package/devices/ozsmartthings.js +11 -0
  195. package/devices/paul_neuhaus.js +96 -0
  196. package/devices/paulmann.js +158 -0
  197. package/devices/peq.js +24 -0
  198. package/devices/perenio.js +413 -0
  199. package/devices/philips.js +3118 -0
  200. package/devices/plaid.js +25 -0
  201. package/devices/plugwise.js +173 -0
  202. package/devices/popp.js +10 -0
  203. package/devices/profalux.js +47 -0
  204. package/devices/prolight.js +54 -0
  205. package/devices/qmotion.js +33 -0
  206. package/devices/qoto.js +113 -0
  207. package/devices/quotra.js +18 -0
  208. package/devices/rademacher.js +18 -0
  209. package/devices/rgb_genie.js +119 -0
  210. package/devices/robb.js +335 -0
  211. package/devices/roome.js +15 -0
  212. package/devices/rtx.js +90 -0
  213. package/devices/salus_controls.js +137 -0
  214. package/devices/samotech.js +93 -0
  215. package/devices/saswell.js +58 -0
  216. package/devices/scanproducts.js +32 -0
  217. package/devices/schlage.js +24 -0
  218. package/devices/schneider_electric.js +1039 -0
  219. package/devices/schwaiger.js +62 -0
  220. package/devices/seastar_intelligence.js +16 -0
  221. package/devices/securifi.js +39 -0
  222. package/devices/sengled.js +332 -0
  223. package/devices/sercomm.js +140 -0
  224. package/devices/shenzhen_homa.js +53 -0
  225. package/devices/shinasystem.js +686 -0
  226. package/devices/siglis.js +440 -0
  227. package/devices/sinope.js +1257 -0
  228. package/devices/siterwell.js +46 -0
  229. package/devices/skydance.js +112 -0
  230. package/devices/slv.js +27 -0
  231. package/devices/smart9.js +27 -0
  232. package/devices/smart_home_pty.js +18 -0
  233. package/devices/smartenit.js +42 -0
  234. package/devices/smartthings.js +495 -0
  235. package/devices/smartwings.js +24 -0
  236. package/devices/sohan_electric.js +13 -0
  237. package/devices/solaredge.js +11 -0
  238. package/devices/somgoms.js +47 -0
  239. package/devices/sonoff.js +262 -0
  240. package/devices/spotmau.js +36 -0
  241. package/devices/sprut.js +317 -0
  242. package/devices/stelpro.js +216 -0
  243. package/devices/sunricher.js +625 -0
  244. package/devices/swann.js +33 -0
  245. package/devices/sylvania.js +200 -0
  246. package/devices/tci.js +25 -0
  247. package/devices/technicolor.js +47 -0
  248. package/devices/terncy.js +64 -0
  249. package/devices/the_light_group.js +70 -0
  250. package/devices/third_reality.js +195 -0
  251. package/devices/titan_products.js +22 -0
  252. package/devices/tplink.js +42 -0
  253. package/devices/trust.js +114 -0
  254. package/devices/tubeszb.js +20 -0
  255. package/devices/tuya.js +4215 -0
  256. package/devices/ubisys.js +938 -0
  257. package/devices/uhome.js +25 -0
  258. package/devices/universal_electronics_inc.js +119 -0
  259. package/devices/urlighting.js +12 -0
  260. package/devices/useelink.js +52 -0
  261. package/devices/vbled.js +18 -0
  262. package/devices/vesternet.js +188 -0
  263. package/devices/viessmann.js +51 -0
  264. package/devices/villeroy_boch.js +18 -0
  265. package/devices/vimar.js +78 -0
  266. package/devices/visonic.js +80 -0
  267. package/devices/vrey.js +18 -0
  268. package/devices/wally.js +25 -0
  269. package/devices/waxman.js +45 -0
  270. package/devices/weiser.js +67 -0
  271. package/devices/weten.js +13 -0
  272. package/devices/wisdom.js +11 -0
  273. package/devices/woox.js +177 -0
  274. package/devices/wyze.js +23 -0
  275. package/devices/xiaomi.js +3223 -0
  276. package/devices/xinghuoyuan.js +11 -0
  277. package/devices/yale.js +227 -0
  278. package/devices/ynoa.js +68 -0
  279. package/devices/yookee.js +23 -0
  280. package/devices/ysrsai.js +26 -0
  281. package/devices/zemismart.js +254 -0
  282. package/devices/zen.js +34 -0
  283. package/devices/zipato.js +11 -0
  284. package/index.js +242 -0
  285. package/lib/color.js +784 -0
  286. package/lib/configureKey.js +944 -0
  287. package/lib/constants.js +316 -0
  288. package/lib/exposes.js +677 -0
  289. package/lib/extend.js +180 -0
  290. package/lib/kelvinToXy.js +1912 -0
  291. package/lib/legacy.js +2223 -0
  292. package/lib/light.js +111 -0
  293. package/lib/ota/OTA_URLs.md +119 -0
  294. package/lib/ota/common.js +476 -0
  295. package/lib/ota/index.js +10 -0
  296. package/lib/ota/inovelli.js +72 -0
  297. package/lib/ota/ledvance.js +52 -0
  298. package/lib/ota/lixee.js +57 -0
  299. package/lib/ota/salus.js +82 -0
  300. package/lib/ota/securifi.js +25 -0
  301. package/lib/ota/tradfri.js +45 -0
  302. package/lib/ota/ubisys.js +61 -0
  303. package/lib/ota/zigbeeOTA.js +161 -0
  304. package/lib/philips.js +667 -0
  305. package/lib/reporting.js +234 -0
  306. package/lib/store.js +57 -0
  307. package/lib/tuya.js +2027 -0
  308. package/lib/utils.js +527 -0
  309. package/lib/xiaomi.d.ts +11 -0
  310. package/lib/xiaomi.js +1288 -0
  311. package/lib/zosung.js +243 -0
  312. package/package.json +39 -0
@@ -0,0 +1,246 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
+ const tz = require('../converters/toZigbee');
4
+ const ota = require('../lib/ota');
5
+ const reporting = require('../lib/reporting');
6
+ const constants = require('../lib/constants');
7
+ const {repInterval} = require('../lib/constants');
8
+ const e = exposes.presets;
9
+ const ea = exposes.access;
10
+
11
+ module.exports = [
12
+ {
13
+ zigbeeModel: ['PoP'],
14
+ model: 'HLU2909K',
15
+ vendor: 'Datek',
16
+ description: 'APEX smart plug 16A',
17
+ fromZigbee: [fz.on_off, fz.electrical_measurement, fz.temperature],
18
+ toZigbee: [tz.on_off, tz.power_on_behavior],
19
+ ota: ota.zigbeeOTA,
20
+ configure: async (device, coordinatorEndpoint, logger) => {
21
+ const endpoint = device.getEndpoint(1);
22
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'msTemperatureMeasurement']);
23
+ await endpoint.read('haElectricalMeasurement', ['acVoltageMultiplier', 'acVoltageDivisor']);
24
+ await endpoint.read('haElectricalMeasurement', ['acCurrentMultiplier', 'acCurrentDivisor']);
25
+ await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
26
+ await reporting.onOff(endpoint);
27
+ await reporting.rmsVoltage(endpoint);
28
+ await reporting.rmsCurrent(endpoint);
29
+ await reporting.activePower(endpoint);
30
+ await reporting.temperature(endpoint);
31
+ },
32
+ exposes: [e.power(), e.current(), e.voltage(), e.switch(), e.temperature(), e.power_on_behavior()],
33
+ },
34
+ {
35
+ zigbeeModel: ['Meter Reader'],
36
+ model: 'HSE2905E',
37
+ vendor: 'Datek',
38
+ description: 'Datek Eva AMS HAN power-meter sensor',
39
+ fromZigbee: [fz.metering_datek, fz.electrical_measurement, fz.temperature, fz.hw_version],
40
+ toZigbee: [],
41
+ ota: ota.zigbeeOTA,
42
+ configure: async (device, coordinatorEndpoint, logger) => {
43
+ const endpoint = device.getEndpoint(1);
44
+ await reporting.bind(endpoint, coordinatorEndpoint, ['haElectricalMeasurement', 'seMetering', 'msTemperatureMeasurement']);
45
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
46
+ await reporting.readMeteringMultiplierDivisor(endpoint);
47
+ try {
48
+ // hwVersion < 2 do not support hwVersion attribute, so we are testing if this is hwVersion 1 or 2
49
+ await endpoint.read('genBasic', ['hwVersion']);
50
+ } catch (e) {
51
+ e;
52
+ }
53
+ const payload = [{
54
+ attribute: 'rmsVoltagePhB',
55
+ minimumReportInterval: 60,
56
+ maximumReportInterval: 3600,
57
+ reportableChange: 0,
58
+ },
59
+ {
60
+ attribute: 'rmsVoltagePhC',
61
+ minimumReportInterval: 60,
62
+ maximumReportInterval: 3600,
63
+ reportableChange: 0,
64
+ },
65
+ {
66
+ attribute: 'rmsCurrentPhB',
67
+ minimumReportInterval: 60,
68
+ maximumReportInterval: 3600,
69
+ reportableChange: 0,
70
+ },
71
+ {
72
+ attribute: 'rmsCurrentPhC',
73
+ minimumReportInterval: 60,
74
+ maximumReportInterval: 3600,
75
+ reportableChange: 0,
76
+ }];
77
+ await endpoint.configureReporting('haElectricalMeasurement', payload);
78
+ await reporting.rmsVoltage(endpoint, {min: 60, max: 3600, change: 0});
79
+ await reporting.rmsCurrent(endpoint, {min: 60, max: 3600, change: 0});
80
+ await reporting.instantaneousDemand(endpoint, {min: 60, max: 3600, change: 0});
81
+ await reporting.currentSummDelivered(endpoint, {min: 60, max: 3600, change: [1, 1]});
82
+ await reporting.currentSummReceived(endpoint);
83
+ await reporting.temperature(endpoint, {min: 60, max: 3600, change: 0});
84
+ },
85
+ exposes: [e.power(), e.energy(), e.current(), e.voltage(), e.current_phase_b(), e.voltage_phase_b(), e.current_phase_c(),
86
+ e.voltage_phase_c(), e.temperature()],
87
+ },
88
+ {
89
+ zigbeeModel: ['Motion Sensor'],
90
+ model: 'HSE2927E',
91
+ vendor: 'Datek',
92
+ description: 'Eva motion sensor',
93
+ fromZigbee: [fz.battery, fz.occupancy, fz.occupancy_timeout, fz.illuminance, fz.temperature,
94
+ fz.ias_enroll, fz.ias_occupancy_alarm_1, fz.ias_occupancy_alarm_1_report, fz.led_on_motion],
95
+ toZigbee: [tz.occupancy_timeout, tz.led_on_motion],
96
+ configure: async (device, coordinatorEndpoint, logger) => {
97
+ const options = {manufacturerCode: 4919};
98
+ const endpoint = device.getEndpoint(1);
99
+ const binds = ['msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msOccupancySensing', 'ssIasZone'];
100
+ await reporting.bind(endpoint, coordinatorEndpoint, binds);
101
+ await reporting.occupancy(endpoint);
102
+ await reporting.temperature(endpoint);
103
+ await reporting.illuminance(endpoint);
104
+ const payload = [{
105
+ attribute: {ID: 0x4000, type: 0x10},
106
+ }];
107
+ await endpoint.configureReporting('ssIasZone', payload, options);
108
+ await endpoint.read('ssIasZone', ['iasCieAddr', 'zoneState', 'zoneId']);
109
+ await endpoint.read('msOccupancySensing', ['pirOToUDelay']);
110
+ await endpoint.read('ssIasZone', [0x4000], options);
111
+ },
112
+ exposes: [e.temperature(), e.occupancy(), e.battery_low(), e.illuminance_lux(), e.illuminance(),
113
+ exposes.binary('led_on_motion', ea.ALL, true, false).withDescription('Enable/disable LED on motion'),
114
+ exposes.numeric('occupancy_timeout', ea.ALL).withUnit('seconds').withValueMin(0).withValueMax(65535)],
115
+ },
116
+ {
117
+ zigbeeModel: ['ID Lock 150'],
118
+ model: '0402946',
119
+ vendor: 'Datek',
120
+ description: 'Zigbee module for ID lock 150',
121
+ fromZigbee: [fz.lock, fz.battery, fz.lock_operation_event, fz.lock_programming_event,
122
+ fz.idlock, fz.idlock_fw, fz.lock_pin_code_response],
123
+ toZigbee: [tz.lock, tz.lock_sound_volume, tz.idlock_master_pin_mode, tz.idlock_rfid_enable,
124
+ tz.idlock_service_mode, tz.idlock_lock_mode, tz.idlock_relock_enabled, tz.pincode_lock],
125
+ meta: {pinCodeCount: 109},
126
+ configure: async (device, coordinatorEndpoint, logger) => {
127
+ const endpoint = device.getEndpoint(1);
128
+ const options = {manufacturerCode: 4919};
129
+ await reporting.bind(endpoint, coordinatorEndpoint, ['closuresDoorLock', 'genPowerCfg']);
130
+ await reporting.lockState(endpoint);
131
+ await reporting.batteryPercentageRemaining(endpoint);
132
+ const payload = [{
133
+ attribute: {ID: 0x4000, type: 0x10},
134
+ minimumReportInterval: 0,
135
+ maximumReportInterval: repInterval.HOUR,
136
+ reportableChange: 1,
137
+ },
138
+ {
139
+ attribute: {ID: 0x4001, type: 0x10},
140
+ minimumReportInterval: 0,
141
+ maximumReportInterval: repInterval.HOUR,
142
+ reportableChange: 1,
143
+ },
144
+ {
145
+ attribute: {ID: 0x4003, type: 0x20},
146
+ minimumReportInterval: 0,
147
+ maximumReportInterval: repInterval.HOUR,
148
+ reportableChange: 1,
149
+ },
150
+ {
151
+ attribute: {ID: 0x4004, type: 0x20},
152
+ minimumReportInterval: 0,
153
+ maximumReportInterval: repInterval.HOUR,
154
+ reportableChange: 1,
155
+ },
156
+ {
157
+ attribute: {ID: 0x4005, type: 0x10},
158
+ minimumReportInterval: 0,
159
+ maximumReportInterval: repInterval.HOUR,
160
+ reportableChange: 1,
161
+ }];
162
+ await endpoint.configureReporting('closuresDoorLock', payload, options);
163
+ await endpoint.read('closuresDoorLock', ['lockState', 'soundVolume', 'doorState']);
164
+ await endpoint.read('closuresDoorLock', [0x4000, 0x4001, 0x4003, 0x4004, 0x4005], options);
165
+ await endpoint.read('genBasic', [0x5000], options);
166
+ },
167
+ onEvent: async (type, data, device) => {
168
+ // When we receive a code updated message, lets read the new value
169
+ if (data.type === 'commandProgrammingEventNotification' &&
170
+ data.cluster === 'closuresDoorLock' &&
171
+ data.data &&
172
+ data.data.userid !== undefined &&
173
+ // Don't read RF events, we can do this with retrieve_state
174
+ (data.data.programeventsrc === undefined || constants.lockSourceName[data.data.programeventsrc] != 'rf')
175
+ ) {
176
+ await device.endpoints[0].command('closuresDoorLock', 'getPinCode', {userid: data.data.userid}, {});
177
+ }
178
+ },
179
+ exposes: [e.lock(), e.battery(), e.pincode(),
180
+ e.lock_action(), e.lock_action_source_name(), e.lock_action_user(),
181
+ exposes.enum('sound_volume', ea.ALL, constants.lockSoundVolume).withDescription('Sound volume of the lock'),
182
+ exposes.binary('master_pin_mode', ea.ALL, true, false).withDescription('Allow Master PIN Unlock'),
183
+ exposes.binary('rfid_enable', ea.ALL, true, false).withDescription('Allow RFID to Unlock'),
184
+ exposes.binary('relock_enabled', ea.ALL, true, false).withDescription( 'Allow Auto Re-Lock'),
185
+ exposes.enum('lock_mode', ea.ALL, ['auto_off_away_off', 'auto_on_away_off', 'auto_off_away_on',
186
+ 'auto_on_away_on']).withDescription('Lock-Mode of the Lock'),
187
+ exposes.enum('service_mode', ea.ALL, ['deactivated', 'random_pin_1x_use',
188
+ 'random_pin_24_hours']).withDescription('Service Mode of the Lock')],
189
+ },
190
+ {
191
+ zigbeeModel: ['Water Sensor'],
192
+ model: 'HSE2919E',
193
+ vendor: 'Datek',
194
+ description: 'Eva water leak sensor',
195
+ fromZigbee: [fz.temperature, fz.battery, fz.ias_enroll, fz.ias_water_leak_alarm_1, fz.ias_water_leak_alarm_1_report],
196
+ toZigbee: [],
197
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
198
+ configure: async (device, coordinatorEndpoint, logger) => {
199
+ const endpoint = device.getEndpoint(1);
200
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'genBasic', 'ssIasZone']);
201
+ await reporting.batteryVoltage(endpoint);
202
+ await endpoint.read('ssIasZone', ['iasCieAddr', 'zoneState', 'zoneId']);
203
+
204
+ const endpoint2 = device.getEndpoint(2);
205
+ await reporting.bind(endpoint2, coordinatorEndpoint, ['msTemperatureMeasurement']);
206
+ },
207
+ endpoint: (device) => {
208
+ return {default: 1};
209
+ },
210
+ exposes: [e.battery(), e.battery_low(), e.temperature(), e.water_leak(), e.tamper()],
211
+ },
212
+ {
213
+ zigbeeModel: ['Scene Selector', 'SSDS'],
214
+ model: 'HBR2917E',
215
+ vendor: 'Datek',
216
+ description: 'Eva scene selector',
217
+ fromZigbee: [fz.temperature, fz.battery, fz.command_recall, fz.command_on, fz.command_off, fz.command_move, fz.command_stop],
218
+ toZigbee: [tz.on_off],
219
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
220
+ configure: async (device, coordinatorEndpoint, logger) => {
221
+ const endpoint = device.getEndpoint(1);
222
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'genBasic', 'genOnOff',
223
+ 'genLevelCtrl', 'msTemperatureMeasurement']);
224
+ await reporting.batteryVoltage(endpoint);
225
+ await reporting.temperature(endpoint, {min: constants.repInterval.MINUTES_10, max: constants.repInterval.HOUR, change: 100});
226
+ },
227
+ exposes: [e.battery(), e.temperature(),
228
+ e.action(['recall_1', 'recall_2', 'recall_3', 'recall_4', 'on', 'off',
229
+ 'brightness_move_down', 'brightness_move_up', 'brightness_stop'])],
230
+ },
231
+ {
232
+ zigbeeModel: ['Door/Window Sensor'],
233
+ model: 'HSE2920E',
234
+ vendor: 'Datek',
235
+ description: 'Door/window sensor',
236
+ fromZigbee: [fz.ias_contact_alarm_1, fz.ias_contact_alarm_1_report, fz.temperature, fz.ias_enroll],
237
+ toZigbee: [],
238
+ configure: async (device, coordinatorEndpoint, logger) => {
239
+ const endpoint = device.getEndpoint(1);
240
+ await reporting.bind(endpoint, coordinatorEndpoint, ['ssIasZone', 'msTemperatureMeasurement']);
241
+ await reporting.temperature(endpoint);
242
+ await endpoint.read('ssIasZone', ['iasCieAddr', 'zoneState', 'zoneId']);
243
+ },
244
+ exposes: [e.contact(), e.battery_low(), e.tamper(), e.temperature()],
245
+ },
246
+ ];
@@ -0,0 +1,338 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
+ const tz = require('../converters/toZigbee');
4
+ const reporting = require('../lib/reporting');
5
+ const extend = require('../lib/extend');
6
+ const e = exposes.presets;
7
+ const ea = exposes.access;
8
+
9
+ const fzLocal = {
10
+ dawon_card_holder: {
11
+ cluster: 'ssIasZone',
12
+ type: 'commandStatusChangeNotification',
13
+ convert: (model, msg, publish, options, meta) => {
14
+ const zoneStatus = msg.data.zonestatus;
15
+ return {
16
+ card: (zoneStatus & 1) > 0,
17
+ battery_low: (zoneStatus & 1<<3) > 0,
18
+ };
19
+ },
20
+ },
21
+ };
22
+
23
+
24
+ const tzLocal = {
25
+ dawon_card_holder: {
26
+ key: ['card'],
27
+ convertGet: async (entity, key, meta) => {
28
+ await entity.read('ssIasZone', ['zoneState']);
29
+ },
30
+ },
31
+ };
32
+
33
+ module.exports = [
34
+ {
35
+ zigbeeModel: ['PM-C140-ZB'],
36
+ model: 'PM-C140-ZB',
37
+ vendor: 'Dawon DNS',
38
+ description: 'IOT remote control smart buried-type outlet',
39
+ fromZigbee: [fz.on_off, fz.metering],
40
+ toZigbee: [tz.on_off, tz.metering_power, tz.currentsummdelivered],
41
+ configure: async (device, coordinatorEndpoint, logger) => {
42
+ const endpoint = device.getEndpoint(1);
43
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
44
+ await reporting.onOff(endpoint);
45
+ await reporting.readMeteringMultiplierDivisor(endpoint);
46
+ await reporting.instantaneousDemand(endpoint);
47
+ await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
48
+ },
49
+ exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)],
50
+ },
51
+ {
52
+ zigbeeModel: ['PM-B530-ZB'],
53
+ model: 'PM-B530-ZB',
54
+ vendor: 'Dawon DNS',
55
+ description: 'IOT smart plug 16A',
56
+ fromZigbee: [fz.on_off, fz.metering],
57
+ toZigbee: [tz.on_off, tz.metering_power, tz.currentsummdelivered],
58
+ configure: async (device, coordinatorEndpoint, logger) => {
59
+ const endpoint = device.getEndpoint(1);
60
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
61
+ await reporting.onOff(endpoint);
62
+ await reporting.readMeteringMultiplierDivisor(endpoint);
63
+ await reporting.instantaneousDemand(endpoint);
64
+ await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
65
+ },
66
+ exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)],
67
+ },
68
+ {
69
+ zigbeeModel: ['PM-B540-ZB'],
70
+ model: 'PM-B540-ZB',
71
+ vendor: 'Dawon DNS',
72
+ description: 'IOT smart plug 16A',
73
+ fromZigbee: [fz.device_temperature, fz.on_off, fz.metering],
74
+ toZigbee: [tz.on_off, tz.metering_power, tz.currentsummdelivered],
75
+ configure: async (device, coordinatorEndpoint, logger) => {
76
+ const endpoint = device.getEndpoint(1);
77
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering', 'genDeviceTempCfg']);
78
+ await reporting.onOff(endpoint);
79
+ await reporting.readMeteringMultiplierDivisor(endpoint);
80
+ await reporting.instantaneousDemand(endpoint);
81
+ await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
82
+ await reporting.deviceTemperature(endpoint);
83
+ // some firmware is not defined powersource
84
+ if (device.powerSource === 'Unknown') {
85
+ device.powerSource = 'Mains (single phase)';
86
+ device.save();
87
+ }
88
+ },
89
+ exposes: [e.device_temperature(), e.switch(), e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)],
90
+ },
91
+ {
92
+ zigbeeModel: ['PM-B430-ZB'],
93
+ model: 'PM-B430-ZB',
94
+ vendor: 'Dawon DNS',
95
+ description: 'IOT smart plug 10A',
96
+ fromZigbee: [fz.on_off, fz.metering],
97
+ toZigbee: [tz.on_off],
98
+ configure: async (device, coordinatorEndpoint, logger) => {
99
+ const endpoint = device.getEndpoint(1);
100
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
101
+ await reporting.onOff(endpoint);
102
+ await reporting.readMeteringMultiplierDivisor(endpoint);
103
+ await reporting.instantaneousDemand(endpoint);
104
+ },
105
+ exposes: [e.switch(), e.power(), e.energy()],
106
+ },
107
+ {
108
+ zigbeeModel: ['PM-S140-ZB'],
109
+ model: 'PM-S140-ZB',
110
+ vendor: 'Dawon DNS',
111
+ description: 'IOT smart switch 1 gang without neutral wire',
112
+ extend: extend.switch({disablePowerOnBehavior: true}),
113
+ configure: async (device, coordinatorEndpoint, logger) => {
114
+ const endpoint = device.getEndpoint(1);
115
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
116
+ await reporting.onOff(endpoint);
117
+ },
118
+ },
119
+ {
120
+ zigbeeModel: ['PM-S240-ZB'],
121
+ model: 'PM-S240-ZB',
122
+ vendor: 'Dawon DNS',
123
+ description: 'IOT smart switch 2 gang without neutral wire',
124
+ extend: extend.switch(),
125
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('bottom')],
126
+ endpoint: (device) => {
127
+ return {top: 1, bottom: 2};
128
+ },
129
+ meta: {multiEndpoint: true},
130
+ configure: async (device, coordinatorEndpoint, logger) => {
131
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
132
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
133
+ await reporting.onOff(device.getEndpoint(1));
134
+ await reporting.onOff(device.getEndpoint(2));
135
+ },
136
+ },
137
+ {
138
+ zigbeeModel: ['PM-S340-ZB'],
139
+ model: 'PM-S340-ZB',
140
+ vendor: 'Dawon DNS',
141
+ description: 'IOT smart switch 3 gang without neutral wire',
142
+ extend: extend.switch(),
143
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('center'), e.switch().withEndpoint('bottom')],
144
+ endpoint: (device) => {
145
+ return {top: 1, center: 2, bottom: 3};
146
+ },
147
+ meta: {multiEndpoint: true},
148
+ configure: async (device, coordinatorEndpoint, logger) => {
149
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
150
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
151
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
152
+ await reporting.onOff(device.getEndpoint(1));
153
+ await reporting.onOff(device.getEndpoint(2));
154
+ await reporting.onOff(device.getEndpoint(3));
155
+ },
156
+ },
157
+ {
158
+ zigbeeModel: ['PM-S140R-ZB'],
159
+ model: 'PM-S140R-ZB',
160
+ vendor: 'Dawon DNS',
161
+ description: 'IOT smart switch 1 gang router without neutral wire',
162
+ extend: extend.switch({disablePowerOnBehavior: true}),
163
+ configure: async (device, coordinatorEndpoint, logger) => {
164
+ const endpoint = device.getEndpoint(1);
165
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
166
+ await reporting.onOff(endpoint);
167
+ },
168
+ },
169
+ {
170
+ zigbeeModel: ['PM-S240R-ZB'],
171
+ model: 'PM-S240R-ZB',
172
+ vendor: 'Dawon DNS',
173
+ description: 'IOT smart switch 2 gang without neutral wire',
174
+ extend: extend.switch(),
175
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('bottom')],
176
+ endpoint: (device) => {
177
+ return {top: 1, bottom: 2};
178
+ },
179
+ meta: {multiEndpoint: true},
180
+ configure: async (device, coordinatorEndpoint, logger) => {
181
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
182
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
183
+ await reporting.onOff(device.getEndpoint(1));
184
+ await reporting.onOff(device.getEndpoint(2));
185
+ },
186
+ },
187
+ {
188
+ zigbeeModel: ['PM-S340R-ZB'],
189
+ model: 'PM-S340R-ZB',
190
+ vendor: 'Dawon DNS',
191
+ description: 'IOT smart switch 3 gang without neutral wire',
192
+ extend: extend.switch(),
193
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('center'), e.switch().withEndpoint('bottom')],
194
+ endpoint: (device) => {
195
+ return {top: 1, center: 2, bottom: 3};
196
+ },
197
+ meta: {multiEndpoint: true},
198
+ configure: async (device, coordinatorEndpoint, logger) => {
199
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
200
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
201
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
202
+ await reporting.onOff(device.getEndpoint(1));
203
+ await reporting.onOff(device.getEndpoint(2));
204
+ await reporting.onOff(device.getEndpoint(3));
205
+ },
206
+ },
207
+ {
208
+ zigbeeModel: ['PM-S150-ZB'],
209
+ model: 'PM-S150-ZB',
210
+ vendor: 'Dawon DNS',
211
+ description: 'IOT smart switch 1 gang router without neutral wire',
212
+ extend: extend.switch({disablePowerOnBehavior: true}),
213
+ configure: async (device, coordinatorEndpoint, logger) => {
214
+ const endpoint = device.getEndpoint(1);
215
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
216
+ await reporting.onOff(endpoint);
217
+ // some firmware is not defined powersource
218
+ if (device.powerSource === 'Unknown') {
219
+ device.powerSource = 'Mains (single phase)';
220
+ device.save();
221
+ }
222
+ },
223
+ },
224
+ {
225
+ zigbeeModel: ['PM-S250-ZB'],
226
+ model: 'PM-S250-ZB',
227
+ vendor: 'Dawon DNS',
228
+ description: 'IOT smart switch 2 gang without neutral wire',
229
+ extend: extend.switch(),
230
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('bottom')],
231
+ endpoint: (device) => {
232
+ return {top: 1, bottom: 2};
233
+ },
234
+ meta: {multiEndpoint: true},
235
+ configure: async (device, coordinatorEndpoint, logger) => {
236
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
237
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
238
+ await reporting.onOff(device.getEndpoint(1));
239
+ await reporting.onOff(device.getEndpoint(2));
240
+ // some firmware is not defined powersource
241
+ if (device.powerSource === 'Unknown') {
242
+ device.powerSource = 'Mains (single phase)';
243
+ device.save();
244
+ }
245
+ },
246
+ },
247
+ {
248
+ zigbeeModel: ['PM-S350-ZB'],
249
+ model: 'PM-S350-ZB',
250
+ vendor: 'Dawon DNS',
251
+ description: 'IOT smart switch 3 gang without neutral wire',
252
+ extend: extend.switch(),
253
+ exposes: [e.switch().withEndpoint('top'), e.switch().withEndpoint('center'), e.switch().withEndpoint('bottom')],
254
+ endpoint: (device) => {
255
+ return {top: 1, center: 2, bottom: 3};
256
+ },
257
+ meta: {multiEndpoint: true},
258
+ configure: async (device, coordinatorEndpoint, logger) => {
259
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
260
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
261
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
262
+ await reporting.onOff(device.getEndpoint(1));
263
+ await reporting.onOff(device.getEndpoint(2));
264
+ await reporting.onOff(device.getEndpoint(3));
265
+ // some firmware is not defined powersource
266
+ if (device.powerSource === 'Unknown') {
267
+ device.powerSource = 'Mains (single phase)';
268
+ device.save();
269
+ }
270
+ },
271
+ },
272
+ {
273
+ zigbeeModel: ['PM-C150-ZB'],
274
+ model: 'PM-C150-ZB',
275
+ vendor: 'Dawon DNS',
276
+ description: 'IOT remote control smart buried-type 16A outlet',
277
+ fromZigbee: [fz.on_off, fz.metering],
278
+ toZigbee: [tz.on_off, tz.metering_power, tz.currentsummdelivered],
279
+ configure: async (device, coordinatorEndpoint, logger) => {
280
+ const endpoint = device.getEndpoint(1);
281
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
282
+ await reporting.onOff(endpoint);
283
+ await reporting.readMeteringMultiplierDivisor(endpoint);
284
+ await reporting.instantaneousDemand(endpoint);
285
+ await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
286
+ },
287
+ exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)],
288
+ },
289
+ {
290
+ zigbeeModel: ['SG-V100-ZB'],
291
+ model: 'SG-V100-ZB',
292
+ vendor: 'Dawon DNS',
293
+ description: 'IOT remote control smart gas lock',
294
+ fromZigbee: [fz.on_off, fz.battery],
295
+ toZigbee: [tz.dawondns_only_off], // Only support 'Off' command
296
+ configure: async (device, coordinatorEndpoint, logger) => {
297
+ const endpoint = device.getEndpoint(1);
298
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genPowerCfg']);
299
+ await reporting.onOff(endpoint);
300
+ await reporting.batteryPercentageRemaining(endpoint);
301
+ },
302
+ exposes: [e.battery(), e.switch()],
303
+ },
304
+ {
305
+ zigbeeModel: ['KB-HD100-ZB'],
306
+ model: 'KB-HD100-ZB',
307
+ vendor: 'Dawon DNS',
308
+ description: 'IOT Card holder',
309
+ fromZigbee: [fzLocal.dawon_card_holder],
310
+ toZigbee: [tzLocal.dawon_card_holder],
311
+ configure: async (device, coordinatorEndpoint, logger) => {
312
+ const endpoint = device.getEndpoint(1);
313
+ await reporting.bind(endpoint, coordinatorEndpoint, ['ssIasZone']);
314
+ const payload = [{
315
+ attribute: 'zoneState', minimumReportInterval: 0, maximumReportInterval: 3600, reportableChange: 0}];
316
+ await endpoint.configureReporting('ssIasZone', payload);
317
+ },
318
+ exposes: [exposes.binary('card', ea.STATE, true, false).withAccess(ea.STATE_GET)
319
+ .withDescription('Indicates if the card is inserted (= true) or not (= false)'), e.battery_low()],
320
+ },
321
+ {
322
+ zigbeeModel: ['KB-B540R-ZB'],
323
+ model: 'KB-B540R-ZB',
324
+ vendor: 'Dawon DNS',
325
+ description: 'IOT smart plug 16A',
326
+ fromZigbee: [fz.on_off, fz.metering],
327
+ toZigbee: [tz.on_off, tz.metering_power, tz.currentsummdelivered],
328
+ configure: async (device, coordinatorEndpoint, logger) => {
329
+ const endpoint = device.getEndpoint(1);
330
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
331
+ await reporting.onOff(endpoint);
332
+ await reporting.readMeteringMultiplierDivisor(endpoint);
333
+ await reporting.instantaneousDemand(endpoint);
334
+ await reporting.currentSummDelivered(endpoint, {min: 10, max: 3600, change: 5});
335
+ },
336
+ exposes: [e.switch(), e.power().withAccess(ea.STATE_GET), e.energy().withAccess(ea.STATE_GET)],
337
+ },
338
+ ];