@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,702 @@
1
+ const herdsman = require('zigbee-herdsman');
2
+ const exposes = require('../lib/exposes');
3
+ const fz = require('../converters/fromZigbee');
4
+ const tz = require('../converters/toZigbee');
5
+ const reporting = require('../lib/reporting');
6
+ const utils = require('../lib/utils');
7
+ const constants = require('../lib/constants');
8
+ const ota = require('../lib/ota');
9
+ const e = exposes.presets;
10
+ const ea = exposes.access;
11
+
12
+ // Radiator Thermostat II
13
+ const boschManufacturer = {manufacturerCode: 0x1209};
14
+
15
+ // Twinguard
16
+ const smokeSensitivity = {
17
+ 'low': 3,
18
+ 'medium': 2,
19
+ 'high': 1,
20
+ };
21
+
22
+ // Twinguard
23
+ const sirenState = {
24
+ 'stop': 0,
25
+ 'pre_alarm': 1,
26
+ 'fire': 2,
27
+ 'burglar': 3,
28
+ };
29
+
30
+ // Radiator Thermostat II
31
+ const operatingModes = {
32
+ 'automatic': 0,
33
+ 'manual': 1,
34
+ 'pause': 5,
35
+ };
36
+
37
+ // Radiator Thermostat II
38
+ const stateOffOn = {
39
+ 'OFF': 0,
40
+ 'ON': 1,
41
+ };
42
+
43
+ // Radiator Thermostat II
44
+ const displayOrientation = {
45
+ 'normal': 0,
46
+ 'flipped': 1,
47
+ };
48
+
49
+ // Radiator Thermostat II
50
+ const tzLocal = {
51
+ bwa1: {
52
+ key: ['alarm_on_motion', 'test'],
53
+ convertSet: async (entity, key, value, meta) => {
54
+ if (key === 'alarm_on_motion') {
55
+ value = value.toUpperCase();
56
+ const index = stateOffOn[value];
57
+ await entity.write(0xFCAC, {0x0003: {value: index, type: 0x10}}, boschManufacturer);
58
+ return {state: {alarm_on_motion: value}};
59
+ }
60
+ },
61
+ convertGet: async (entity, key, meta) => {
62
+ switch (key) {
63
+ case 'alarm_on_motion':
64
+ await entity.read(0xFCAC, [0x0003], boschManufacturer);
65
+ break;
66
+ default: // Unknown key
67
+ throw new Error(`Unhandled key toZigbee.bosch_twinguard.convertGet ${key}`);
68
+ }
69
+ },
70
+ },
71
+ bosch_thermostat: {
72
+ key: ['window_open', 'boost', 'system_mode', 'pi_heating_demand'],
73
+ convertSet: async (entity, key, value, meta) => {
74
+ if (key === 'window_open') {
75
+ value = value.toUpperCase();
76
+ utils.validateValue(value, Object.keys(stateOffOn));
77
+ const index = stateOffOn[value];
78
+ await entity.write('hvacThermostat', {0x4042: {value: index, type: herdsman.Zcl.DataType.enum8}}, boschManufacturer);
79
+ return {state: {window_open: value}};
80
+ }
81
+ if (key === 'boost') {
82
+ value = value.toUpperCase();
83
+ utils.validateValue(value, Object.keys(stateOffOn));
84
+ const index = stateOffOn[value];
85
+ await entity.write('hvacThermostat', {0x4043: {value: index, type: herdsman.Zcl.DataType.enum8}}, boschManufacturer);
86
+ return {state: {boost: value}};
87
+ }
88
+ if (key === 'system_mode') {
89
+ // Map system_mode (Off/Auto/Heat) to Bosch operating mode
90
+ value = value.toLowerCase();
91
+
92
+ let opMode = operatingModes.manual; // OperatingMode 1 = Manual (Default)
93
+
94
+ if (value=='off') {
95
+ opMode = operatingModes.pause; // OperatingMode 5 = Pause
96
+ } else if (value == 'auto') {
97
+ opMode = operatingModes.automatic; // OperatingMode 0 = Automatic
98
+ }
99
+ await entity.write('hvacThermostat', {0x4007: {value: opMode, type: herdsman.Zcl.DataType.enum8}}, boschManufacturer);
100
+ return {state: {system_mode: value}};
101
+ }
102
+ if (key === 'pi_heating_demand') {
103
+ await entity.write('hvacThermostat',
104
+ {0x4020: {value: value, type: herdsman.Zcl.DataType.enum8}},
105
+ boschManufacturer);
106
+ return {state: {pi_heating_demand: value}};
107
+ }
108
+ },
109
+ convertGet: async (entity, key, meta) => {
110
+ switch (key) {
111
+ case 'window_open':
112
+ await entity.read('hvacThermostat', [0x4042], boschManufacturer);
113
+ break;
114
+ case 'boost':
115
+ await entity.read('hvacThermostat', [0x4043], boschManufacturer);
116
+ break;
117
+ case 'system_mode':
118
+ await entity.read('hvacThermostat', [0x4007], boschManufacturer);
119
+ break;
120
+ case 'pi_heating_demand':
121
+ await entity.read('hvacThermostat', [0x4020], boschManufacturer);
122
+ break;
123
+
124
+ default: // Unknown key
125
+ throw new Error(`Unhandled key toZigbee.bosch_thermostat.convertGet ${key}`);
126
+ }
127
+ },
128
+ },
129
+ bosch_userInterface: {
130
+ key: ['display_orientation', 'display_ontime', 'display_brightness', 'child_lock'],
131
+ convertSet: async (entity, key, value, meta) => {
132
+ if (key === 'display_orientation') {
133
+ const index = displayOrientation[value];
134
+ await entity.write('hvacUserInterfaceCfg', {0x400b: {value: index, type: herdsman.Zcl.DataType.uint8}}, boschManufacturer);
135
+ return {state: {display_orientation: value}};
136
+ }
137
+ if (key === 'display_ontime') {
138
+ await entity.write('hvacUserInterfaceCfg', {0x403a: {value: value, type: herdsman.Zcl.DataType.enum8}}, boschManufacturer);
139
+ return {state: {display_onTime: value}};
140
+ }
141
+ if (key === 'display_brightness') {
142
+ await entity.write('hvacUserInterfaceCfg', {0x403b: {value: value, type: herdsman.Zcl.DataType.enum8}}, boschManufacturer);
143
+ return {state: {display_brightness: value}};
144
+ }
145
+ if (key === 'child_lock') {
146
+ const keypadLockout = Number(value === 'LOCK');
147
+ await entity.write('hvacUserInterfaceCfg', {keypadLockout});
148
+ return {state: {child_lock: value}};
149
+ }
150
+ },
151
+ convertGet: async (entity, key, meta) => {
152
+ switch (key) {
153
+ case 'display_orientation':
154
+ await entity.read('hvacUserInterfaceCfg', [0x400b], boschManufacturer);
155
+ break;
156
+ case 'display_ontime':
157
+ await entity.read('hvacUserInterfaceCfg', [0x403a], boschManufacturer);
158
+ break;
159
+ case 'display_brightness':
160
+ await entity.read('hvacUserInterfaceCfg', [0x403b], boschManufacturer);
161
+ break;
162
+ case 'child_lock':
163
+ await entity.read('hvacUserInterfaceCfg', ['keypadLockout']);
164
+ break;
165
+ default: // Unknown key
166
+ throw new Error(`Unhandled key toZigbee.bosch_userInterface.convertGet ${key}`);
167
+ }
168
+ },
169
+ },
170
+ bosch_twinguard: {
171
+ key: ['sensitivity', 'pre_alarm', 'self_test', 'alarm', 'heartbeat'],
172
+ convertSet: async (entity, key, value, meta) => {
173
+ if (key === 'sensitivity') {
174
+ value = value.toUpperCase();
175
+ const index = smokeSensitivity[value];
176
+ await entity.write('manuSpecificBosch', {0x4003: {value: index, type: 0x21}}, boschManufacturer);
177
+ return {state: {sensitivity: value}};
178
+ }
179
+ if (key === 'pre_alarm') {
180
+ value = value.toUpperCase();
181
+ const index = stateOffOn[value];
182
+ await entity.write('manuSpecificBosch5', {0x4001: {value: index, type: 0x18}}, boschManufacturer);
183
+ return {state: {pre_alarm: value}};
184
+ }
185
+ if (key === 'heartbeat') {
186
+ const endpoint = meta.device.getEndpoint(12);
187
+ value = value.toUpperCase();
188
+ const index = stateOffOn[value];
189
+ await endpoint.write('manuSpecificBosch7', {0x5005: {value: index, type: 0x18}}, boschManufacturer);
190
+ return {state: {heartbeat: value}};
191
+ }
192
+ if (key === 'self_test') {
193
+ if (value) {
194
+ await entity.command('manuSpecificBosch', 'initiateTestMode', boschManufacturer);
195
+ }
196
+ }
197
+ if (key === 'alarm') {
198
+ const endpoint = meta.device.getEndpoint(12);
199
+ const index = sirenState[value];
200
+ if (index == 0) {
201
+ await entity.commandResponse('genAlarms', 'alarm', {alarmcode: 0x16, clusterid: 0xe000}, {direction: 1});
202
+ await entity.commandResponse('genAlarms', 'alarm', {alarmcode: 0x14, clusterid: 0xe000}, {direction: 1});
203
+ await endpoint.command('manuSpecificBosch8', 'burglarAlarm', {data: 0}, boschManufacturer);
204
+ } else if (index == 1) {
205
+ await entity.commandResponse('genAlarms', 'alarm', {alarmcode: 0x11, clusterid: 0xe000}, {direction: 1});
206
+ return {state: {siren_state: 'pre-alarm'}};
207
+ } else if (index == 2) {
208
+ await entity.commandResponse('genAlarms', 'alarm', {alarmcode: 0x10, clusterid: 0xe000}, {direction: 1});
209
+ return {state: {siren_state: 'fire'}};
210
+ } else if (index == 3) {
211
+ await endpoint.command('manuSpecificBosch8', 'burglarAlarm', {data: 1}, boschManufacturer);
212
+ }
213
+ }
214
+ },
215
+ convertGet: async (entity, key, meta) => {
216
+ switch (key) {
217
+ case 'sensitivity':
218
+ await entity.read('manuSpecificBosch', [0x4003], boschManufacturer);
219
+ break;
220
+ case 'pre_alarm':
221
+ await entity.read('manuSpecificBosch5', [0x4001], boschManufacturer);
222
+ break;
223
+ case 'heartbeat':
224
+ await meta.device.getEndpoint(12).read('manuSpecificBosch7', [0x5005], boschManufacturer);
225
+ break;
226
+ default: // Unknown key
227
+ throw new Error(`Unhandled key toZigbee.bosch_twinguard.convertGet ${key}`);
228
+ }
229
+ },
230
+ },
231
+ };
232
+
233
+
234
+ const fzLocal = {
235
+ bwa1_alarm_on_motion: {
236
+ cluster: '64684',
237
+ type: ['attributeReport', 'readResponse'],
238
+ options: [],
239
+ convert: (model, msg, publish, options, meta) => {
240
+ const result = {};
241
+ const data = msg.data;
242
+ if (data.hasOwnProperty(0x0003)) {
243
+ result.alarm_on_motion = (Object.keys(stateOffOn)[msg.data[0x0003]]);
244
+ }
245
+ return result;
246
+ },
247
+ },
248
+ bosch_contact: {
249
+ cluster: 'ssIasZone',
250
+ type: 'commandStatusChangeNotification',
251
+ convert: (model, msg, publish, options, meta) => {
252
+ const zoneStatus = msg.data.zonestatus;
253
+ const lookup = {0: 'none', 1: 'single', 2: 'long'};
254
+ const result = {
255
+ contact: !((zoneStatus & 1) > 0),
256
+ battery_low: (zoneStatus & 1<<3) > 0,
257
+ action: lookup[(zoneStatus >> 11) & 3],
258
+ };
259
+ if (result.action === 'none') delete result.action;
260
+ return result;
261
+ },
262
+ },
263
+ bosch_ignore_dst: {
264
+ cluster: 'genTime',
265
+ type: 'read',
266
+ convert: async (model, msg, publish, options, meta) => {
267
+ if (msg.data.includes('dstStart', 'dstEnd', 'dstShift')) {
268
+ const response = {
269
+ 'dstStart': {attribute: 0x0003, status: herdsman.Zcl.Status.SUCCESS, value: 0x00},
270
+ 'dstEnd': {attribute: 0x0004, status: herdsman.Zcl.Status.SUCCESS, value: 0x00},
271
+ 'dstShift': {attribute: 0x0005, status: herdsman.Zcl.Status.SUCCESS, value: 0x00},
272
+ };
273
+
274
+ await msg.endpoint.readResponse(msg.cluster, msg.meta.zclTransactionSequenceNumber, response);
275
+ }
276
+ },
277
+ },
278
+ bosch_thermostat: {
279
+ cluster: 'hvacThermostat',
280
+ type: ['attributeReport', 'readResponse'],
281
+ convert: (model, msg, publish, options, meta) => {
282
+ const result = {};
283
+ const data = msg.data;
284
+ if (data.hasOwnProperty(0x4042)) {
285
+ result.window_open = (Object.keys(stateOffOn)[data[0x4042]]);
286
+ }
287
+ if (data.hasOwnProperty(0x4043)) {
288
+ result.boost = (Object.keys(stateOffOn)[data[0x4043]]);
289
+ }
290
+ if (data.hasOwnProperty(0x4007)) {
291
+ const opModes = {0: 'auto', 1: 'heat', 2: 'unknown_2', 3: 'unknown_3', 4: 'unknown_4', 5: 'off'};
292
+ result.system_mode = opModes[data[0x4007]];
293
+ }
294
+ if (data.hasOwnProperty(0x4020)) {
295
+ result.pi_heating_demand = data[0x4020];
296
+ }
297
+
298
+ return result;
299
+ },
300
+ },
301
+ bosch_userInterface: {
302
+ cluster: 'hvacUserInterfaceCfg',
303
+ type: ['attributeReport', 'readResponse'],
304
+ convert: (model, msg, publish, options, meta) => {
305
+ const result = {};
306
+ const data = msg.data;
307
+ if (data.hasOwnProperty(0x400b)) {
308
+ result.display_orientation = (Object.keys(displayOrientation)[data[0x400b]]);
309
+ }
310
+ if (data.hasOwnProperty(0x403a)) {
311
+ result.display_ontime = data[0x403a];
312
+ }
313
+ if (data.hasOwnProperty(0x403b)) {
314
+ result.display_brightness = data[0x403b];
315
+ }
316
+ if (data.hasOwnProperty('keypadLockout')) {
317
+ result.child_lock = (data['keypadLockout'] == 1 ? 'LOCK' : 'UNLOCK');
318
+ }
319
+
320
+ return result;
321
+ },
322
+ },
323
+ bosch_twinguard_sensitivity: {
324
+ cluster: 'manuSpecificBosch',
325
+ type: ['attributeReport', 'readResponse'],
326
+ options: [],
327
+ convert: (model, msg, publish, options, meta) => {
328
+ const result = {};
329
+ if (msg.data.hasOwnProperty(0x4003)) {
330
+ result.sensitivity = (Object.keys(smokeSensitivity)[msg.data[0x4003]]);
331
+ }
332
+ return result;
333
+ },
334
+ },
335
+ bosch_twinguard_measurements: {
336
+ cluster: 'manuSpecificBosch3',
337
+ type: ['attributeReport', 'readResponse'],
338
+ options: [exposes.options.precision('temperature'), exposes.options.calibration('temperature'),
339
+ exposes.options.precision('humidity'), exposes.options.calibration('humidity'),
340
+ exposes.options.calibration('illuminance_lux', 'percentual')],
341
+ convert: (model, msg, publish, options, meta) => {
342
+ const result = {};
343
+ if (msg.data.hasOwnProperty('humidity')) {
344
+ result.humidity = utils.calibrateAndPrecisionRoundOptions(msg.data['humidity'] / 100.0, options, 'humidity');
345
+ }
346
+ if (msg.data.hasOwnProperty('airpurity')) {
347
+ result.co2 = msg.data['airpurity'] * 10.0 + 500.0;
348
+ }
349
+ if (msg.data.hasOwnProperty('temperature')) {
350
+ result.temperature = utils.calibrateAndPrecisionRoundOptions(msg.data['temperature'] / 100.0, options, 'temperature');
351
+ }
352
+ if (msg.data.hasOwnProperty('illuminance_lux')) {
353
+ result.illuminance_lux = utils.calibrateAndPrecisionRoundOptions(
354
+ msg.data['illuminance_lux'] / 2.0, options, 'illuminance_lux');
355
+ }
356
+ if (msg.data.hasOwnProperty('battery')) {
357
+ result.battery = msg.data['battery'] / 2.0;
358
+ }
359
+ return result;
360
+ },
361
+ },
362
+ bosch_twinguard_pre_alarm: {
363
+ cluster: 'manuSpecificBosch5',
364
+ type: ['attributeReport', 'readResponse'],
365
+ options: [],
366
+ convert: (model, msg, publish, options, meta) => {
367
+ const result = {};
368
+ if (msg.data.hasOwnProperty('pre_alarm')) {
369
+ result.pre_alarm = (Object.keys(stateOffOn)[msg.data['pre_alarm']]);
370
+ }
371
+ return result;
372
+ },
373
+ },
374
+ bosch_twinguard_heartbeat: {
375
+ cluster: 'manuSpecificBosch7',
376
+ type: ['attributeReport', 'readResponse'],
377
+ options: [],
378
+ convert: (model, msg, publish, options, meta) => {
379
+ const result = {};
380
+ if (msg.data.hasOwnProperty('heartbeat')) {
381
+ result.heartbeat = (Object.keys(stateOffOn)[msg.data['heartbeat']]);
382
+ }
383
+ return result;
384
+ },
385
+ },
386
+ bosch_twinguard_alarm_state: {
387
+ cluster: 'manuSpecificBosch8',
388
+ type: ['attributeReport', 'readResponse'],
389
+ options: [],
390
+ convert: (model, msg, publish, options, meta) => {
391
+ const result = {};
392
+ const lookup = {
393
+ 0x00200020: 'clear',
394
+ 0x01200020: 'self_test',
395
+ 0x02200020: 'burglar',
396
+ 0x00200082: 'pre-alarm',
397
+ 0x00200081: 'fire',
398
+ 0x00200040: 'silenced',
399
+ };
400
+
401
+ if (msg.data.hasOwnProperty('alarm_status')) {
402
+ result.self_test = (msg.data['alarm_status'] & 1<<24) > 0;
403
+ result.smoke = (msg.data['alarm_status'] & 1<<7) > 0;
404
+ result.siren_state = lookup[msg.data['alarm_status']];
405
+ }
406
+ return result;
407
+ },
408
+ },
409
+ bosch_twinguard_smoke_alarm_state: {
410
+ cluster: 'genAlarms',
411
+ type: ['commandAlarm', 'readResponse'],
412
+ options: [],
413
+ convert: async (model, msg, publish, options, meta) => {
414
+ const result = {};
415
+ const lookup = {
416
+ 0x10: 'fire',
417
+ 0x11: 'pre-alarm',
418
+ 0x14: 'clear',
419
+ 0x16: 'silenced',
420
+ };
421
+ result.siren_state = lookup[msg.data.alarmcode];
422
+ if (msg.data.alarmcode == 0x10 || msg.data.alarmcode == 0x11) {
423
+ await msg.endpoint.commandResponse('genAlarms', 'alarm',
424
+ {alarmcode: msg.data.alarmcode, clusterid: 0xe000}, {direction: 1});
425
+ }
426
+ return result;
427
+ },
428
+ },
429
+ };
430
+
431
+ const definition = [
432
+ {
433
+ zigbeeModel: ['RBSH-WS-ZB-EU'],
434
+ model: 'BWA-1',
435
+ vendor: 'Bosch',
436
+ description: 'Zigbee smart water leak detector',
437
+ fromZigbee: [fz.ias_water_leak_alarm_1, fz.battery, fzLocal.bwa1_alarm_on_motion],
438
+ toZigbee: [tzLocal.bwa1],
439
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
440
+ configure: async (device, coordinatorEndpoint, logger) => {
441
+ const endpoint = device.getEndpoint(1);
442
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', '64684']);
443
+ await reporting.batteryPercentageRemaining(endpoint);
444
+ await reporting.batteryVoltage(endpoint);
445
+ await endpoint.configureReporting(0xFCAC, [{
446
+ attribute: {ID: 0x0003, type: herdsman.Zcl.DataType.bool},
447
+ minimumReportInterval: 0,
448
+ maximumReportInterval: constants.repInterval.HOUR,
449
+ reportableChange: 1,
450
+ }], boschManufacturer);
451
+ },
452
+ exposes: [
453
+ e.water_leak(), e.battery(), e.tamper(),
454
+ exposes.binary('alarm_on_motion', ea.ALL, 'ON', 'OFF').withDescription('Enable/Disable sound alarm on motion'),
455
+ ],
456
+ },
457
+ {
458
+ zigbeeModel: ['RBSH-SD-ZB-EU'],
459
+ model: 'BSD-2',
460
+ vendor: 'Bosch',
461
+ description: 'Smoke alarm detector',
462
+ fromZigbee: [fz.battery, fz.ias_smoke_alarm_1],
463
+ toZigbee: [],
464
+ meta: {},
465
+ configure: async (device, coordinatorEndpoint, logger) => {
466
+ const endpoint = device.getEndpoint(1);
467
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 64684]);
468
+ await reporting.batteryPercentageRemaining(endpoint);
469
+ },
470
+ exposes: [e.smoke(), e.battery(), e.battery_low(), e.test()],
471
+ },
472
+ {
473
+ zigbeeModel: ['RFDL-ZB', 'RFDL-ZB-EU', 'RFDL-ZB-H', 'RFDL-ZB-K', 'RFDL-ZB-CHI', 'RFDL-ZB-MS', 'RFDL-ZB-ES', 'RFPR-ZB',
474
+ 'RFPR-ZB-EU', 'RFPR-ZB-CHI', 'RFPR-ZB-ES', 'RFPR-ZB-MS'],
475
+ model: 'RADON TriTech ZB',
476
+ vendor: 'Bosch',
477
+ description: 'Wireless motion detector',
478
+ fromZigbee: [fz.temperature, fz.battery, fz.ias_occupancy_alarm_1, fz.illuminance],
479
+ toZigbee: [],
480
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
481
+ configure: async (device, coordinatorEndpoint, logger) => {
482
+ const endpoint = device.getEndpoint(1);
483
+ await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
484
+ await reporting.temperature(endpoint);
485
+ await reporting.batteryVoltage(endpoint);
486
+ await reporting.illuminance(endpoint);
487
+ },
488
+ exposes: [e.temperature(), e.battery(), e.occupancy(), e.battery_low(), e.tamper(), e.illuminance(), e.illuminance_lux()],
489
+ },
490
+ {
491
+ zigbeeModel: ['ISW-ZPR1-WP13'],
492
+ model: 'ISW-ZPR1-WP13',
493
+ vendor: 'Bosch',
494
+ description: 'Motion sensor',
495
+ fromZigbee: [fz.temperature, fz.battery, fz.ias_occupancy_alarm_1, fz.ignore_iaszone_report],
496
+ toZigbee: [],
497
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
498
+ configure: async (device, coordinatorEndpoint, logger) => {
499
+ const endpoint = device.getEndpoint(5);
500
+ await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
501
+ await reporting.temperature(endpoint);
502
+ await reporting.batteryVoltage(endpoint);
503
+ },
504
+ exposes: [e.temperature(), e.battery(), e.occupancy(), e.battery_low(), e.tamper()],
505
+ },
506
+ {
507
+ zigbeeModel: ['RBSH-TRV0-ZB-EU'],
508
+ model: 'BTH-RA',
509
+ vendor: 'Bosch',
510
+ description: 'Radiator thermostat II',
511
+ ota: ota.zigbeeOTA,
512
+ fromZigbee: [
513
+ fz.thermostat,
514
+ fz.battery,
515
+ fzLocal.bosch_ignore_dst,
516
+ fzLocal.bosch_thermostat,
517
+ fzLocal.bosch_userInterface,
518
+ ],
519
+ toZigbee: [
520
+ tz.thermostat_occupied_heating_setpoint,
521
+ tz.thermostat_local_temperature_calibration,
522
+ tz.thermostat_keypad_lockout,
523
+ tzLocal.bosch_thermostat,
524
+ tzLocal.bosch_userInterface,
525
+ ],
526
+ exposes: [
527
+ exposes.climate()
528
+ .withLocalTemperature(ea.STATE)
529
+ .withSetpoint('occupied_heating_setpoint', 5, 30, 0.5)
530
+ .withLocalTemperatureCalibration(-5, 5, 0.1)
531
+ .withSystemMode(['off', 'heat', 'auto'])
532
+ .withPiHeatingDemand(ea.ALL),
533
+ exposes.binary('boost', ea.ALL, 'ON', 'OFF')
534
+ .withDescription('Activate Boost heating'),
535
+ exposes.binary('window_open', ea.ALL, 'ON', 'OFF')
536
+ .withDescription('Window open'),
537
+ exposes.enum('display_orientation', ea.ALL, Object.keys(displayOrientation))
538
+ .withDescription('Display orientation'),
539
+ exposes.numeric('display_ontime', ea.ALL)
540
+ .withValueMin(5)
541
+ .withValueMax(30)
542
+ .withDescription('Specifies the diplay On-time'),
543
+ exposes.numeric('display_brightness', ea.ALL)
544
+ .withValueMin(0)
545
+ .withValueMax(10)
546
+ .withDescription('Specifies the brightness value of the display'),
547
+ e.child_lock().setAccess('state', ea.ALL),
548
+ e.battery(),
549
+ ],
550
+ configure: async (device, coordinatorEndpoint, logger) => {
551
+ const endpoint = device.getEndpoint(1);
552
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'hvacThermostat', 'hvacUserInterfaceCfg']);
553
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint);
554
+ await reporting.thermostatTemperature(endpoint);
555
+ await reporting.thermostatKeypadLockMode(endpoint);
556
+ await reporting.batteryPercentageRemaining(endpoint);
557
+
558
+ // report operating_mode (system_mode)
559
+ await endpoint.configureReporting('hvacThermostat', [{
560
+ attribute: {ID: 0x4007, type: herdsman.Zcl.DataType.enum8},
561
+ minimumReportInterval: 0,
562
+ maximumReportInterval: constants.repInterval.HOUR,
563
+ reportableChange: 1,
564
+ }], boschManufacturer);
565
+ // report pi_heating_demand (valve opening)
566
+ await endpoint.configureReporting('hvacThermostat', [{
567
+ attribute: {ID: 0x4020, type: herdsman.Zcl.DataType.enum8},
568
+ minimumReportInterval: 0,
569
+ maximumReportInterval: constants.repInterval.HOUR,
570
+ reportableChange: 1,
571
+ }], boschManufacturer);
572
+ // report window_open
573
+ await endpoint.configureReporting('hvacThermostat', [{
574
+ attribute: {ID: 0x4042, type: herdsman.Zcl.DataType.enum8},
575
+ minimumReportInterval: 0,
576
+ maximumReportInterval: constants.repInterval.HOUR,
577
+ reportableChange: 1,
578
+ }], boschManufacturer);
579
+ // report boost as it's disabled by thermostat after 5 minutes
580
+ await endpoint.configureReporting('hvacThermostat', [{
581
+ attribute: {ID: 0x4043, type: herdsman.Zcl.DataType.enum8},
582
+ minimumReportInterval: 0,
583
+ maximumReportInterval: constants.repInterval.HOUR,
584
+ reportableChange: 1,
585
+ }], boschManufacturer);
586
+
587
+ await endpoint.read('hvacThermostat', ['localTemperatureCalibration']);
588
+ await endpoint.read('hvacThermostat', [0x4007, 0x4020, 0x4042, 0x4043], boschManufacturer);
589
+
590
+ await endpoint.read('hvacUserInterfaceCfg', ['keypadLockout']);
591
+ await endpoint.read('hvacUserInterfaceCfg', [0x400b, 0x403a, 0x403b], boschManufacturer);
592
+ },
593
+ },
594
+ {
595
+ zigbeeModel: ['Champion'],
596
+ model: '8750001213',
597
+ vendor: 'Bosch',
598
+ description: 'Twinguard',
599
+ fromZigbee: [fzLocal.bosch_twinguard_measurements, fzLocal.bosch_twinguard_sensitivity,
600
+ fzLocal.bosch_twinguard_pre_alarm, fzLocal.bosch_twinguard_alarm_state, fzLocal.bosch_twinguard_smoke_alarm_state,
601
+ fzLocal.bosch_twinguard_heartbeat],
602
+ toZigbee: [tzLocal.bosch_twinguard],
603
+ configure: async (device, coordinatorEndpoint, logger) => {
604
+ const coordinatorEndpointB = coordinatorEndpoint.getDevice().getEndpoint(1);
605
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpointB, [0x0009]);
606
+ await reporting.bind(device.getEndpoint(7), coordinatorEndpointB, [0x0019]);
607
+ await reporting.bind(device.getEndpoint(7), coordinatorEndpointB, [0x0020]);
608
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpointB, [0xe000]);
609
+ await reporting.bind(device.getEndpoint(3), coordinatorEndpointB, [0xe002]);
610
+ await reporting.bind(device.getEndpoint(1), coordinatorEndpointB, [0xe004]);
611
+ await reporting.bind(device.getEndpoint(12), coordinatorEndpointB, [0xe006]);
612
+ await reporting.bind(device.getEndpoint(12), coordinatorEndpointB, [0xe007]);
613
+ await device.getEndpoint(1).read('manuSpecificBosch5', ['unknown_attribute'], boschManufacturer); // Needed for pairing
614
+ await device.getEndpoint(12).command('manuSpecificBosch7', 'pairingCompleted', boschManufacturer); // Needed for pairing
615
+ await device.getEndpoint(1).write('manuSpecificBosch',
616
+ {0x4003: {value: 0x0002, type: 0x21}}, boschManufacturer); // Setting defaults
617
+ await device.getEndpoint(1).write('manuSpecificBosch5',
618
+ {0x4001: {value: 0x01, type: 0x18}}, boschManufacturer); // Setting defaults
619
+ await device.getEndpoint(12).write('manuSpecificBosch7',
620
+ {0x5005: {value: 0x01, type: 0x18}}, boschManufacturer); // Setting defaults
621
+ await device.getEndpoint(1).read('manuSpecificBosch', ['sensitivity'], boschManufacturer);
622
+ await device.getEndpoint(1).read('manuSpecificBosch5', ['pre_alarm'], boschManufacturer);
623
+ await device.getEndpoint(12).read('manuSpecificBosch7', ['heartbeat'], boschManufacturer);
624
+ },
625
+ exposes: [
626
+ e.smoke(), e.temperature(), e.humidity(), e.co2(), e.illuminance_lux(), e.battery(),
627
+ exposes.enum('alarm', ea.ALL, Object.keys(sirenState)).withDescription('Mode of the alarm (sound effect)'),
628
+ exposes.text('siren_state', ea.STATE).withDescription('Siren state'),
629
+ exposes.binary('self_test', ea.ALL, true, false).withDescription('Initiate self-test'),
630
+ exposes.enum('sensitivity', ea.ALL, Object.keys(smokeSensitivity)).withDescription('Sensitivity of the smoke alarm'),
631
+ exposes.enum('pre_alarm', ea.ALL, Object.keys(stateOffOn)).withDescription('Enable/disable pre-alarm'),
632
+ exposes.enum('heartbeat', ea.ALL, Object.keys(stateOffOn)).withDescription('Enable/disable heartbeat'),
633
+ ],
634
+ },
635
+ {
636
+ zigbeeModel: ['RFPR-ZB-SH-EU'],
637
+ model: 'RFPR-ZB-SH-EU',
638
+ vendor: 'Bosch',
639
+ description: 'Wireless motion detector',
640
+ fromZigbee: [fz.temperature, fz.battery, fz.ias_occupancy_alarm_1],
641
+ toZigbee: [],
642
+ meta: {battery: {voltageToPercentage: '3V_2500'}},
643
+ configure: async (device, coordinatorEndpoint, logger) => {
644
+ const endpoint = device.getEndpoint(1);
645
+ await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement', 'genPowerCfg']);
646
+ await reporting.temperature(endpoint);
647
+ await reporting.batteryVoltage(endpoint);
648
+ },
649
+ exposes: [e.temperature(), e.battery(), e.occupancy(), e.battery_low(), e.tamper()],
650
+ },
651
+ {
652
+ zigbeeModel: ['RBSH-SP-ZB-EU'],
653
+ model: 'BSP-FZ2',
654
+ vendor: 'Bosch',
655
+ description: 'Plug compact EU',
656
+ fromZigbee: [fz.on_off, fz.power_on_behavior, fz.electrical_measurement, fz.metering],
657
+ toZigbee: [tz.on_off, tz.power_on_behavior],
658
+ configure: async (device, coordinatorEndpoint, logger) => {
659
+ const endpoint = device.getEndpoint(1);
660
+ await endpoint.read('genOnOff', ['onOff', 'startUpOnOff']);
661
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
662
+ await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
663
+ await reporting.readMeteringMultiplierDivisor(endpoint);
664
+ await reporting.currentSummDelivered(endpoint, {change: [0, 1]});
665
+ await reporting.bind(endpoint, coordinatorEndpoint, ['haElectricalMeasurement']);
666
+ await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
667
+ await reporting.activePower(endpoint);
668
+ },
669
+ exposes: [e.switch(), e.power_on_behavior(), e.power(), e.energy()],
670
+ },
671
+ {
672
+ zigbeeModel: ['RBSH-SWD-ZB'],
673
+ model: 'BSEN-C2',
674
+ vendor: 'Bosch',
675
+ description: 'Door/window contact II',
676
+ fromZigbee: [fzLocal.bosch_contact],
677
+ toZigbee: [],
678
+ exposes: [e.battery_low(), e.contact(), e.action(['single', 'long'])],
679
+ },
680
+ {
681
+ zigbeeModel: ['RBSH-SP-ZB-FR'],
682
+ model: 'BSP-EZ2',
683
+ vendor: 'Bosch',
684
+ description: 'Plug compact FR',
685
+ fromZigbee: [fz.on_off, fz.power_on_behavior, fz.electrical_measurement, fz.metering],
686
+ toZigbee: [tz.on_off, tz.power_on_behavior],
687
+ configure: async (device, coordinatorEndpoint, logger) => {
688
+ const endpoint = device.getEndpoint(1);
689
+ await endpoint.read('genOnOff', ['onOff', 'startUpOnOff']);
690
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
691
+ await reporting.bind(endpoint, coordinatorEndpoint, ['seMetering']);
692
+ await reporting.readMeteringMultiplierDivisor(endpoint);
693
+ await reporting.currentSummDelivered(endpoint, {change: [0, 1]});
694
+ await reporting.bind(endpoint, coordinatorEndpoint, ['haElectricalMeasurement']);
695
+ await endpoint.read('haElectricalMeasurement', ['acPowerMultiplier', 'acPowerDivisor']);
696
+ await reporting.activePower(endpoint);
697
+ },
698
+ exposes: [e.switch(), e.power_on_behavior(), e.power(), e.energy()],
699
+ },
700
+ ];
701
+
702
+ module.exports = definition;