@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,625 @@
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 globalStore = require('../lib/store');
6
+ const constants = require('../lib/constants');
7
+ const extend = require('../lib/extend');
8
+ const utils = require('../lib/utils');
9
+ const e = exposes.presets;
10
+ const ea = exposes.access;
11
+
12
+ const fzLocal = {
13
+ sunricher_SRZGP2801K45C: {
14
+ cluster: 'greenPower',
15
+ type: ['commandNotification', 'commandCommisioningNotification'],
16
+ convert: (model, msg, publish, options, meta) => {
17
+ const commandID = msg.data.commandID;
18
+ if (utils.hasAlreadyProcessedMessage(msg, model, msg.data.frameCounter, `${msg.device.ieeeAddr}_${commandID}`)) return;
19
+ if (commandID === 224) return;
20
+ const lookup = {
21
+ 0x21: 'press_on',
22
+ 0x20: 'press_off',
23
+ 0x37: 'press_high',
24
+ 0x38: 'press_low',
25
+ 0x35: 'hold_high',
26
+ 0x36: 'hold_low',
27
+ 0x34: 'high_low_release',
28
+ 0x63: 'cw_ww_release',
29
+ 0x62: 'cw_dec_ww_inc',
30
+ 0x64: 'ww_inc_cw_dec',
31
+ 0x41: 'r_g_b',
32
+ 0x42: 'b_g_r',
33
+ 0x40: 'rgb_release',
34
+ };
35
+ if (!lookup.hasOwnProperty(commandID)) {
36
+ meta.logger.error(`Sunricher: missing command '0x${commandID.toString(16)}'`);
37
+ } else {
38
+ return {action: lookup[commandID]};
39
+ }
40
+ },
41
+ },
42
+ };
43
+
44
+ async function syncTime(endpoint) {
45
+ try {
46
+ const time = Math.round(((new Date()).getTime() - constants.OneJanuary2000) / 1000 + ((new Date()).getTimezoneOffset() * -1) * 60);
47
+ const values = {time: time};
48
+ await endpoint.write('genTime', values);
49
+ } catch (error) {/* Do nothing*/}
50
+ }
51
+
52
+ module.exports = [
53
+ {
54
+ zigbeeModel: ['SR-ZG9023A-EU'],
55
+ model: 'SR-ZG9023A-EU',
56
+ vendor: 'Sunricher',
57
+ description: '4 ports switch with 2 usb ports (no metering)',
58
+ extend: extend.switch(),
59
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'),
60
+ e.switch().withEndpoint('l3'), e.switch().withEndpoint('l4'), e.switch().withEndpoint('l5')],
61
+ endpoint: (device) => {
62
+ return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4, 'l5': 5};
63
+ },
64
+ meta: {multiEndpoint: true},
65
+ configure: async (device, coordinatorEndpoint, logger) => {
66
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
67
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
68
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
69
+ await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
70
+ await reporting.bind(device.getEndpoint(5), coordinatorEndpoint, ['genOnOff']);
71
+ },
72
+ },
73
+ {
74
+ zigbeeModel: ['ON/OFF(2CH)'],
75
+ model: 'UP-SA-9127D',
76
+ vendor: 'Sunricher',
77
+ description: 'LED-trading 2 channel AC switch',
78
+ extend: extend.switch(),
79
+ exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2')],
80
+ endpoint: (device) => {
81
+ return {'l1': 1, 'l2': 2};
82
+ },
83
+ meta: {multiEndpoint: true},
84
+ configure: async (device, coordinatorEndpoint, logger) => {
85
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
86
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
87
+ },
88
+ },
89
+ {
90
+ zigbeeModel: ['HK-ZD-CCT-A'],
91
+ model: 'HK-ZD-CCT-A',
92
+ vendor: 'Sunricher',
93
+ description: '50W Zigbee CCT LED driver (constant current)',
94
+ extend: extend.light_onoff_brightness_colortemp({colorTempRange: [160, 450]}),
95
+ },
96
+ {
97
+ zigbeeModel: ['ZGRC-KEY-004'],
98
+ model: 'SR-ZG9001K2-DIM',
99
+ vendor: 'Sunricher',
100
+ description: 'Zigbee wall remote control for single color, 1 zone',
101
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery],
102
+ toZigbee: [],
103
+ exposes: [e.battery(), e.action(['on', 'off',
104
+ 'brightness_move_up', 'brightness_move_down', 'brightness_move_stop'])],
105
+ },
106
+ {
107
+ zigbeeModel: ['ZGRC-KEY-007'],
108
+ model: 'SR-ZG9001K2-DIM2',
109
+ vendor: 'Sunricher',
110
+ description: 'Zigbee 2 button wall switch',
111
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery],
112
+ exposes: [e.battery(), e.action([
113
+ 'on_1', 'off_1', 'stop_1', 'brightness_move_up_1', 'brightness_move_down_1', 'brightness_stop_1',
114
+ 'on_2', 'off_2', 'stop_2', 'brightness_move_up_2', 'brightness_move_down_2', 'brightness_stop_2'])],
115
+ toZigbee: [],
116
+ meta: {multiEndpoint: true},
117
+ },
118
+ {
119
+ zigbeeModel: ['ZGRC-KEY-009'],
120
+ model: '50208693',
121
+ vendor: 'Sunricher',
122
+ description: 'Zigbee wall remote control for RGBW, 1 zone with 2 scenes',
123
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery,
124
+ fz.command_recall, fz.command_step, fz.command_move_to_color, fz.command_move_to_color_temp],
125
+ toZigbee: [],
126
+ exposes: [e.battery(), e.action(['on', 'off',
127
+ 'brightness_move_up', 'brightness_move_down', 'brightness_move_stop', 'brightness_step_up', 'brightness_step_down',
128
+ 'recall_1', 'recall_2'])],
129
+ },
130
+ {
131
+ zigbeeModel: ['ZGRC-KEY-012'],
132
+ model: 'SR-ZG9001K12-DIM-Z5',
133
+ vendor: 'Sunricher',
134
+ description: '5 zone remote and dimmer',
135
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move, fz.command_stop, fz.battery],
136
+ toZigbee: [],
137
+ exposes: [e.battery(), e.action([
138
+ 'on_1', 'off_1', 'brightness_move_up_1', 'brightness_move_down_1', 'brightness_stop_1',
139
+ 'on_2', 'off_2', 'brightness_move_up_2', 'brightness_move_down_2', 'brightness_stop_2',
140
+ 'on_3', 'off_3', 'brightness_move_up_3', 'brightness_move_down_3', 'brightness_stop_3',
141
+ 'on_4', 'off_4', 'brightness_move_up_4', 'brightness_move_down_4', 'brightness_stop_4',
142
+ 'on_5', 'off_5', 'brightness_move_up_5', 'brightness_move_down_5', 'brightness_stop_5'])],
143
+ meta: {multiEndpoint: true, battery: {dontDividePercentage: true}},
144
+ configure: async (device, coordinatorEndpoint, logger) => {
145
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
146
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
147
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
148
+ await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
149
+ await reporting.bind(device.getEndpoint(5), coordinatorEndpoint, ['genOnOff']);
150
+ },
151
+ },
152
+ {
153
+ zigbeeModel: ['ZGRC-KEY-013'],
154
+ model: 'SR-ZG9001K12-DIM-Z4',
155
+ vendor: 'Sunricher',
156
+ description: '4 zone remote and dimmer',
157
+ fromZigbee: [fz.battery, fz.command_move, fz.legacy.ZGRC013_brightness_onoff,
158
+ fz.legacy.ZGRC013_brightness, fz.command_stop, fz.legacy.ZGRC013_brightness_stop, fz.command_on,
159
+ fz.legacy.ZGRC013_cmdOn, fz.command_off, fz.legacy.ZGRC013_cmdOff, fz.command_recall],
160
+ exposes: [e.battery(), e.action(['brightness_move_up', 'brightness_move_down', 'brightness_stop', 'on', 'off', 'recall_*'])],
161
+ toZigbee: [],
162
+ whiteLabel: [{vendor: 'RGB Genie', model: 'ZGRC-KEY-013'}],
163
+ meta: {multiEndpoint: true, battery: {dontDividePercentage: true}},
164
+ configure: async (device, coordinatorEndpoint, logger) => {
165
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff', 'genScenes']);
166
+ await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
167
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
168
+ await reporting.bind(device.getEndpoint(4), coordinatorEndpoint, ['genOnOff']);
169
+ },
170
+ },
171
+ {
172
+ zigbeeModel: ['ZGRC-TEUR-005'],
173
+ model: 'SR-ZG9001T4-DIM-EU',
174
+ vendor: 'Sunricher',
175
+ description: 'Zigbee wireless touch dimmer switch',
176
+ fromZigbee: [fz.command_recall, fz.command_on, fz.command_off, fz.command_step, fz.command_move, fz.command_stop],
177
+ exposes: [e.action(['recall_*', 'on', 'off', 'brightness_stop', 'brightness_move_down', 'brightness_move_up',
178
+ 'brightness_step_down', 'brightness_step_up'])],
179
+ toZigbee: [],
180
+ },
181
+ {
182
+ zigbeeModel: ['CCT Lighting'],
183
+ model: 'ZG192910-4',
184
+ vendor: 'Sunricher',
185
+ description: 'Zigbee LED-controller',
186
+ extend: extend.light_onoff_brightness_colortemp(),
187
+ },
188
+ {
189
+ zigbeeModel: ['ZG9101SAC-HP'],
190
+ model: 'ZG9101SAC-HP',
191
+ vendor: 'Sunricher',
192
+ description: 'ZigBee AC phase-cut dimmer',
193
+ extend: extend.light_onoff_brightness({noConfigure: true}),
194
+ configure: async (device, coordinatorEndpoint, logger) => {
195
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
196
+ const endpoint = device.getEndpoint(1);
197
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
198
+ await reporting.onOff(endpoint);
199
+ },
200
+ },
201
+ {
202
+ zigbeeModel: ['ON/OFF -M', 'ON/OFF', 'ZIGBEE-SWITCH'],
203
+ model: 'ZG9101SAC-HP-Switch',
204
+ vendor: 'Sunricher',
205
+ description: 'Zigbee AC in wall switch',
206
+ extend: extend.switch(),
207
+ configure: async (device, coordinatorEndpoint, logger) => {
208
+ const endpoint = device.getEndpoint(1) || device.getEndpoint(3);
209
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
210
+ await reporting.onOff(endpoint);
211
+ },
212
+ },
213
+ {
214
+ zigbeeModel: ['Micro Smart Dimmer', 'SM311', 'HK-SL-RDIM-A', 'HK-SL-DIM-EU-A'],
215
+ model: 'ZG2835RAC',
216
+ vendor: 'Sunricher',
217
+ description: 'ZigBee knob smart dimmer',
218
+ fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.electrical_measurement, fz.metering, fz.ignore_genOta]),
219
+ toZigbee: extend.light_onoff_brightness().toZigbee,
220
+ exposes: [e.light_brightness(), e.power(), e.voltage(), e.current(), e.energy()],
221
+ whiteLabel: [{vendor: 'YPHIX', model: '50208695'}, {vendor: 'Samotech', model: 'SM311'}],
222
+ configure: async (device, coordinatorEndpoint, logger) => {
223
+ const endpoint = device.getEndpoint(1);
224
+ const binds = ['genOnOff', 'genLevelCtrl', 'haElectricalMeasurement', 'seMetering'];
225
+ await reporting.bind(endpoint, coordinatorEndpoint, binds);
226
+ await reporting.onOff(endpoint);
227
+ await reporting.brightness(endpoint);
228
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
229
+ await reporting.activePower(endpoint);
230
+ await reporting.rmsCurrent(endpoint, {min: 10, change: 10});
231
+ await reporting.rmsVoltage(endpoint, {min: 10});
232
+ await reporting.readMeteringMultiplierDivisor(endpoint);
233
+ await reporting.currentSummDelivered(endpoint);
234
+ },
235
+ },
236
+ {
237
+ zigbeeModel: ['ZG2835'],
238
+ model: 'ZG2835',
239
+ vendor: 'Sunricher',
240
+ description: 'ZigBee knob smart dimmer',
241
+ fromZigbee: [fz.command_on, fz.command_off, fz.command_move_to_level],
242
+ exposes: [e.action(['on', 'off', 'brightness_move_to_level'])],
243
+ toZigbee: [],
244
+ },
245
+ {
246
+ zigbeeModel: ['HK-SL-DIM-A'],
247
+ model: 'SR-ZG9040A',
248
+ vendor: 'Sunricher',
249
+ description: 'Zigbee micro smart dimmer',
250
+ fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.electrical_measurement, fz.metering, fz.ignore_genOta]),
251
+ toZigbee: extend.light_onoff_brightness().toZigbee,
252
+ exposes: [e.light_brightness(), e.power(), e.voltage(), e.current(), e.energy()],
253
+ configure: async (device, coordinatorEndpoint, logger) => {
254
+ const endpoint = device.getEndpoint(1);
255
+ const binds = ['genOnOff', 'genLevelCtrl', 'haElectricalMeasurement', 'seMetering'];
256
+ await reporting.bind(endpoint, coordinatorEndpoint, binds);
257
+ await reporting.onOff(endpoint);
258
+ await reporting.brightness(endpoint);
259
+ await reporting.readEletricalMeasurementMultiplierDivisors(endpoint);
260
+ await reporting.activePower(endpoint);
261
+ await reporting.rmsCurrent(endpoint, {min: 10, change: 10});
262
+ await reporting.rmsVoltage(endpoint, {min: 10});
263
+ await reporting.readMeteringMultiplierDivisor(endpoint);
264
+ await reporting.currentSummDelivered(endpoint);
265
+ },
266
+ },
267
+ {
268
+ zigbeeModel: ['HK-ZD-DIM-A'],
269
+ model: 'SRP-ZG9105-CC',
270
+ vendor: 'Sunricher',
271
+ description: 'Constant Current Zigbee LED dimmable driver',
272
+ extend: extend.light_onoff_brightness(),
273
+ },
274
+ {
275
+ zigbeeModel: ['HK-DIM'],
276
+ model: '50208702',
277
+ vendor: 'Sunricher',
278
+ description: 'LED dimmable driver',
279
+ extend: extend.light_onoff_brightness(),
280
+ whiteLabel: [{vendor: 'Yphix', model: '50208702'}],
281
+ },
282
+ {
283
+ zigbeeModel: ['SR-ZG9040A-S'],
284
+ model: 'SR-ZG9040A-S',
285
+ vendor: 'Sunricher',
286
+ description: 'ZigBee AC phase-cut dimmer single-line',
287
+ extend: extend.light_onoff_brightness({noConfigure: true}),
288
+ configure: async (device, coordinatorEndpoint, logger) => {
289
+ await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
290
+ const endpoint = device.getEndpoint(1);
291
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
292
+ await reporting.onOff(endpoint);
293
+ },
294
+ },
295
+ {
296
+ zigbeeModel: ['Micro Smart OnOff', 'HK-SL-RELAY-A'],
297
+ model: 'SR-ZG9100A-S',
298
+ vendor: 'Sunricher',
299
+ description: 'Zigbee AC in wall switch single-line',
300
+ extend: extend.switch(),
301
+ configure: async (device, coordinatorEndpoint, logger) => {
302
+ const endpoint = device.getEndpoint(1) || device.getEndpoint(3);
303
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
304
+ await reporting.onOff(endpoint);
305
+ },
306
+ },
307
+ {
308
+ zigbeeModel: ['ZG2819S-CCT'],
309
+ model: 'ZG2819S-CCT',
310
+ vendor: 'Sunricher',
311
+ description: 'Zigbee handheld remote CCT 4 channels',
312
+ fromZigbee: [fz.battery, fz.command_move_to_color, fz.command_move_to_color_temp, fz.command_move_hue,
313
+ fz.command_step, fz.command_recall, fz.command_on, fz.command_off, fz.command_toggle, fz.command_stop,
314
+ fz.command_move, fz.command_color_loop_set, fz.command_ehanced_move_to_hue_and_saturation],
315
+ exposes: [e.battery(), e.action([
316
+ 'color_move', 'color_temperature_move', 'hue_move', 'brightness_step_up', 'brightness_step_down',
317
+ 'recall_*', 'on', 'off', 'toggle', 'brightness_stop', 'brightness_move_up', 'brightness_move_down',
318
+ 'color_loop_set', 'enhanced_move_to_hue_and_saturation', 'hue_stop'])],
319
+ toZigbee: [],
320
+ meta: {multiEndpoint: true},
321
+ endpoint: (device) => {
322
+ return {ep1: 1, ep2: 2, ep3: 3, ep4: 4};
323
+ },
324
+ },
325
+ {
326
+ zigbeeModel: ['ZG2858A'],
327
+ model: 'ZG2858A',
328
+ vendor: 'Sunricher',
329
+ description: 'Zigbee handheld remote RGBCCT 3 channels',
330
+ fromZigbee: [fz.battery, fz.command_move_to_color, fz.command_move_to_color_temp, fz.command_move_hue,
331
+ fz.command_step, fz.command_recall, fz.command_on, fz.command_off, fz.command_toggle, fz.command_stop,
332
+ fz.command_move, fz.command_color_loop_set, fz.command_ehanced_move_to_hue_and_saturation],
333
+ exposes: [e.battery(), e.action([
334
+ 'color_move', 'color_temperature_move', 'hue_move', 'brightness_step_up', 'brightness_step_down',
335
+ 'recall_*', 'on', 'off', 'toggle', 'brightness_stop', 'brightness_move_up', 'brightness_move_down',
336
+ 'color_loop_set', 'enhanced_move_to_hue_and_saturation', 'hue_stop'])],
337
+ toZigbee: [],
338
+ meta: {multiEndpoint: true},
339
+ endpoint: (device) => {
340
+ return {ep1: 1, ep2: 2, ep3: 3};
341
+ },
342
+ },
343
+ {
344
+ zigbeeModel: ['HK-ZCC-A'],
345
+ model: 'SR-ZG9080A',
346
+ vendor: 'Sunricher',
347
+ description: 'Curtain motor controller',
348
+ fromZigbee: [fz.cover_position_tilt],
349
+ toZigbee: [tz.cover_state, tz.cover_position_tilt],
350
+ exposes: [e.cover_position()],
351
+ configure: async (device, coordinatorEndpoint, logger) => {
352
+ const endpoint = device.getEndpoint(1);
353
+ await reporting.bind(endpoint, coordinatorEndpoint, ['closuresWindowCovering']);
354
+ await reporting.currentPositionLiftPercentage(endpoint);
355
+ },
356
+ },
357
+ {
358
+ fingerprint: [{modelID: 'GreenPower_2', ieeeAddr: /^0x00000000010.....$/},
359
+ {modelID: 'GreenPower_2', ieeeAddr: /^0x0000000001b.....$/}],
360
+ model: 'SR-ZGP2801K2-DIM',
361
+ vendor: 'Sunricher',
362
+ description: 'Pushbutton transmitter module',
363
+ fromZigbee: [fz.sunricher_switch2801K2],
364
+ toZigbee: [],
365
+ exposes: [e.action(['press_on', 'press_off', 'hold_on', 'hold_off', 'release'])],
366
+ },
367
+ {
368
+ fingerprint: [{modelID: 'GreenPower_2', ieeeAddr: /^0x000000005d5.....$/},
369
+ {modelID: 'GreenPower_2', ieeeAddr: /^0x0000000057e.....$/},
370
+ {modelID: 'GreenPower_2', ieeeAddr: /^0x000000001fa.....$/},
371
+ {modelID: 'GreenPower_2', ieeeAddr: /^0x0000000034b.....$/},
372
+ {modelID: 'GreenPower_2', ieeeAddr: /^0x00000000f12.....$/}],
373
+ model: 'SR-ZGP2801K4-DIM',
374
+ vendor: 'Sunricher',
375
+ description: 'Pushbutton transmitter module',
376
+ fromZigbee: [fz.sunricher_switch2801K4],
377
+ toZigbee: [],
378
+ exposes: [e.action(['press_on', 'press_off', 'press_high', 'press_low', 'hold_high', 'hold_low', 'release'])],
379
+ },
380
+ {
381
+ fingerprint: [{modelID: 'GreenPower_2', ieeeAddr: /^0x00000000aaf.....$/}],
382
+ model: 'SR-ZGP2801K-5C',
383
+ vendor: 'Sunricher',
384
+ description: 'Pushbutton transmitter module',
385
+ fromZigbee: [fzLocal.sunricher_SRZGP2801K45C],
386
+ toZigbee: [],
387
+ exposes: [e.action(['press_on', 'press_off', 'press_high', 'press_low', 'hold_high', 'hold_low', 'high_low_release',
388
+ 'cw_ww_release', 'cw_dec_ww_inc', 'ww_inc_cw_dec', 'r_g_b', 'b_g_r', 'rgb_release'])],
389
+ },
390
+ {
391
+ zigbeeModel: ['ZG9092', 'HK-LN-HEATER-A'],
392
+ model: 'SR-ZG9092A',
393
+ vendor: 'Sunricher',
394
+ description: 'Touch thermostat',
395
+ fromZigbee: [fz.thermostat, fz.namron_thermostat, fz.metering, fz.electrical_measurement, fz.namron_hvac_user_interface],
396
+ toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint, tz.thermostat_occupancy,
397
+ tz.thermostat_local_temperature_calibration, tz.thermostat_local_temperature, tz.thermostat_outdoor_temperature,
398
+ tz.thermostat_system_mode, tz.thermostat_control_sequence_of_operation, tz.thermostat_running_state,
399
+ tz.namron_thermostat, tz.namron_thermostat_child_lock],
400
+ exposes: [
401
+ exposes.numeric('outdoor_temperature', ea.STATE_GET).withUnit('°C')
402
+ .withDescription('Current temperature measured from the floor sensor'),
403
+ exposes.climate()
404
+ .withSetpoint('occupied_heating_setpoint', 0, 40, 0.1)
405
+ .withSetpoint('unoccupied_heating_setpoint', 0, 40, 0.1)
406
+ .withLocalTemperature()
407
+ .withLocalTemperatureCalibration(-3, 3, 0.1)
408
+ .withSystemMode(['off', 'auto', 'heat'])
409
+ .withRunningState(['idle', 'heat']),
410
+ exposes.binary('away_mode', ea.ALL, 'ON', 'OFF')
411
+ .withDescription('Enable/disable away mode'),
412
+ exposes.binary('child_lock', ea.ALL, 'UNLOCK', 'LOCK')
413
+ .withDescription('Enables/disables physical input on the device'),
414
+ e.power(), e.current(), e.voltage(), e.energy(),
415
+ exposes.enum('lcd_brightness', ea.ALL, ['low', 'mid', 'high'])
416
+ .withDescription('OLED brightness when operating the buttons. Default: Medium.'),
417
+ exposes.enum('button_vibration_level', ea.ALL, ['off', 'low', 'high'])
418
+ .withDescription('Key beep volume and vibration level. Default: Low.'),
419
+ exposes.enum('floor_sensor_type', ea.ALL, ['10k', '15k', '50k', '100k', '12k'])
420
+ .withDescription('Type of the external floor sensor. Default: NTC 10K/25.'),
421
+ exposes.enum('sensor', ea.ALL, ['air', 'floor', 'both'])
422
+ .withDescription('The sensor used for heat control. Default: Room Sensor.'),
423
+ exposes.enum('powerup_status', ea.ALL, ['default', 'last_status'])
424
+ .withDescription('The mode after a power reset. Default: Previous Mode.'),
425
+ exposes.numeric('floor_sensor_calibration', ea.ALL)
426
+ .withUnit('°C')
427
+ .withValueMin(-3).withValueMax(3).withValueStep(0.1)
428
+ .withDescription('The tempearatue calibration for the exernal floor sensor, between -3 and 3 in 0.1°C. Default: 0.'),
429
+ exposes.numeric('dry_time', ea.ALL)
430
+ .withUnit('min')
431
+ .withValueMin(5).withValueMax(100)
432
+ .withDescription('The duration of Dry Mode, between 5 and 100 minutes. Default: 5.'),
433
+ exposes.enum('mode_after_dry', ea.ALL, ['off', 'manual', 'auto', 'away'])
434
+ .withDescription('The mode after Dry Mode. Default: Auto.'),
435
+ exposes.enum('temperature_display', ea.ALL, ['room', 'floor'])
436
+ .withDescription('The temperature on the display. Default: Room Temperature.'),
437
+ exposes.numeric('window_open_check', ea.ALL)
438
+ .withUnit('°C')
439
+ .withValueMin(0).withValueMax(8).withValueStep(0.5)
440
+ .withDescription('The threshold to detect window open, between 0.0 and 8.0 in 0.5 °C. Default: 0 (disabled).'),
441
+ exposes.numeric('hysterersis', ea.ALL)
442
+ .withUnit('°C')
443
+ .withValueMin(0.5).withValueMax(2).withValueStep(0.1)
444
+ .withDescription('Hysteresis setting, between 0.5 and 2 in 0.1 °C. Default: 0.5.'),
445
+ exposes.enum('display_auto_off_enabled', ea.ALL, ['disabled', 'enabled']),
446
+ exposes.numeric('alarm_airtemp_overvalue', ea.ALL)
447
+ .withUnit('°C')
448
+ .withValueMin(20).withValueMax(60)
449
+ .withDescription('Room temperature alarm threshold, between 20 and 60 in °C. 0 means disabled. Default: 45.'),
450
+ ],
451
+ onEvent: async (type, data, device, options) => {
452
+ if (type === 'stop') {
453
+ clearInterval(globalStore.getValue(device, 'time'));
454
+ globalStore.clearValue(device, 'time');
455
+ } else if (!globalStore.hasValue(device, 'time')) {
456
+ const endpoint = device.getEndpoint(1);
457
+ const hours24 = 1000 * 60 * 60 * 24;
458
+ // Device does not ask for the time with binding, therefore we write the time every 24 hours
459
+ const interval = setInterval(async () => syncTime(endpoint), hours24);
460
+ globalStore.putValue(device, 'time', interval);
461
+ }
462
+ },
463
+ configure: async (device, coordinatorEndpoint, logger) => {
464
+ const endpoint = device.getEndpoint(1);
465
+ const binds = [
466
+ 'genBasic', 'genIdentify', 'hvacThermostat', 'seMetering', 'haElectricalMeasurement', 'genAlarms',
467
+ 'msOccupancySensing', 'genTime', 'hvacUserInterfaceCfg',
468
+ ];
469
+ await reporting.bind(endpoint, coordinatorEndpoint, binds);
470
+
471
+ // standard ZCL attributes
472
+ await reporting.thermostatTemperature(endpoint);
473
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
474
+ await reporting.thermostatUnoccupiedHeatingSetpoint(endpoint);
475
+ try {
476
+ await reporting.thermostatKeypadLockMode(endpoint);
477
+ } catch (error) {
478
+ // Fails for some
479
+ // https://github.com/Koenkk/zigbee2mqtt/issues/15025
480
+ logger.debug(`Failed to setup keypadLockout reporting`);
481
+ }
482
+
483
+ await endpoint.configureReporting('hvacThermostat', [{
484
+ attribute: 'occupancy',
485
+ minimumReportInterval: 0,
486
+ maximumReportInterval: constants.repInterval.HOUR,
487
+ reportableChange: null,
488
+ }]);
489
+
490
+ await endpoint.read('haElectricalMeasurement', ['acVoltageMultiplier', 'acVoltageDivisor', 'acCurrentMultiplier']);
491
+ await endpoint.read('haElectricalMeasurement', ['acCurrentDivisor']);
492
+ await endpoint.read('seMetering', ['multiplier', 'divisor']);
493
+
494
+ await reporting.activePower(endpoint, {min: 30, change: 10}); // Min report change 10W
495
+ await reporting.rmsCurrent(endpoint, {min: 30, change: 50}); // Min report change 0.05A
496
+ await reporting.rmsVoltage(endpoint, {min: 30, change: 20}); // Min report change 2V
497
+ await reporting.readMeteringMultiplierDivisor(endpoint);
498
+ await reporting.currentSummDelivered(endpoint);
499
+
500
+ // Custom attributes
501
+ const options = {manufacturerCode: 0x1224}; // Sunricher Manufacturer Code
502
+
503
+ // OperateDisplayLcdBrightnesss
504
+ await endpoint.configureReporting('hvacThermostat', [{
505
+ attribute: {ID: 0x1000, type: 0x30},
506
+ minimumReportInterval: 0,
507
+ maximumReportInterval: constants.repInterval.HOUR,
508
+ reportableChange: null}],
509
+ options);
510
+ // ButtonVibrationLevel
511
+ await endpoint.configureReporting('hvacThermostat', [{
512
+ attribute: {ID: 0x1001, type: 0x30},
513
+ minimumReportInterval: 0,
514
+ maximumReportInterval: constants.repInterval.HOUR,
515
+ reportableChange: null}],
516
+ options);
517
+ // FloorSensorType
518
+ await endpoint.configureReporting('hvacThermostat', [{
519
+ attribute: {ID: 0x1002, type: 0x30},
520
+ minimumReportInterval: 0,
521
+ maximumReportInterval: constants.repInterval.HOUR,
522
+ reportableChange: null}],
523
+ options);
524
+ // ControlType
525
+ await endpoint.configureReporting('hvacThermostat', [{
526
+ attribute: {ID: 0x1003, type: 0x30},
527
+ minimumReportInterval: 0,
528
+ maximumReportInterval: constants.repInterval.HOUR,
529
+ reportableChange: null}],
530
+ options);
531
+ // PowerUpStatus
532
+ await endpoint.configureReporting('hvacThermostat', [{
533
+ attribute: {ID: 0x1004, type: 0x30},
534
+ minimumReportInterval: 0,
535
+ maximumReportInterval: constants.repInterval.HOUR,
536
+ reportableChange: null}],
537
+ options);
538
+ // FloorSensorCalibration
539
+ await endpoint.configureReporting('hvacThermostat', [{
540
+ attribute: {ID: 0x1005, type: 0x28},
541
+ minimumReportInterval: 0,
542
+ maximumReportInterval: constants.repInterval.HOUR,
543
+ reportableChange: 0}],
544
+ options);
545
+ // DryTime
546
+ await endpoint.configureReporting('hvacThermostat', [{
547
+ attribute: {ID: 0x1006, type: 0x20},
548
+ minimumReportInterval: 0,
549
+ maximumReportInterval: constants.repInterval.HOUR,
550
+ reportableChange: 0}],
551
+ options);
552
+ // ModeAfterDry
553
+ await endpoint.configureReporting('hvacThermostat', [{
554
+ attribute: {ID: 0x1007, type: 0x30},
555
+ minimumReportInterval: 0,
556
+ maximumReportInterval: constants.repInterval.HOUR,
557
+ reportableChange: null}],
558
+ options);
559
+ // TemperatureDisplay
560
+ await endpoint.configureReporting('hvacThermostat', [{
561
+ attribute: {ID: 0x1008, type: 0x30},
562
+ minimumReportInterval: 0,
563
+ maximumReportInterval: constants.repInterval.HOUR,
564
+ reportableChange: null}],
565
+ options);
566
+ // WindowOpenCheck
567
+ await endpoint.configureReporting('hvacThermostat', [{
568
+ attribute: {ID: 0x1009, type: 0x20},
569
+ minimumReportInterval: 0,
570
+ maximumReportInterval: constants.repInterval.HOUR,
571
+ reportableChange: 0}],
572
+ options);
573
+
574
+ // Hysterersis
575
+ await endpoint.configureReporting('hvacThermostat', [{
576
+ attribute: {ID: 0x100A, type: 0x20},
577
+ minimumReportInterval: 0,
578
+ maximumReportInterval: constants.repInterval.HOUR,
579
+ reportableChange: 0}],
580
+ options);
581
+
582
+ // DisplayAutoOffEnable
583
+ await endpoint.configureReporting('hvacThermostat', [{
584
+ attribute: {ID: 0x100B, type: 0x30},
585
+ minimumReportInterval: 0,
586
+ maximumReportInterval: constants.repInterval.HOUR,
587
+ reportableChange: null}],
588
+ options);
589
+
590
+ // AlarmAirTempOverValue
591
+ await endpoint.configureReporting('hvacThermostat', [{
592
+ attribute: {ID: 0x2001, type: 0x20},
593
+ minimumReportInterval: 0,
594
+ maximumReportInterval: constants.repInterval.HOUR,
595
+ reportableChange: 0}],
596
+ options);
597
+ // Away Mode Set
598
+ await endpoint.configureReporting('hvacThermostat', [{
599
+ attribute: {ID: 0x2002, type: 0x30},
600
+ minimumReportInterval: 0,
601
+ maximumReportInterval: constants.repInterval.HOUR,
602
+ reportableChange: null}],
603
+ options);
604
+
605
+ // Device does not asks for the time with binding, we need to write time during configure
606
+ syncTime(endpoint);
607
+
608
+ // Trigger initial read
609
+ await endpoint.read('hvacThermostat', ['systemMode', 'runningState', 'occupiedHeatingSetpoint']);
610
+ await endpoint.read('hvacThermostat', [0x1000, 0x1001, 0x1002, 0x1003], options);
611
+ await endpoint.read('hvacThermostat', [0x1004, 0x1005, 0x1006, 0x1007], options);
612
+ await endpoint.read('hvacThermostat', [0x1008, 0x1009, 0x100A, 0x100B], options);
613
+ await endpoint.read('hvacThermostat', [0x2001, 0x2002], options);
614
+ },
615
+ },
616
+ {
617
+ fingerprint: [{modelID: 'TERNCY-DC01', manufacturerName: 'Sunricher'}],
618
+ model: 'SR-ZG9010A',
619
+ vendor: 'Sunricher',
620
+ description: 'Door windows sensor',
621
+ fromZigbee: [fz.U02I007C01_contact, fz.battery],
622
+ toZigbee: [],
623
+ exposes: [e.contact(), e.battery()],
624
+ },
625
+ ];
@@ -0,0 +1,33 @@
1
+ const exposes = require('../lib/exposes');
2
+ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
+ const e = exposes.presets;
4
+
5
+ module.exports = [
6
+ {
7
+ zigbeeModel: ['SWO-KEF1PA'],
8
+ model: 'SWO-KEF1PA',
9
+ vendor: 'Swann',
10
+ description: 'Key fob remote',
11
+ fromZigbee: [fz.legacy.KEF1PA_arm, fz.command_panic],
12
+ toZigbee: [],
13
+ exposes: [e.action(['home', 'sleep', 'away', 'panic'])],
14
+ },
15
+ {
16
+ zigbeeModel: ['SWO-WDS1PA'],
17
+ model: 'SWO-WDS1PA',
18
+ vendor: 'Swann',
19
+ description: 'Window/door sensor',
20
+ fromZigbee: [fz.ias_contact_alarm_1],
21
+ toZigbee: [],
22
+ exposes: [e.contact(), e.battery_low(), e.tamper()],
23
+ },
24
+ {
25
+ zigbeeModel: ['SWO-MOS1PA'],
26
+ model: 'SWO-MOS1PA',
27
+ vendor: 'Swann',
28
+ description: 'Motion and temperature sensor',
29
+ fromZigbee: [fz.ias_occupancy_alarm_1],
30
+ toZigbee: [],
31
+ exposes: [e.occupancy(), e.battery_low(), e.tamper()],
32
+ },
33
+ ];