iobroker.schlueter-thermostat 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -222,6 +222,10 @@ Enable **debug log level** to see cloud communication.
222
222
  Placeholder for the next version (at the beginning of the line):
223
223
  ### **WORK IN PROGRESS**
224
224
  -->
225
+ ### 0.2.3 (2026-01-28)
226
+
227
+ - (patricknitsch) Catch wrong values for Temperature and Regulation Mode
228
+
225
229
  ### 0.2.2 (2026-01-28)
226
230
 
227
231
  - (patricknitsch) Update setStates for ComfortMode
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "schlueter-thermostat",
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "news": {
6
+ "0.2.3": {
7
+ "en": "Catch wrong values for Temperature and Regulation Mode",
8
+ "de": "Falsche Werte für Temperatur und Regelungsmodus einfangen",
9
+ "ru": "Улавливать неправильные значения температуры и режима регулирования",
10
+ "pt": "Valores errados de captura para a temperatura e o modo de regulação",
11
+ "nl": "Verkeerde vangwaarden voor temperatuur- en regelmodus",
12
+ "fr": "Capturer des valeurs erronées en mode température et régulation",
13
+ "it": "Cattura valori errati per la modalità Temperatura e Regolamento",
14
+ "es": "Obtener valores incorrectos para el modo de temperatura y regulación",
15
+ "pl": "Nieprawidłowe wartości połowu dla trybu temperatury i regulacji",
16
+ "uk": "Випадкові значення для режиму температури та регулювання",
17
+ "zh-cn": "获取温度和调节模式的错误值"
18
+ },
6
19
  "0.2.2": {
7
20
  "en": "Update setStates for ComfortMode\nMore Debugging",
8
21
  "de": "Update setStates für ComfortMode\nMehr Debugging",
package/main.js CHANGED
@@ -466,6 +466,8 @@ class SchlueterThermostat extends utils.Adapter {
466
466
  unit: '°C',
467
467
  read: true,
468
468
  write: true,
469
+ min: 12,
470
+ max: 35,
469
471
  });
470
472
  await ensureState(`${devId}.setpoint.comfortSet`, {
471
473
  name: 'Set comfort setpoint',
@@ -474,14 +476,17 @@ class SchlueterThermostat extends utils.Adapter {
474
476
  unit: '°C',
475
477
  read: true,
476
478
  write: true,
479
+ min: 12,
480
+ max: 35,
477
481
  });
478
482
  await ensureState(`${devId}.regulationModeSet`, {
479
483
  name: 'Set regulation mode',
480
484
  type: 'number',
481
485
  role: 'level',
482
486
  read: true,
483
- max: 9,
484
487
  write: true,
488
+ min: 0,
489
+ max: 9,
485
490
  });
486
491
 
487
492
  await this.safeSetObjectNotExists(`${devId}.endTime`, {
@@ -580,6 +585,8 @@ class SchlueterThermostat extends utils.Adapter {
580
585
  unit: '°C',
581
586
  read: true,
582
587
  write: true,
588
+ min: 12,
589
+ max: 35,
583
590
  });
584
591
 
585
592
  await this.safeSetObjectNotExists(`${devId}.schedule`, {
@@ -857,10 +864,15 @@ class SchlueterThermostat extends utils.Adapter {
857
864
  };
858
865
 
859
866
  const devPrefix = `groups.${safeId(groupId)}.thermostats.${safeId(thermostatId)}`;
867
+ const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
860
868
 
861
869
  try {
862
870
  if (sub === 'setpoint.manualSet') {
863
- const tempC = Number(state.val);
871
+ let tempC = Number(state.val);
872
+ if (!Number.isFinite(tempC)) {
873
+ throw new Error('Invalid temperature');
874
+ }
875
+ tempC = clamp(tempC, 12, 35);
864
876
  this.log.debug(`Write: UpdateThermostat serial=${serial} (ManualModeSetpoint=${tempC}C)`);
865
877
  await client.updateThermostat(serial, {
866
878
  ...baseUpdate,
@@ -869,7 +881,11 @@ class SchlueterThermostat extends utils.Adapter {
869
881
  });
870
882
  this.safeSetState(id, { val: tempC, ack: true });
871
883
  } else if (sub === 'setpoint.comfortSet') {
872
- const tempC = Number(state.val);
884
+ let tempC = Number(state.val);
885
+ if (!Number.isFinite(tempC)) {
886
+ throw new Error('Invalid temperature');
887
+ }
888
+ tempC = clamp(tempC, 12, 35);
873
889
  const comfortToSend = this._nowPlusMinutesIso(180);
874
890
  this.log.debug(
875
891
  `Write: UpdateThermostat serial=${serial} (ComfortSetpoint=${tempC}C) (ComfortEndTime=${comfortToSend})`,
@@ -884,8 +900,12 @@ class SchlueterThermostat extends utils.Adapter {
884
900
  this.safeSetState(`${devPrefix}.endTime.comfortSet`, comfortToSend, true);
885
901
  this.safeSetState(id, { val: tempC, ack: true });
886
902
  } else if (sub === 'regulationModeSet') {
887
- const mode = Number(state.val);
888
-
903
+ let mode = Number(state.val);
904
+ if (!Number.isFinite(mode)) {
905
+ throw new Error('Invalid regulation mode');
906
+ }
907
+ mode = Math.trunc(mode);
908
+ mode = clamp(mode, 0, 9);
889
909
  if (mode === 8) {
890
910
  const boostToSend = this._nowPlusMinutesIso(180);
891
911
  this.log.debug(`Write: Boost mode=8 serial=${serial} BoostEndTime=${boostToSend}`);
@@ -958,7 +978,11 @@ class SchlueterThermostat extends utils.Adapter {
958
978
  this.safeSetState(id, { val: endIso, ack: true });
959
979
  this.safeSetState(`${devPrefix}.vacation.end`, { val: endIso, ack: true });
960
980
  } else if (sub === 'vacation.temperatureSet') {
961
- const tempC = Number(state.val);
981
+ let tempC = Number(state.val);
982
+ if (!Number.isFinite(tempC)) {
983
+ throw new Error('Invalid temperature');
984
+ }
985
+ tempC = clamp(tempC, 12, 35); // NEW
962
986
  this.log.debug(`Write: UpdateThermostat serial=${serial} (VacationTemperature=${tempC}C)`);
963
987
 
964
988
  const tempNum = cToNum(tempC);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.schlueter-thermostat",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Floor heating controlled with Ditra Heat Thermostat",
5
5
  "author": {
6
6
  "name": "patricknitsch",