iobroker.smartloadmanager 0.0.7 → 0.0.8

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
@@ -30,6 +30,11 @@ The **smartloadmanager** adapter is used for dynamic control of loads based on a
30
30
  Placeholder for the next version (at the beginning of the line):
31
31
  ### **WORK IN PROGRESS**
32
32
  -->
33
+ ### 0.0.8 (2025-10-03)
34
+
35
+ - (quorle) Fix for binary consumers that do not turn off
36
+ - (quorle) Fix for heating elements that are not switched off at max temperature
37
+
33
38
  ### 0.0.7 (2025-09-09)
34
39
 
35
40
  - (quorle) modified Readme
@@ -57,10 +62,6 @@ The **smartloadmanager** adapter is used for dynamic control of loads based on a
57
62
  - (quorle) Adjustments package.json
58
63
  - (quorle) Code changed
59
64
 
60
- ### 0.0.1 (2025-09-02)
61
-
62
- - (quorle) Release
63
-
64
65
  ## License
65
66
 
66
67
  MIT License
File without changes
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "smartloadmanager",
4
- "version": "0.0.7",
4
+ "version": "0.0.8",
5
5
  "news": {
6
+ "0.0.8": {
7
+ "en": "Fix for binary consumers that do not turn off\nFix for heating elements that are not switched off at max temperature",
8
+ "de": "Fix für binäre Verbraucher, die nicht ausschalten\nBefestigung für Heizelemente, die bei max Temperatur nicht abgeschaltet werden",
9
+ "ru": "Исправьте для бинарных потребителей, которые не отключаются\nИсправьте нагревательные элементы, которые не выключены при максимальной температуре",
10
+ "pt": "Corrigir para consumidores binários que não se desligam\nFixação para elementos de aquecimento que não são desligados à temperatura máxima",
11
+ "nl": "Fix voor binaire consumenten die niet uitschakelen\nFix voor verwarmingselementen die niet zijn uitgeschakeld bij maximale temperatuur",
12
+ "fr": "Correction pour les consommateurs binaires qui ne s'arrêtent pas\nFixation pour éléments chauffants qui ne sont pas éteints à la température maximale",
13
+ "it": "Fissare per i consumatori binari che non si spegne\nFissaggio per elementi di riscaldamento non spenti a temperatura massima",
14
+ "es": "Fijación para los consumidores binarios que no apagan\nFijación para elementos de calefacción que no se apagan a temperatura máxima",
15
+ "pl": "Napraw dla konsumentów binarnych, którzy nie wyłączają\nNaprawa elementów grzewczych, które nie są wyłączone w maksymalnej temperaturze",
16
+ "uk": "Виправлення для бінарних споживачів, які не вимкнено\nФіксація нагрівальних елементів, які не відключені при максимальній температурі",
17
+ "zh-cn": "为不关闭的二进制消费者修复\n用于未在最大温度下关闭的加热元素的修复"
18
+ },
6
19
  "0.0.7": {
7
20
  "en": "modified Readme\nGerman and English description created\nchore: cleanup devDependencies\nFixed bugs in timeouts in functions\nsetTimeout/setInterval allowed maximum values ​​implemented\n",
8
21
  "de": "geänderte Readme\nDeutsche und englische Beschreibung erstellt\nchore: devDependencies aufräumen\nFehler bei Timeouts in Funktionen behoben\nsetTimeout/setInterval erlaubte Höchstwerte implementiert\n",
package/main.js CHANGED
@@ -654,8 +654,24 @@ class ZeroFeedIn extends utils.Adapter {
654
654
  continue;
655
655
  }
656
656
 
657
+ // Temperatur-basierte Ausschaltung für heating
658
+ if (v.ruletype === 'heating' && v.maxTemperature !== undefined && isOn) {
659
+ const tempState = v.temperatureDatapoint
660
+ ? await this.getForeignStateAsync(v.temperatureDatapoint)
661
+ : null;
662
+ const currentTemp = tempState?.val !== undefined ? Number(tempState.val) : null;
663
+ if (currentTemp !== null && currentTemp >= v.maxTemperature) {
664
+ this.log.warn(
665
+ `"${v.name}" switched off due to maxTemperature reached: ${currentTemp}°C >= ${v.maxTemperature}°C`,
666
+ );
667
+ await this.switchConsumerWithDelay(v, false, 0);
668
+ continue; // weiter zum nächsten Verbraucher
669
+ }
670
+ }
671
+
657
672
  // Timer-Abbruch bei wegfallender Bedingung (Ausschalten)
658
- if (v.timer && v.timerEnd && v.pendingAction === false && withinWindow && !gridUsage) {
673
+ const surplus = feedIn - baseload;
674
+ if (v.timer && v.timerEnd && v.pendingAction === false && withinWindow && surplus >= v.switchOffPoint) {
659
675
  clearTimeout(v.timer);
660
676
  v.timer = null;
661
677
  v.timerEnd = null;
@@ -666,18 +682,26 @@ class ZeroFeedIn extends utils.Adapter {
666
682
  this.log.debug(`Switch-off timer for "${v.name}" canceled (condition no longer valid).`);
667
683
  }
668
684
 
669
- if (!v.alwaysOffAtTime && (!withinWindow || gridUsage)) {
685
+ // Ausschalten, wenn:
686
+ // - Zeitfenster verlassen ODER
687
+ // - Netzbezug aktiv ODER
688
+ // - Überschuss < switchOffPoint
689
+ const shouldSwitchOff = !withinWindow || gridUsage || surplus < v.switchOffPoint;
690
+
691
+ if (!v.alwaysOffAtTime && shouldSwitchOff) {
670
692
  if (v.timer && v.timerEnd && v.pendingAction === false) {
671
693
  const remaining = Math.max(0, Math.round((v.timerEnd - Date.now()) / 1000));
672
694
  this.log.debug(`Active timer for ${v.name}: ${remaining}s remaining`);
673
695
  } else {
674
- this.log.debug(`Switching off: "${v.name}" - offDelay ${v.switchOffDelay || 0}s.`);
696
+ this.log.debug(
697
+ `Switching off: "${v.name}" - surplus ${surplus}W < switchOffPoint ${v.switchOffPoint}W, offDelay ${v.switchOffDelay || 0}s.`,
698
+ );
675
699
  await this.switchConsumerWithDelay(v, false, v.switchOffDelay || 0);
676
700
  }
677
701
  }
678
702
  }
679
703
 
680
- // --- Batterie bleibt unverändert ---
704
+ // --- Batterie unverändert ---
681
705
  const batteryConsumers = this.consumerList.filter(c => c.ruletype === 'battery');
682
706
  for (const v of batteryConsumers) {
683
707
  await this.controlBattery(v, feedIn);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.smartloadmanager",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "This adapter allows devices to be controlled via PV surplus and thus achieve zero feed-in.",
5
5
  "author": {
6
6
  "name": "quorle",
@@ -36,7 +36,7 @@
36
36
  "@iobroker/eslint-config": "^2.1.0",
37
37
  "@iobroker/testing": "^5.1.1",
38
38
  "@tsconfig/node20": "^20.1.6",
39
- "@types/node": "^20.19.1",
39
+ "@types/node": "^24.3.1",
40
40
  "typescript": "~5.0.4"
41
41
  },
42
42
  "main": "main.js",