zigbee-herdsman-converters 25.35.0 → 25.36.0

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 (40) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/devices/bosch.d.ts.map +1 -1
  3. package/dist/devices/bosch.js +513 -63
  4. package/dist/devices/bosch.js.map +1 -1
  5. package/dist/devices/index.d.ts.map +1 -1
  6. package/dist/devices/index.js +2 -0
  7. package/dist/devices/index.js.map +1 -1
  8. package/dist/devices/lumi.js +2 -2
  9. package/dist/devices/lumi.js.map +1 -1
  10. package/dist/devices/schneider_electric.d.ts.map +1 -1
  11. package/dist/devices/schneider_electric.js +6 -2
  12. package/dist/devices/schneider_electric.js.map +1 -1
  13. package/dist/devices/slc.d.ts +3 -0
  14. package/dist/devices/slc.d.ts.map +1 -0
  15. package/dist/devices/slc.js +50 -0
  16. package/dist/devices/slc.js.map +1 -0
  17. package/dist/devices/tuya.d.ts.map +1 -1
  18. package/dist/devices/tuya.js +35 -9
  19. package/dist/devices/tuya.js.map +1 -1
  20. package/dist/lib/bosch.d.ts +3 -98
  21. package/dist/lib/bosch.d.ts.map +1 -1
  22. package/dist/lib/bosch.js +23 -543
  23. package/dist/lib/bosch.js.map +1 -1
  24. package/dist/lib/exposes.d.ts +2 -0
  25. package/dist/lib/exposes.d.ts.map +1 -1
  26. package/dist/lib/exposes.js +15 -0
  27. package/dist/lib/exposes.js.map +1 -1
  28. package/dist/lib/modernExtend.d.ts +0 -4
  29. package/dist/lib/modernExtend.d.ts.map +1 -1
  30. package/dist/lib/modernExtend.js +2 -5
  31. package/dist/lib/modernExtend.js.map +1 -1
  32. package/dist/lib/tuya.d.ts.map +1 -1
  33. package/dist/lib/tuya.js +3 -14
  34. package/dist/lib/tuya.js.map +1 -1
  35. package/dist/lib/utils.d.ts +1 -0
  36. package/dist/lib/utils.d.ts.map +1 -1
  37. package/dist/lib/utils.js +15 -1
  38. package/dist/lib/utils.js.map +1 -1
  39. package/dist/models-index.json +1 -1
  40. package/package.json +1 -1
@@ -36,7 +36,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.definitions = void 0;
37
37
  const zigbee_herdsman_1 = require("zigbee-herdsman");
38
38
  const fz = __importStar(require("../converters/fromZigbee"));
39
+ const tz = __importStar(require("../converters/toZigbee"));
39
40
  const bosch_1 = require("../lib/bosch");
41
+ const constants = __importStar(require("../lib/constants"));
40
42
  const constants_1 = require("../lib/constants");
41
43
  const exposes = __importStar(require("../lib/exposes"));
42
44
  const logger_1 = require("../lib/logger");
@@ -108,6 +110,258 @@ const boschBmctDzSettings = {
108
110
  hasDualSwitchInputs: false,
109
111
  };
110
112
  const boschExtend = {
113
+ hvacThermostatCluster: () => m.deviceAddCustomCluster("hvacThermostat", {
114
+ ID: zigbee_herdsman_1.Zcl.Clusters.hvacThermostat.ID,
115
+ attributes: {
116
+ operatingMode: {
117
+ ID: 0x4007,
118
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
119
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
120
+ },
121
+ heatingDemand: {
122
+ ID: 0x4020,
123
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
124
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
125
+ },
126
+ valveAdaptStatus: {
127
+ ID: 0x4022,
128
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
129
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
130
+ },
131
+ remoteTemperature: {
132
+ ID: 0x4040,
133
+ type: zigbee_herdsman_1.Zcl.DataType.INT16,
134
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
135
+ },
136
+ windowDetection: {
137
+ ID: 0x4042,
138
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
139
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
140
+ },
141
+ boostHeating: {
142
+ ID: 0x4043,
143
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
144
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
145
+ },
146
+ },
147
+ commands: {
148
+ calibrateValve: {
149
+ ID: 0x41,
150
+ parameters: [],
151
+ },
152
+ },
153
+ commandsResponse: {},
154
+ }),
155
+ hvacUserInterfaceCfgCluster: () => m.deviceAddCustomCluster("hvacUserInterfaceCfg", {
156
+ ID: zigbee_herdsman_1.Zcl.Clusters.hvacUserInterfaceCfg.ID,
157
+ attributes: {
158
+ displayOrientation: {
159
+ ID: 0x400b,
160
+ type: zigbee_herdsman_1.Zcl.DataType.UINT8,
161
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
162
+ },
163
+ displayedTemperature: {
164
+ ID: 0x4039,
165
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
166
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
167
+ },
168
+ displayOntime: {
169
+ ID: 0x403a,
170
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
171
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
172
+ },
173
+ displayBrightness: {
174
+ ID: 0x403b,
175
+ type: zigbee_herdsman_1.Zcl.DataType.ENUM8,
176
+ manufacturerCode: zigbee_herdsman_1.Zcl.ManufacturerCode.ROBERT_BOSCH_GMBH,
177
+ },
178
+ },
179
+ commands: {},
180
+ commandsResponse: {},
181
+ }),
182
+ operatingMode: () => m.enumLookup({
183
+ name: "operating_mode",
184
+ cluster: "hvacThermostat",
185
+ attribute: "operatingMode",
186
+ reporting: { min: "10_SECONDS", max: "MAX", change: null },
187
+ description: "Bosch-specific operating mode (overrides system mode)",
188
+ lookup: { schedule: 0x00, manual: 0x01, pause: 0x05 },
189
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
190
+ }),
191
+ windowDetection: () => m.binary({
192
+ name: "window_detection",
193
+ cluster: "hvacThermostat",
194
+ attribute: "windowDetection",
195
+ description: "Enable/disable window open (Lo.) mode",
196
+ valueOn: ["ON", 0x01],
197
+ valueOff: ["OFF", 0x00],
198
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
199
+ }),
200
+ boostHeating: () => m.binary({
201
+ name: "boost_heating",
202
+ cluster: "hvacThermostat",
203
+ attribute: "boostHeating",
204
+ reporting: { min: "10_SECONDS", max: "MAX", change: null, attribute: "boostHeating" },
205
+ description: "Activate boost heating (5 min. on TRV)",
206
+ valueOn: ["ON", 0x01],
207
+ valueOff: ["OFF", 0x00],
208
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
209
+ }),
210
+ childLock: () => m.binary({
211
+ name: "child_lock",
212
+ cluster: "hvacUserInterfaceCfg",
213
+ attribute: "keypadLockout",
214
+ description: "Enables/disables physical input on the device",
215
+ valueOn: ["LOCK", 0x01],
216
+ valueOff: ["UNLOCK", 0x00],
217
+ }),
218
+ displayOntime: () => m.numeric({
219
+ name: "display_ontime",
220
+ cluster: "hvacUserInterfaceCfg",
221
+ attribute: "displayOntime",
222
+ description: "Sets the display on-time",
223
+ valueMin: 5,
224
+ valueMax: 30,
225
+ unit: "s",
226
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
227
+ }),
228
+ displayBrightness: () => m.numeric({
229
+ name: "display_brightness",
230
+ cluster: "hvacUserInterfaceCfg",
231
+ attribute: "displayBrightness",
232
+ description: "Sets brightness of the display",
233
+ valueMin: 0,
234
+ valueMax: 10,
235
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
236
+ }),
237
+ valveAdaptProcess: () => {
238
+ const adaptationStatus = {
239
+ none: 0x00,
240
+ ready_to_calibrate: 0x01,
241
+ calibration_in_progress: 0x02,
242
+ error: 0x03,
243
+ success: 0x04,
244
+ };
245
+ const exposes = [
246
+ e
247
+ .binary("valve_adapt_process", ea.ALL, true, false)
248
+ .withLabel("Trigger adaptation process")
249
+ .withDescription('Trigger the valve adaptation process. Only possible when adaptation status is "ready_to_calibrate" or "error".')
250
+ .withCategory("config"),
251
+ ];
252
+ const fromZigbee = [
253
+ {
254
+ cluster: "hvacThermostat",
255
+ type: ["attributeReport", "readResponse"],
256
+ convert: (model, msg, publish, options, meta) => {
257
+ const result = {};
258
+ if (msg.data.valveAdaptStatus !== undefined) {
259
+ if (msg.data.valveAdaptStatus === adaptationStatus.calibration_in_progress) {
260
+ result.valve_adapt_process = true;
261
+ }
262
+ else {
263
+ result.valve_adapt_process = false;
264
+ }
265
+ }
266
+ return result;
267
+ },
268
+ },
269
+ ];
270
+ const toZigbee = [
271
+ {
272
+ key: ["valve_adapt_process"],
273
+ convertSet: async (entity, key, value, meta) => {
274
+ if (value === true) {
275
+ const adaptStatus = utils.getFromLookup(meta.state.valve_adapt_status, adaptationStatus);
276
+ switch (adaptStatus) {
277
+ case adaptationStatus.ready_to_calibrate:
278
+ case adaptationStatus.error:
279
+ await entity.command("hvacThermostat", "calibrateValve", {}, bosch_1.manufacturerOptions);
280
+ break;
281
+ default:
282
+ throw new Error("Valve adaptation process not possible right now.");
283
+ }
284
+ }
285
+ return { state: { valve_adapt_process: value } };
286
+ },
287
+ convertGet: async (entity, key, meta) => {
288
+ await entity.read("hvacThermostat", ["valveAdaptStatus"], bosch_1.manufacturerOptions);
289
+ },
290
+ },
291
+ ];
292
+ return {
293
+ exposes,
294
+ fromZigbee,
295
+ toZigbee,
296
+ isModernExtend: true,
297
+ };
298
+ },
299
+ heatingDemand: () => {
300
+ const fromZigbee = [
301
+ {
302
+ cluster: "hvacThermostat",
303
+ type: ["attributeReport", "readResponse"],
304
+ convert: (model, msg, publish, options, meta) => {
305
+ const result = {};
306
+ if (msg.data.heatingDemand !== undefined) {
307
+ const demand = msg.data.heatingDemand;
308
+ result.pi_heating_demand = demand;
309
+ result.running_state = demand > 0 ? "heat" : "idle";
310
+ }
311
+ return result;
312
+ },
313
+ },
314
+ ];
315
+ const toZigbee = [
316
+ {
317
+ key: ["pi_heating_demand"],
318
+ convertSet: async (entity, key, value, meta) => {
319
+ if (key === "pi_heating_demand") {
320
+ let demand = utils.toNumber(value, key);
321
+ demand = utils.numberWithinRange(demand, 0, 100);
322
+ await entity.write("hvacThermostat", { heatingDemand: demand }, bosch_1.manufacturerOptions);
323
+ return { state: { pi_heating_demand: demand } };
324
+ }
325
+ },
326
+ convertGet: async (entity, key, meta) => {
327
+ await entity.read("hvacThermostat", ["heatingDemand"], bosch_1.manufacturerOptions);
328
+ },
329
+ },
330
+ {
331
+ key: ["running_state"],
332
+ convertGet: async (entity, key, meta) => {
333
+ await entity.read("hvacThermostat", ["heatingDemand"], bosch_1.manufacturerOptions);
334
+ },
335
+ },
336
+ ];
337
+ return {
338
+ fromZigbee,
339
+ toZigbee,
340
+ isModernExtend: true,
341
+ };
342
+ },
343
+ ignoreDst: () => {
344
+ const fromZigbee = [
345
+ {
346
+ cluster: "genTime",
347
+ type: "read",
348
+ convert: async (model, msg, publish, options, meta) => {
349
+ if ("dstStart" in msg.data && "dstEnd" in msg.data && "dstShift" in msg.data) {
350
+ const response = {
351
+ dstStart: { attribute: 0x0003, status: zigbee_herdsman_1.Zcl.Status.SUCCESS, value: 0x00 },
352
+ dstEnd: { attribute: 0x0004, status: zigbee_herdsman_1.Zcl.Status.SUCCESS, value: 0x00 },
353
+ dstShift: { attribute: 0x0005, status: zigbee_herdsman_1.Zcl.Status.SUCCESS, value: 0x00 },
354
+ };
355
+ await msg.endpoint.readResponse(msg.cluster, msg.meta.zclTransactionSequenceNumber, response);
356
+ }
357
+ },
358
+ },
359
+ ];
360
+ return {
361
+ fromZigbee,
362
+ isModernExtend: true,
363
+ };
364
+ },
111
365
  smokeAlarm: () => {
112
366
  const smokeAlarm = {
113
367
  OFF: 0x0000,
@@ -592,6 +846,7 @@ exports.definitions = [
592
846
  bosch_1.boschBsirExtend.deviceState(),
593
847
  bosch_1.boschBsirExtend.alarmControl(),
594
848
  bosch_1.boschBsirExtend.iasZoneStatus(),
849
+ bosch_1.boschBsirExtend.battery(),
595
850
  bosch_1.boschBsirExtend.alarmMode(),
596
851
  bosch_1.boschBsirExtend.sirenVolume(),
597
852
  bosch_1.boschBsirExtend.sirenDuration(),
@@ -601,9 +856,6 @@ exports.definitions = [
601
856
  bosch_1.boschBsirExtend.primaryPowerSource(),
602
857
  bosch_1.boschBsirExtend.currentPowerSource(),
603
858
  bosch_1.boschBsirExtend.solarPanelVoltage(),
604
- bosch_1.boschGeneralExtend.batteryWithPercentageAndLowStatus({
605
- percentageReportingConfig: { min: "MIN", max: "MAX", change: 1 },
606
- }),
607
859
  ],
608
860
  ota: true,
609
861
  },
@@ -754,81 +1006,279 @@ exports.definitions = [
754
1006
  model: "BTH-RA",
755
1007
  vendor: "Bosch",
756
1008
  description: "Radiator thermostat II",
1009
+ meta: {
1010
+ overrideHaDiscoveryPayload: (payload) => {
1011
+ // Override climate discovery
1012
+ // https://github.com/Koenkk/zigbee2mqtt/pull/23075#issue-2355829475
1013
+ if (payload.mode_command_topic?.endsWith("/system_mode")) {
1014
+ payload.mode_command_topic = payload.mode_command_topic.substring(0, payload.mode_command_topic.lastIndexOf("/system_mode"));
1015
+ payload.mode_command_template =
1016
+ "{% set values = " +
1017
+ `{ 'auto':'schedule','heat':'manual','off':'pause'} %}` +
1018
+ `{"operating_mode": "{{ values[value] if value in values.keys() else 'pause' }}"}`;
1019
+ payload.mode_state_template =
1020
+ "{% set values = " +
1021
+ `{'schedule':'auto','manual':'heat','pause':'off'} %}` +
1022
+ `{% set value = value_json.operating_mode %}{{ values[value] if value in values.keys() else 'off' }}`;
1023
+ payload.modes = ["off", "heat", "auto"];
1024
+ }
1025
+ },
1026
+ },
1027
+ exposes: [
1028
+ e
1029
+ .climate()
1030
+ .withLocalTemperature(ea.STATE_GET, "Temperature used by the heating algorithm. " +
1031
+ "This is the temperature measured on the device (by default) or the remote temperature (if set within the last 30 min).")
1032
+ .withLocalTemperatureCalibration(-5, 5, 0.1)
1033
+ .withSetpoint("occupied_heating_setpoint", 5, 30, 0.5)
1034
+ .withSystemMode(["heat"])
1035
+ .withRunningState(["idle", "heat"], ea.STATE_GET),
1036
+ e.pi_heating_demand().withAccess(ea.ALL),
1037
+ ],
1038
+ fromZigbee: [fz.thermostat],
1039
+ toZigbee: [
1040
+ tz.thermostat_system_mode,
1041
+ tz.thermostat_occupied_heating_setpoint,
1042
+ tz.thermostat_local_temperature_calibration,
1043
+ tz.thermostat_local_temperature,
1044
+ tz.thermostat_keypad_lockout,
1045
+ ],
757
1046
  extend: [
758
- bosch_1.boschThermostatExtend.handleDaylightSavingTimeReadRequest(),
759
- bosch_1.boschThermostatExtend.customThermostatCluster(),
760
- bosch_1.boschThermostatExtend.customUserInterfaceCfgCluster(),
761
- bosch_1.boschThermostatExtend.raThermostat(),
762
- bosch_1.boschThermostatExtend.setpointChangeSource(),
763
- bosch_1.boschThermostatExtend.customHeatingDemand(),
764
- bosch_1.boschThermostatExtend.customRunningState(),
765
- bosch_1.boschThermostatExtend.operatingMode({
766
- description: "Bosch-specific operating mode (overrides system mode)",
1047
+ boschExtend.hvacThermostatCluster(),
1048
+ boschExtend.hvacUserInterfaceCfgCluster(),
1049
+ m.battery({
1050
+ percentage: true,
1051
+ lowStatus: false,
1052
+ }),
1053
+ boschExtend.operatingMode(),
1054
+ boschExtend.windowDetection(),
1055
+ boschExtend.boostHeating(),
1056
+ m.numeric({
1057
+ name: "remote_temperature",
1058
+ cluster: "hvacThermostat",
1059
+ attribute: "remoteTemperature",
1060
+ description: "Input for remote temperature sensor. Required at least every 30 min. to prevent fallback to internal sensor!",
1061
+ valueMin: 0.0,
1062
+ valueMax: 35.0,
1063
+ valueStep: 0.01,
1064
+ unit: "°C",
1065
+ scale: 100,
1066
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
1067
+ }),
1068
+ m.enumLookup({
1069
+ name: "setpoint_change_source",
1070
+ cluster: "hvacThermostat",
1071
+ attribute: "setpointChangeSource",
1072
+ reporting: { min: "10_SECONDS", max: "MAX", change: null },
1073
+ description: "Source of the current setpoint temperature",
1074
+ lookup: { manual: 0x00, schedule: 0x01, externally: 0x02 },
1075
+ access: "STATE_GET",
1076
+ }),
1077
+ boschExtend.childLock(),
1078
+ boschExtend.displayOntime(),
1079
+ boschExtend.displayBrightness(),
1080
+ m.enumLookup({
1081
+ name: "display_orientation",
1082
+ cluster: "hvacUserInterfaceCfg",
1083
+ attribute: "displayOrientation",
1084
+ description: "Sets orientation of the display",
1085
+ lookup: { normal: 0x00, flipped: 0x01 },
1086
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
1087
+ }),
1088
+ m.enumLookup({
1089
+ name: "displayed_temperature",
1090
+ cluster: "hvacUserInterfaceCfg",
1091
+ attribute: "displayedTemperature",
1092
+ description: "Temperature displayed on the TRV",
1093
+ lookup: { target: 0x00, measured: 0x01 },
1094
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
1095
+ }),
1096
+ m.enumLookup({
1097
+ name: "valve_adapt_status",
1098
+ cluster: "hvacThermostat",
1099
+ attribute: "valveAdaptStatus",
1100
+ reporting: { min: "10_SECONDS", max: "MAX", change: null },
1101
+ description: "Specifies the current status of the valve adaptation",
1102
+ lookup: {
1103
+ none: 0x00,
1104
+ ready_to_calibrate: 0x01,
1105
+ calibration_in_progress: 0x02,
1106
+ error: 0x03,
1107
+ success: 0x04,
1108
+ },
1109
+ zigbeeCommandOptions: bosch_1.manufacturerOptions,
1110
+ access: "STATE_GET",
1111
+ }),
1112
+ boschExtend.valveAdaptProcess(),
1113
+ boschExtend.heatingDemand(),
1114
+ boschExtend.ignoreDst(),
1115
+ m.bindCluster({
1116
+ cluster: "genPollCtrl",
1117
+ clusterType: "input",
767
1118
  }),
768
- bosch_1.boschThermostatExtend.windowOpenMode(),
769
- bosch_1.boschThermostatExtend.boostHeating(),
770
- bosch_1.boschThermostatExtend.remoteTemperature(),
771
- bosch_1.boschThermostatExtend.childLock(),
772
- bosch_1.boschThermostatExtend.displayBrightness(),
773
- bosch_1.boschThermostatExtend.displaySwitchOnDuration(),
774
- bosch_1.boschThermostatExtend.displayOrientation(),
775
- bosch_1.boschThermostatExtend.displayedTemperature(),
776
- bosch_1.boschThermostatExtend.valveAdaptation(),
777
- bosch_1.boschThermostatExtend.errorState(),
778
- bosch_1.boschGeneralExtend.batteryWithPercentageAndLowStatus(),
779
1119
  ],
780
1120
  ota: true,
1121
+ configure: async (device, coordinatorEndpoint) => {
1122
+ const endpoint = device.getEndpoint(1);
1123
+ await reporting.bind(endpoint, coordinatorEndpoint, ["hvacThermostat", "hvacUserInterfaceCfg"]);
1124
+ await reporting.thermostatTemperature(endpoint);
1125
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint, {
1126
+ min: constants.repInterval.SECONDS_10,
1127
+ max: constants.repInterval.HOUR,
1128
+ change: 50,
1129
+ });
1130
+ await reporting.thermostatKeypadLockMode(endpoint);
1131
+ await endpoint.configureReporting("hvacThermostat", [
1132
+ {
1133
+ attribute: "heatingDemand",
1134
+ minimumReportInterval: constants.repInterval.SECONDS_10,
1135
+ maximumReportInterval: constants.repInterval.MAX,
1136
+ reportableChange: null,
1137
+ },
1138
+ ], bosch_1.manufacturerOptions);
1139
+ await endpoint.read("genPowerCfg", ["batteryPercentageRemaining"]);
1140
+ await endpoint.read("hvacThermostat", ["localTemperatureCalibration", "setpointChangeSource"]);
1141
+ await endpoint.read("hvacThermostat", ["operatingMode", "heatingDemand", "valveAdaptStatus", "remoteTemperature", "windowDetection", "boostHeating"], bosch_1.manufacturerOptions);
1142
+ await endpoint.read("hvacUserInterfaceCfg", ["keypadLockout"]);
1143
+ await endpoint.read("hvacUserInterfaceCfg", ["displayOrientation", "displayedTemperature", "displayOntime", "displayBrightness"], bosch_1.manufacturerOptions);
1144
+ },
781
1145
  },
782
1146
  {
783
1147
  zigbeeModel: ["RBSH-RTH0-BAT-ZB-EU"],
784
1148
  model: "BTH-RM",
785
1149
  vendor: "Bosch",
786
- description: "Room thermostat II",
1150
+ description: "Room thermostat II (Battery model)",
1151
+ exposes: [
1152
+ e
1153
+ .climate()
1154
+ .withLocalTemperature()
1155
+ .withSetpoint("occupied_heating_setpoint", 4.5, 30, 0.5)
1156
+ .withSetpoint("occupied_cooling_setpoint", 4.5, 30, 0.5)
1157
+ .withLocalTemperatureCalibration(-5, 5, 0.1)
1158
+ .withSystemMode(["off", "heat", "cool"])
1159
+ .withRunningState(["idle", "heat", "cool"]),
1160
+ ],
1161
+ fromZigbee: [fz.thermostat, fz.hvac_user_interface],
1162
+ toZigbee: [
1163
+ tz.thermostat_system_mode,
1164
+ tz.thermostat_running_state,
1165
+ tz.thermostat_occupied_heating_setpoint,
1166
+ tz.thermostat_occupied_cooling_setpoint,
1167
+ tz.thermostat_programming_operation_mode, // NOTE: Only 0x0 & 0x1 supported
1168
+ tz.thermostat_local_temperature_calibration,
1169
+ tz.thermostat_local_temperature,
1170
+ tz.thermostat_temperature_setpoint_hold,
1171
+ tz.thermostat_temperature_display_mode,
1172
+ ],
787
1173
  extend: [
788
- bosch_1.boschGeneralExtend.handleZclVersionReadRequest(),
789
- bosch_1.boschThermostatExtend.handleDaylightSavingTimeReadRequest(),
790
- bosch_1.boschThermostatExtend.customThermostatCluster(),
791
- bosch_1.boschThermostatExtend.customUserInterfaceCfgCluster(),
792
- bosch_1.boschThermostatExtend.rmThermostat(),
793
- bosch_1.boschThermostatExtend.humidity(),
794
- bosch_1.boschThermostatExtend.cableSensorMode(),
795
- bosch_1.boschThermostatExtend.cableSensorTemperature(),
796
- bosch_1.boschThermostatExtend.operatingMode(),
797
- bosch_1.boschThermostatExtend.windowOpenMode(),
798
- bosch_1.boschThermostatExtend.boostHeating(),
799
- bosch_1.boschThermostatExtend.childLock(),
800
- bosch_1.boschThermostatExtend.displayBrightness(),
801
- bosch_1.boschThermostatExtend.displaySwitchOnDuration(),
802
- bosch_1.boschThermostatExtend.errorState(),
803
- bosch_1.boschThermostatExtend.rmBattery(),
1174
+ boschExtend.hvacThermostatCluster(),
1175
+ boschExtend.hvacUserInterfaceCfgCluster(),
1176
+ m.battery({
1177
+ voltageToPercentage: { min: 4400, max: 6400 },
1178
+ percentage: true,
1179
+ voltage: true,
1180
+ lowStatus: false,
1181
+ voltageReporting: true,
1182
+ percentageReporting: false,
1183
+ }),
1184
+ m.humidity(),
1185
+ boschExtend.operatingMode(),
1186
+ boschExtend.windowDetection(),
1187
+ boschExtend.boostHeating(),
1188
+ boschExtend.childLock(),
1189
+ boschExtend.displayOntime(),
1190
+ boschExtend.displayBrightness(),
1191
+ m.bindCluster({
1192
+ cluster: "genPollCtrl",
1193
+ clusterType: "input",
1194
+ }),
804
1195
  ],
805
1196
  ota: true,
1197
+ configure: async (device, coordinatorEndpoint) => {
1198
+ const endpoint = device.getEndpoint(1);
1199
+ await reporting.bind(endpoint, coordinatorEndpoint, ["hvacThermostat", "hvacUserInterfaceCfg"]);
1200
+ await reporting.thermostatSystemMode(endpoint);
1201
+ await reporting.thermostatRunningState(endpoint);
1202
+ await reporting.thermostatTemperature(endpoint);
1203
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint, {
1204
+ min: constants.repInterval.SECONDS_10,
1205
+ max: constants.repInterval.HOUR,
1206
+ change: 50,
1207
+ });
1208
+ await reporting.thermostatOccupiedCoolingSetpoint(endpoint, {
1209
+ min: constants.repInterval.SECONDS_10,
1210
+ max: constants.repInterval.HOUR,
1211
+ change: 50,
1212
+ });
1213
+ await reporting.thermostatKeypadLockMode(endpoint);
1214
+ await endpoint.read("genPowerCfg", ["batteryVoltage"]);
1215
+ await endpoint.read("hvacThermostat", ["localTemperatureCalibration"]);
1216
+ await endpoint.read("hvacThermostat", ["operatingMode", "windowDetection", "boostHeating"], bosch_1.manufacturerOptions);
1217
+ await endpoint.read("hvacUserInterfaceCfg", ["keypadLockout"]);
1218
+ await endpoint.read("hvacUserInterfaceCfg", ["displayOntime", "displayBrightness"], bosch_1.manufacturerOptions);
1219
+ },
806
1220
  },
807
1221
  {
808
1222
  zigbeeModel: ["RBSH-RTH0-ZB-EU"],
809
1223
  model: "BTH-RM230Z",
810
1224
  vendor: "Bosch",
811
1225
  description: "Room thermostat II 230V",
1226
+ exposes: [
1227
+ e
1228
+ .climate()
1229
+ .withLocalTemperature()
1230
+ .withSetpoint("occupied_heating_setpoint", 4.5, 30, 0.5)
1231
+ .withSetpoint("occupied_cooling_setpoint", 4.5, 30, 0.5)
1232
+ .withLocalTemperatureCalibration(-5, 5, 0.1)
1233
+ .withSystemMode(["off", "heat", "cool"])
1234
+ .withRunningState(["idle", "heat", "cool"]),
1235
+ ],
1236
+ fromZigbee: [fz.thermostat, fz.hvac_user_interface],
1237
+ toZigbee: [
1238
+ tz.thermostat_system_mode,
1239
+ tz.thermostat_running_state,
1240
+ tz.thermostat_occupied_heating_setpoint,
1241
+ tz.thermostat_occupied_cooling_setpoint,
1242
+ tz.thermostat_programming_operation_mode, // NOTE: Only 0x0 & 0x1 supported
1243
+ tz.thermostat_local_temperature_calibration,
1244
+ tz.thermostat_local_temperature,
1245
+ tz.thermostat_temperature_setpoint_hold,
1246
+ tz.thermostat_temperature_display_mode,
1247
+ ],
812
1248
  extend: [
813
- bosch_1.boschGeneralExtend.handleZclVersionReadRequest(),
814
- bosch_1.boschThermostatExtend.handleDaylightSavingTimeReadRequest(),
815
- bosch_1.boschThermostatExtend.customThermostatCluster(),
816
- bosch_1.boschThermostatExtend.customUserInterfaceCfgCluster(),
817
- bosch_1.boschThermostatExtend.rmThermostat(),
818
- bosch_1.boschThermostatExtend.humidity(),
819
- bosch_1.boschThermostatExtend.cableSensorMode(),
820
- bosch_1.boschThermostatExtend.cableSensorTemperature(),
821
- bosch_1.boschThermostatExtend.heaterType(),
822
- bosch_1.boschThermostatExtend.valveType(),
823
- bosch_1.boschThermostatExtend.operatingMode(),
824
- bosch_1.boschThermostatExtend.windowOpenMode(),
825
- bosch_1.boschThermostatExtend.boostHeating(),
826
- bosch_1.boschThermostatExtend.childLock(),
827
- bosch_1.boschThermostatExtend.displayBrightness(),
828
- bosch_1.boschThermostatExtend.displaySwitchOnDuration(),
829
- bosch_1.boschThermostatExtend.errorState(),
1249
+ boschExtend.hvacThermostatCluster(),
1250
+ boschExtend.hvacUserInterfaceCfgCluster(),
1251
+ m.humidity(),
1252
+ boschExtend.operatingMode(),
1253
+ boschExtend.windowDetection(),
1254
+ boschExtend.boostHeating(),
1255
+ boschExtend.childLock(),
1256
+ boschExtend.displayOntime(),
1257
+ boschExtend.displayBrightness(),
830
1258
  ],
831
1259
  ota: true,
1260
+ configure: async (device, coordinatorEndpoint) => {
1261
+ const endpoint = device.getEndpoint(1);
1262
+ await reporting.bind(endpoint, coordinatorEndpoint, ["hvacThermostat", "hvacUserInterfaceCfg"]);
1263
+ await reporting.thermostatSystemMode(endpoint);
1264
+ await reporting.thermostatRunningState(endpoint);
1265
+ await reporting.thermostatTemperature(endpoint);
1266
+ await reporting.thermostatOccupiedHeatingSetpoint(endpoint, {
1267
+ min: constants.repInterval.SECONDS_10,
1268
+ max: constants.repInterval.HOUR,
1269
+ change: 50,
1270
+ });
1271
+ await reporting.thermostatOccupiedCoolingSetpoint(endpoint, {
1272
+ min: constants.repInterval.SECONDS_10,
1273
+ max: constants.repInterval.HOUR,
1274
+ change: 50,
1275
+ });
1276
+ await reporting.thermostatKeypadLockMode(endpoint);
1277
+ await endpoint.read("hvacThermostat", ["localTemperatureCalibration"]);
1278
+ await endpoint.read("hvacThermostat", ["operatingMode", "windowDetection", "boostHeating"], bosch_1.manufacturerOptions);
1279
+ await endpoint.read("hvacUserInterfaceCfg", ["keypadLockout"]);
1280
+ await endpoint.read("hvacUserInterfaceCfg", ["displayOntime", "displayBrightness"], bosch_1.manufacturerOptions);
1281
+ },
832
1282
  },
833
1283
  {
834
1284
  zigbeeModel: ["Champion"],
@@ -958,7 +1408,7 @@ exports.definitions = [
958
1408
  vendor: "Bosch",
959
1409
  description: "Smart plug compact (type F plug)",
960
1410
  extend: [
961
- bosch_1.boschGeneralExtend.customMeteringCluster(),
1411
+ bosch_1.boschGeneralExtend.customSeMeteringCluster(),
962
1412
  bosch_1.boschSmartPlugExtend.smartPlugCluster(),
963
1413
  bosch_1.boschSmartPlugExtend.onOff(),
964
1414
  bosch_1.boschGeneralExtend.autoOff(),
@@ -978,7 +1428,7 @@ exports.definitions = [
978
1428
  description: "Smart plug compact [+M]",
979
1429
  extend: [
980
1430
  bosch_1.boschGeneralExtend.handleZclVersionReadRequest(),
981
- bosch_1.boschGeneralExtend.customMeteringCluster(),
1431
+ bosch_1.boschGeneralExtend.customSeMeteringCluster(),
982
1432
  bosch_1.boschSmartPlugExtend.smartPlugCluster(),
983
1433
  bosch_1.boschSmartPlugExtend.onOff(),
984
1434
  bosch_1.boschGeneralExtend.autoOff(),
@@ -998,7 +1448,7 @@ exports.definitions = [
998
1448
  bosch_1.boschDoorWindowContactExtend.reportContactState(),
999
1449
  bosch_1.boschDoorWindowContactExtend.reportButtonActions(),
1000
1450
  bosch_1.boschDoorWindowContactExtend.breakFunctionality(),
1001
- bosch_1.boschGeneralExtend.batteryWithPercentageAndLowStatus(),
1451
+ bosch_1.boschDoorWindowContactExtend.battery(),
1002
1452
  ],
1003
1453
  ota: true,
1004
1454
  },
@@ -1013,7 +1463,7 @@ exports.definitions = [
1013
1463
  bosch_1.boschDoorWindowContactExtend.reportButtonActions(),
1014
1464
  bosch_1.boschDoorWindowContactExtend.vibrationDetection(),
1015
1465
  bosch_1.boschDoorWindowContactExtend.breakFunctionality(),
1016
- bosch_1.boschGeneralExtend.batteryWithPercentageAndLowStatus(),
1466
+ bosch_1.boschDoorWindowContactExtend.battery(),
1017
1467
  ],
1018
1468
  },
1019
1469
  {
@@ -1026,7 +1476,7 @@ exports.definitions = [
1026
1476
  bosch_1.boschDoorWindowContactExtend.reportContactState(),
1027
1477
  bosch_1.boschDoorWindowContactExtend.reportButtonActions({ doublePressSupported: true }),
1028
1478
  bosch_1.boschDoorWindowContactExtend.breakFunctionality(),
1029
- bosch_1.boschGeneralExtend.batteryWithPercentageAndLowStatus(),
1479
+ bosch_1.boschDoorWindowContactExtend.battery(),
1030
1480
  ],
1031
1481
  },
1032
1482
  {
@@ -1198,7 +1648,7 @@ exports.definitions = [
1198
1648
  }),
1199
1649
  bosch_1.boschGeneralExtend.handleZclVersionReadRequest(),
1200
1650
  bosch_1.boschBmctExtend.slzExtends(),
1201
- bosch_1.boschGeneralExtend.customMeteringCluster(),
1651
+ bosch_1.boschGeneralExtend.customSeMeteringCluster(),
1202
1652
  bosch_1.boschGeneralExtend.resetEnergyMeters(),
1203
1653
  ],
1204
1654
  ota: true,