iobroker.poolcontrol 0.0.7 → 0.0.9

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/LICENSE CHANGED
@@ -1,22 +1,47 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 DasBo1975 <dasbo1975@outlook.de>
4
-
5
- Hiermit wird jedem, der eine Kopie dieser Software und der zugehörigen
6
- Dokumentationsdateien (die "Software") erhält, die Erlaubnis erteilt,
7
- die Software uneingeschränkt zu nutzen, einschließlich, aber nicht
8
- beschränkt auf das Recht, die Software zu verwenden, zu kopieren,
9
- zu ändern, zu verbinden, zu veröffentlichen, zu verbreiten,
10
- Unterlizenzen zu erteilen und/oder Kopien der Software zu verkaufen,
11
- sowie Personen, denen die Software zur Verfügung gestellt wird, dies zu gestatten,
12
- unter der Bedingung, dass der oben genannte Urheberrechtshinweis und dieser
13
- Erlaubnishinweis in allen Kopien oder wesentlichen Teilen der Software
14
- beibehalten werden.
15
-
16
- DIE SOFTWARE WIRD "WIE BESEHEN" OHNE JEDE GARANTIE, WEDER AUSDRÜCKLICH NOCH
17
- STILLSCHWEIGEND, EINSCHLIESSLICH, ABER NICHT BEGRENZT AUF DIE GARANTIEN DER
18
- MARKTGÄNGIGKEIT, EIGNUNG FÜR EINEN BESTIMMTEN ZWECK UND NICHTVERLETZUNG.
19
- IN KEINEM FALL HAFTEN DIE AUTOREN ODER COPYRIGHT-INHABER FÜR ANSPRÜCHE, SCHÄDEN
20
- ODER SONSTIGE HAFTUNG, OB IN EINER KLAGE ODER EINER ANDEREN HAFTUNGSGRUNDLAGE,
21
- DIE AUS ODER IM ZUSAMMENHANG MIT DER SOFTWARE ODER DER NUTZUNG DER SOFTWARE
22
- ODER ANDEREN VEREINBARUNGEN ENTSTEHT.
3
+ Copyright (c) 2025 DasBo1975
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ MIT-Lizenz
26
+
27
+ Copyright (c) 2025 DasBo1975
28
+
29
+ Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der
30
+ zugehörigen Dokumentationen (die "Software") erhält, die Erlaubnis erteilt,
31
+ sie uneingeschränkt zu nutzen, einschließlich und ohne Ausnahme des Rechts,
32
+ sie zu verwenden, zu kopieren, zu ändern, zusammenzuführen, zu veröffentlichen,
33
+ zu verbreiten, zu unterlizenzieren und/oder zu verkaufen, und Personen, denen
34
+ diese Software überlassen wird, diese Rechte zu verschaffen, unter den
35
+ folgenden Bedingungen:
36
+
37
+ Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen
38
+ Kopien oder Teilkopien der Software beizulegen.
39
+
40
+ DIE SOFTWARE WIRD OHNE JEDE AUSDRÜCKLICHE ODER STILLSCHWEIGENDE GARANTIE
41
+ BEREITGESTELLT, EINSCHLIESSLICH DER GARANTIE DER MARKTREIFE, DER EIGNUNG FÜR
42
+ EINEN BESTIMMTEN ZWECK UND DER NICHTVERLETZUNG VON RECHTEN DRITTER.
43
+ IN KEINEM FALL SIND DIE AUTOREN ODER URHEBERRECHTSINHABER FÜR ANSPRÜCHE,
44
+ SCHÄDEN ODER SONSTIGE VERPFLICHTUNGEN HAFTBAR ZU MACHEN, OB AUS EINEM
45
+ VERTRAG, EINER UNERLAUBTEN HANDLUNG ODER ANDERWEITIG ENTSTANDEN, DIE SICH AUS
46
+ ODER IN VERBINDUNG MIT DER SOFTWARE ODER DER VERWENDUNG ODER SONSTIGEN
47
+ HANDLUNGEN IN DER SOFTWARE ERGEBEN.
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # ioBroker.poolcontrol
2
2
 
3
3
  ![Test and Release](https://github.com/DasBo1975/iobroker.poolcontrol/actions/workflows/test-and-release.yml/badge.svg)
4
+ ![npm](https://img.shields.io/npm/v/iobroker.poolcontrol?color=blue)
5
+ ![Downloads](https://img.shields.io/npm/dm/iobroker.poolcontrol)
6
+ ![Installs](https://iobroker.live/badges/poolcontrol-installed.svg)
7
+ ![Stable](https://iobroker.live/badges/poolcontrol-stable.svg)
8
+ [![License](https://img.shields.io/github/license/DasBo1975/ioBroker.poolcontrol?cacheSeconds=3600)](https://github.com/DasBo1975/ioBroker.poolcontrol/blob/main/LICENSE)
4
9
 
5
10
  Der Adapter **ioBroker.poolcontrol** dient zur Steuerung und Überwachung von Poolanlagen.
6
11
  Er ermöglicht die Automatisierung von Pumpen, Temperatur- und Solarsteuerung sowie Verbrauchsauswertung.
@@ -89,6 +94,13 @@ Funktionen können sich ändern, bitte regelmäßig den Changelog beachten.
89
94
  ## Changelog
90
95
  Auszug, vollständige Liste siehe `io-package.json`:
91
96
 
97
+ ### 0.0.9
98
+ - Laufzeit-, Umwälz-, Verbrauch-/Kosten- und Temperatur-Min/Max-States sind jetzt persistent
99
+ (Werte bleiben nach Adapter-Neustart oder Stromausfall erhalten)
100
+
101
+ ### 0.0.8
102
+ - Hilfetab in der Instanzkonfiguration hinzugefügt (mit Link zur GitHub-Dokumentation)
103
+
92
104
  ### 0.0.7
93
105
  - Help-Datei (`help.md`) und erste README-Version hinzugefügt
94
106
 
@@ -124,6 +136,6 @@ Der Nutzer ist für die **sichere Installation und den Betrieb seiner Hardware**
124
136
 
125
137
  ---
126
138
 
127
- ## LICENSE
128
- [MIT](./LICENSE) License
129
- Copyright (c) 2025 DasBo1975
139
+ ## License
140
+ MIT License
141
+
@@ -137,7 +137,12 @@
137
137
  "pump_mode_hint": {
138
138
  "type": "staticText",
139
139
  "text": "Pumpenmodus (Automatik/Manuell/Aus/Zeit) kann über den Datenpunkt 'pump.mode' gesteuert werden.",
140
- "newLine": true
140
+ "newLine": true,
141
+ "xs": 12,
142
+ "sm": 12,
143
+ "md": 12,
144
+ "lg": 12,
145
+ "xl": 12
141
146
  },
142
147
  "divider10": {
143
148
  "type": "divider",
@@ -157,7 +162,12 @@
157
162
  "manual_safety_enabled_hint": {
158
163
  "type": "staticText",
159
164
  "text": "Wenn aktiviert, werden die Sicherheitsfunktionen wie Frostschutz und Überhitzungsschutz (Solar) weiterhin ausgeführt.",
160
- "newLine": true
165
+ "newLine": true,
166
+ "xs": 12,
167
+ "sm": 12,
168
+ "md": 12,
169
+ "lg": 12,
170
+ "xl": 12
161
171
  }
162
172
  }
163
173
  },
@@ -390,7 +400,12 @@
390
400
  "solar_collector_warn_hint": {
391
401
  "type": "staticText",
392
402
  "text": "Hinweis: Die Warnung wird automatisch zurückgesetzt, sobald die Temperatur 10 % unter die eingestellte Schwelle fällt.",
393
- "newLine": true
403
+ "newLine": true,
404
+ "xs": 12,
405
+ "sm": 12,
406
+ "md": 12,
407
+ "lg": 12,
408
+ "xl": 12
394
409
  }
395
410
  }
396
411
  },
@@ -893,9 +908,39 @@
893
908
  "consumption_hint": {
894
909
  "type": "staticText",
895
910
  "text": "Hinweis: Für die Verbrauchsberechnung wird ein externer kWh-Zähler benötigt (z. B. Messsteckdose).",
896
- "newLine": true
911
+ "newLine": true,
912
+ "xs": 12,
913
+ "sm": 12,
914
+ "md": 12,
915
+ "lg": 12,
916
+ "xl": 12
897
917
  }
898
918
  }
899
- }
919
+ },
920
+ "help": {
921
+ "type": "panel",
922
+ "label": "Hilfe",
923
+ "items": {
924
+ "divider_help": {
925
+ "type": "divider",
926
+ "newLine": true
927
+ },
928
+ "helpLink": {
929
+ "type": "staticLink",
930
+ "label": "Öffne die ausführliche Dokumentation auf GitHub",
931
+ "href": "https://github.com/DasBo1975/iobroker.poolcontrol/blob/main/admin/help.md",
932
+ "newLine": true,
933
+ "xs": 12,
934
+ "sm": 12,
935
+ "md": 12,
936
+ "lg": 12,
937
+ "xl": 12
938
+ },
939
+ "helpText": {
940
+ "type": "staticText",
941
+ "text": "Hier finden Sie die vollständige Dokumentation und Hinweise zu allen Einstellungen. Weitere Hinweise zu künftigen Versionen folgen."
942
+ }
943
+ }
944
+ }
900
945
  }
901
946
  }
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "poolcontrol",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "news": {
6
+ "0.0.9": {
7
+ "en": "Made runtime, circulation, consumption/costs and temperature min/max states persistent across restarts",
8
+ "de": "Laufzeit-, Umwälz-, Verbrauch-/Kosten- und Temperatur-Min/Max-States bleiben jetzt über Neustarts erhalten",
9
+ "ru": "Состояния времени работы, циркуляции, потребления/стоимости и мин/макс температуры теперь сохраняются при перезапуске",
10
+ "pt": "Estados de tempo de execução, circulação, consumo/custos e temperatura min/máx agora persistem após reinicializações",
11
+ "nl": "Runtime-, circulatie-, verbruiks-/kosten- en temperatuur min/max-states blijven nu behouden bij herstart",
12
+ "fr": "Les états de durée, de circulation, de consommation/coûts et de température min/max persistent désormais après redémarrage",
13
+ "it": "Gli stati di runtime, circolazione, consumo/costi e temperatura min/max ora persistono ai riavvii",
14
+ "es": "Los estados de tiempo de ejecución, circulación, consumo/costos y temperatura min/máx ahora persisten tras reinicios",
15
+ "pl": "Stany czasu pracy, cyrkulacji, zużycia/kosztów i temp. min/max są teraz zachowane po restartach",
16
+ "uk": "Стан часу роботи, циркуляції, споживання/вартості та мін/макс температури тепер зберігаються після перезапусків",
17
+ "zh-cn": "运行时间、循环、消耗/成本和温度最小/最大状态现在在重启后保持"
18
+ },
19
+ "0.0.8": {
20
+ "en": "Added Help tab in instance configuration with link to GitHub documentation",
21
+ "de": "Hilfetab in der Instanzkonfiguration hinzugefügt mit Link zur GitHub-Dokumentation",
22
+ "ru": "Добавлена вкладка помощи в настройке экземпляра со ссылкой на документацию GitHub",
23
+ "pt": "Guia de ajuda adicionado na configuração da instância com link para a documentação do GitHub",
24
+ "nl": "Help-tab toegevoegd in de instance-configuratie met link naar GitHub-documentatie",
25
+ "fr": "Onglet d'aide ajouté dans la configuration de l'instance avec lien vers la documentation GitHub",
26
+ "it": "Aggiunta scheda di aiuto nella configurazione dell'istanza con collegamento alla documentazione GitHub",
27
+ "es": "Se agregó pestaña de ayuda en la configuración de la instancia con enlace a la documentación de GitHub",
28
+ "pl": "Dodano kartę pomocy w konfiguracji instancji z linkiem do dokumentacji GitHub",
29
+ "uk": "Додано вкладку довідки в конфігурацію екземпляра з посиланням на документацію GitHub",
30
+ "zh-cn": "在实例配置中添加了帮助选项卡,并链接到 документацию GitHub"
31
+ },
6
32
  "0.0.7": {
7
33
  "en": "Added help file (help.md) and first README version",
8
34
  "de": "Hilfedatei (help.md) und erste README-Version hinzugefügt",
@@ -14,85 +40,7 @@
14
40
  "es": "Se agregó archivo de ayuda (help.md) y primera versión de README",
15
41
  "pl": "Dodano plik pomocy (help.md) i pierwszą wersję README",
16
42
  "uk": "Додано файл довідки (help.md) та першу версію README",
17
- "zh-cn": "添加了帮助文件 (help.md) 和第一个 README 版本"
18
- },
19
- "0.0.6": {
20
- "en": "Added consumption & cost calculation with external kWh meter",
21
- "de": "Verbrauchs- und Kostenberechnung mit externem kWh-Zähler hinzugefügt",
22
- "ru": "Добавлен расчет потребления и затрат с внешним счетчиком кВт·ч",
23
- "pt": "Adicionado cálculo de consumo e custo com medidor externo de kWh",
24
- "nl": "Verbruik- en kostenberekening toegevoegd met externe kWh-meter",
25
- "fr": "Ajout du calcul de consommation et de coût avec compteur kWh externe",
26
- "it": "Aggiunto calcolo di consumo e costi con contatore kWh esterno",
27
- "es": "Se agregó cálculo de consumo y costos con medidor externo de kWh",
28
- "pl": "Dodano obliczanie zużycia i kosztów z zewnętrznym licznikiem kWh",
29
- "uk": "Додано розрахунок споживання та витрат із зовнішнім лічильником кВт·год",
30
- "zh-cn": "新增使用外部千瓦时电表的消耗和成本计算"
31
- },
32
- "0.0.5": {
33
- "en": "Added speech output via Alexa and Telegram",
34
- "de": "Sprachausgaben über Alexa und Telegram hinzugefügt",
35
- "ru": "Добавлен голосовой вывод через Alexa и Telegram",
36
- "pt": "Adicionada saída de voz via Alexa e Telegram",
37
- "nl": "Spraakuitvoer toegevoegd via Alexa en Telegram",
38
- "fr": "Ajout de la sortie vocale via Alexa et Telegram",
39
- "it": "Aggiunta uscita vocale tramite Alexa e Telegram",
40
- "es": "Se agregó salida de voz a través de Alexa y Telegram",
41
- "pl": "Dodano wyjście głosowe przez Alexa i Telegram",
42
- "uk": "Додано голосовий вивід через Alexa та Telegram",
43
- "zh-cn": "新增通过 Alexa 和 Telegram 的语音输出"
44
- },
45
- "0.0.4": {
46
- "en": "Added runtime & circulation logic including new datapoint 'circulation.daily_required'",
47
- "de": "Laufzeit- und Umwälzlogik hinzugefügt, einschließlich neuem Datenpunkt 'circulation.daily_required'",
48
- "ru": "Добавлена логика времени работы и циркуляции, включая новую точку данных 'circulation.daily_required'",
49
- "pt": "Adicionada lógica de tempo de execução e circulação, incluindo novo datapoint 'circulation.daily_required'",
50
- "nl": "Runtime- en circulatielogica toegevoegd, inclusief nieuw datapoint 'circulation.daily_required'",
51
- "fr": "Ajout de la logique de temps d'exécution et de circulation, y compris le nouveau point de données 'circulation.daily_required'",
52
- "it": "Aggiunta logica di runtime e circolazione, incluso nuovo datapoint 'circulation.daily_required'",
53
- "es": "Se agregó lógica de tiempo de ejecución y circulación, incluido nuevo datapoint 'circulation.daily_required'",
54
- "pl": "Dodano logikę czasu pracy i cyrkulacji, w tym nowy punkt danych 'circulation.daily_required'",
55
- "uk": "Додано логіку часу роботи та циркуляції, включаючи нову точку даних 'circulation.daily_required'",
56
- "zh-cn": "新增运行时间和循环逻辑,包括新数据点 'circulation.daily_required'"
57
- },
58
- "0.0.3": {
59
- "en": "Added time control with up to 3 configurable time windows",
60
- "de": "Zeitsteuerung mit bis zu 3 konfigurierbaren Zeitfenstern hinzugefügt",
61
- "ru": "Добавлено управление временем с до 3 настраиваемыми временными окнами",
62
- "pt": "Adicionado controle de tempo com até 3 janelas de tempo configuráveis",
63
- "nl": "Tijdregeling toegevoegd met maximaal 3 configureerbare tijdvensters",
64
- "fr": "Ajout du contrôle du temps avec jusqu'à 3 fenêtres de temps configurables",
65
- "it": "Aggiunto controllo del tempo con fino a 3 finestre temporali configurabili",
66
- "es": "Se agregó control de tiempo con hasta 3 ventanas de tiempo configurables",
67
- "pl": "Dodano kontrolę czasu z maksymalnie 3 konfigurowalnymi oknami czasowymi",
68
- "uk": "Додано керування часом з до 3 налаштовуваними часовими вікнами",
69
- "zh-cn": "新增时间控制,最多可配置 3 个时间窗口"
70
- },
71
- "0.0.2": {
72
- "en": "Extended pump logic with error detection and safety functions",
73
- "de": "Pumpenlogik erweitert mit Fehlererkennung und Sicherheitsfunktionen",
74
- "ru": "Расширена логика насоса с обнаружением ошибок и функциями безопасности",
75
- "pt": "Lógica da bomba estendida com detecção de erros e funções de segurança",
76
- "nl": "Pomplogica uitgebreid met foutdetectie en veiligheidsfuncties",
77
- "fr": "Logique de pompe étendue avec détection d'erreurs et fonctions de sécurité",
78
- "it": "Logica della pompa estesa con rilevamento errori e funzioni di sicurezza",
79
- "es": "Lógica de la bomba ampliada con detección de errores y funciones de seguridad",
80
- "pl": "Rozszerzona logika pompy z wykrywaniem błędów i funkcjami bezpieczeństwa",
81
- "uk": "Розширена логіка насоса з виявленням помилок та функціями безпеки",
82
- "zh-cn": "扩展泵逻辑,具有错误检测和安全功能"
83
- },
84
- "0.0.1": {
85
- "en": "initial release",
86
- "de": "Erstveröffentlichung",
87
- "ru": "Начальная версия",
88
- "pt": "lançamento inicial",
89
- "nl": "Eerste uitgave",
90
- "fr": "Première version",
91
- "it": "Versione iniziale",
92
- "es": "Versión inicial",
93
- "pl": "Pierwsze wydanie",
94
- "uk": "Початкова версія",
95
- "zh-cn": "首次出版"
43
+ "zh-cn": "添加了帮助文件 (help.md) 和第一个 README 版本"
96
44
  }
97
45
  },
98
46
  "titleLang": {
@@ -155,22 +103,20 @@
155
103
  "js-controller": ">=6.0.11"
156
104
  }
157
105
  ],
158
- "globalDependencies": [
159
- {
160
- "admin": ">=7.0.23"
161
- }
162
- ]
106
+ "globalDependencies": {
107
+ "admin": ">=7.6.17"
108
+ },
109
+ "support": {
110
+ "donate": {
111
+ "paypal": "https://www.paypal.com/donate?business=dirk.bertin%40t-online.de"
112
+ }
113
+ }
163
114
  },
164
115
  "native": {
165
116
  "option1": true,
166
117
  "option2": "42"
167
118
  },
168
119
  "objects": [],
169
- "instanceObjects": [],
170
- "support": {
171
- "donate": {
172
- "paypal": "https://www.paypal.com/donate?business=dirk.bertin%40t-online.de"
173
- }
120
+ "instanceObjects": []
174
121
  }
175
- }
176
122
 
@@ -51,6 +51,20 @@ const pumpHelper = {
51
51
  if (this.deviceId) {
52
52
  this.adapter.subscribeForeignStates(this.deviceId);
53
53
  this.adapter.log.info(`[pumpHelper] Überwache Steckdose: ${this.deviceId}`);
54
+
55
+ // NEU: Initialwert übernehmen
56
+ this.adapter
57
+ .getForeignStateAsync(this.deviceId)
58
+ .then(s => {
59
+ if (s) {
60
+ const val = !!s.val;
61
+ this.adapter.setStateAsync('pump.pump_switch', { val, ack: true });
62
+ this.adapter.log.info(`[pumpHelper] Initialer Pumpenstatus von Steckdose übernommen: ${val}`);
63
+ }
64
+ })
65
+ .catch(err =>
66
+ this.adapter.log.warn(`[pumpHelper] Konnte initialen Pumpenstatus nicht laden: ${err.message}`),
67
+ );
54
68
  } else {
55
69
  this.adapter.log.info('[pumpHelper] Keine Objekt-ID für Pumpen-Steckdose konfiguriert');
56
70
  }
@@ -23,13 +23,43 @@ const runtimeHelper = {
23
23
  // Pumpenschalter überwachen
24
24
  this.adapter.subscribeStates('pump.pump_switch');
25
25
 
26
- // Tagesreset einplanen
27
- this._scheduleDailyReset();
26
+ // >>> NEU: Alte Werte aus States laden
27
+ this._restoreFromStates()
28
+ .then(() => {
29
+ // Tagesreset einplanen
30
+ this._scheduleDailyReset();
31
+
32
+ // Erst nach Restore einmal berechnen
33
+ this._updateStates();
34
+
35
+ this.adapter.log.info('[runtimeHelper] initialisiert (mit Restore)');
36
+ })
37
+ .catch(err => {
38
+ this.adapter.log.warn(`[runtimeHelper] Restore fehlgeschlagen: ${err.message}`);
39
+ this._scheduleDailyReset();
40
+ this._updateStates();
41
+ this.adapter.log.info('[runtimeHelper] initialisiert (ohne Restore)');
42
+ });
43
+ },
44
+
45
+ async _restoreFromStates() {
46
+ const total = Number((await this.adapter.getStateAsync('runtime.total'))?.val);
47
+ const today = Number((await this.adapter.getStateAsync('runtime.today'))?.val);
28
48
 
29
- // Gleich beim Start einmal berechnen
30
- this._updateStates();
49
+ if (Number.isFinite(total)) {
50
+ this.runtimeTotal = total;
51
+ }
52
+ if (Number.isFinite(today)) {
53
+ this.runtimeToday = today;
54
+ }
31
55
 
32
- this.adapter.log.info('[runtimeHelper] initialisiert');
56
+ // Falls Pumpe gerade läuft → Status wiederherstellen
57
+ const active = !!(await this.adapter.getStateAsync('pump.pump_switch'))?.val;
58
+ if (active) {
59
+ this.isRunning = true;
60
+ this.lastOn = Date.now();
61
+ this._startLiveTimer();
62
+ }
33
63
  },
34
64
 
35
65
  async handleStateChange(id, state) {
@@ -30,6 +30,11 @@ const temperatureHelper = {
30
30
  adapter.subscribeForeignStates(id);
31
31
  }
32
32
 
33
+ // >>> NEU: Alte Min/Max-Werte wiederherstellen
34
+ this._restoreMinMaxFromStates().catch(err =>
35
+ this.adapter.log.warn(`[temperatureHelper] Restore Min/Max fehlgeschlagen: ${err.message}`),
36
+ );
37
+
33
38
  // Reset um Mitternacht
34
39
  this._scheduleDailyReset();
35
40
 
@@ -216,6 +221,20 @@ const temperatureHelper = {
216
221
  }
217
222
  },
218
223
 
224
+ // >>> NEU: Restore von min/max beim Start
225
+ async _restoreMinMaxFromStates() {
226
+ for (const key of Object.keys(this.sensors)) {
227
+ const min = Number((await this.adapter.getStateAsync(`temperature.${key}.min_today`))?.val);
228
+ const max = Number((await this.adapter.getStateAsync(`temperature.${key}.max_today`))?.val);
229
+ if (Number.isFinite(min) || Number.isFinite(max)) {
230
+ this.minMax[key] = {
231
+ min: Number.isFinite(min) ? min : undefined,
232
+ max: Number.isFinite(max) ? max : undefined,
233
+ };
234
+ }
235
+ }
236
+ },
237
+
219
238
  cleanup() {
220
239
  if (this.resetTimer) {
221
240
  clearTimeout(this.resetTimer);
@@ -9,6 +9,8 @@
9
9
  * - costs.total_eur
10
10
  * - costs.day_eur, week_eur, month_eur, year_eur
11
11
  *
12
+ * States sind persistent - Werte bleiben erhalten nach Neustart
13
+ *
12
14
  * @param {import("iobroker").Adapter} adapter - ioBroker Adapter-Instanz
13
15
  */
14
16
  async function createConsumptionStates(adapter) {
@@ -39,10 +41,15 @@ async function createConsumptionStates(adapter) {
39
41
  unit: cfg.unit,
40
42
  read: true,
41
43
  write: false,
44
+ persist: true,
42
45
  },
43
46
  native: {},
44
47
  });
45
- await adapter.setStateAsync(`consumption.${id}`, { val: 0, ack: true });
48
+ // NUR falls noch kein Wert existiert (erste Installation)
49
+ const cur = await adapter.getStateAsync(`consumption.${id}`);
50
+ if (cur == null) {
51
+ await adapter.setStateAsync(`consumption.${id}`, { val: 0, ack: true });
52
+ }
46
53
  }
47
54
 
48
55
  // --- Kanal costs ---
@@ -70,10 +77,14 @@ async function createConsumptionStates(adapter) {
70
77
  unit: cfg.unit,
71
78
  read: true,
72
79
  write: false,
80
+ persist: true,
73
81
  },
74
82
  native: {},
75
83
  });
76
- await adapter.setStateAsync(`costs.${id}`, { val: 0, ack: true });
84
+ const cur = await adapter.getStateAsync(`costs.${id}`);
85
+ if (cur == null) {
86
+ await adapter.setStateAsync(`costs.${id}`, { val: 0, ack: true });
87
+ }
77
88
  }
78
89
  }
79
90
 
@@ -9,6 +9,8 @@
9
9
  * - circulation.daily_required
10
10
  * - circulation.daily_remaining
11
11
  *
12
+ * States sind persistent - behalten Werte über Neustart
13
+ *
12
14
  * @param {import("iobroker").Adapter} adapter - ioBroker Adapter-Instanz
13
15
  */
14
16
  async function createRuntimeStates(adapter) {
@@ -28,6 +30,7 @@ async function createRuntimeStates(adapter) {
28
30
  unit: 's',
29
31
  read: true,
30
32
  write: false,
33
+ persist: true,
31
34
  },
32
35
  native: {},
33
36
  });
@@ -41,6 +44,7 @@ async function createRuntimeStates(adapter) {
41
44
  unit: 's',
42
45
  read: true,
43
46
  write: false,
47
+ persist: true,
44
48
  },
45
49
  native: {},
46
50
  });
@@ -53,6 +57,7 @@ async function createRuntimeStates(adapter) {
53
57
  role: 'text',
54
58
  read: true,
55
59
  write: false,
60
+ persist: true,
56
61
  },
57
62
  native: {},
58
63
  });
@@ -73,6 +78,7 @@ async function createRuntimeStates(adapter) {
73
78
  unit: 'l',
74
79
  read: true,
75
80
  write: false,
81
+ persist: true,
76
82
  },
77
83
  native: {},
78
84
  });
@@ -86,6 +92,7 @@ async function createRuntimeStates(adapter) {
86
92
  unit: 'l',
87
93
  read: true,
88
94
  write: false,
95
+ persist: true,
89
96
  },
90
97
  native: {},
91
98
  });
@@ -103,6 +110,7 @@ async function createRuntimeStates(adapter) {
103
110
  unit: 'l',
104
111
  read: true,
105
112
  write: false,
113
+ persist: true,
106
114
  },
107
115
  native: {},
108
116
  });
@@ -16,6 +16,8 @@
16
16
  * - temperature.delta.surface_ground
17
17
  * - temperature.delta.flow_return
18
18
  *
19
+ * States mit Persistenz - bleiben erhalten bei Neustart
20
+ *
19
21
  * @param {import("iobroker").Adapter} adapter - ioBroker Adapter-Instanz
20
22
  */
21
23
  async function createTemperatureStates(adapter) {
@@ -97,6 +99,7 @@ async function createTemperatureStates(adapter) {
97
99
  unit: '°C',
98
100
  read: true,
99
101
  write: false,
102
+ persist: true,
100
103
  },
101
104
  native: {},
102
105
  });
@@ -110,6 +113,7 @@ async function createTemperatureStates(adapter) {
110
113
  unit: '°C',
111
114
  read: true,
112
115
  write: false,
116
+ persist: true,
113
117
  },
114
118
  native: {},
115
119
  });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "iobroker.poolcontrol",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Steuerung & Automatisierung für den Pool (Pumpe, Heizung, Ventile, Sensoren).",
5
5
  "author": "DasBo1975 <dasbo1975@outlook.de>",
6
- "homepage": "https://github.com/DasBo1975/iobroker.poolcontrol",
6
+ "homepage": "https://github.com/DasBo1975/ioBroker.poolcontrol",
7
7
  "license": "MIT",
8
8
  "keywords": [
9
+ "ioBroker",
9
10
  "pool",
10
11
  "pumpe",
11
12
  "solar",
@@ -14,7 +15,7 @@
14
15
  ],
15
16
  "repository": {
16
17
  "type": "git",
17
- "url": "https://github.com/DasBo1975/iobroker.poolcontrol.git"
18
+ "url": "https://github.com/DasBo1975/ioBroker.poolcontrol.git"
18
19
  },
19
20
  "engines": {
20
21
  "node": ">= 20"
@@ -54,7 +55,7 @@
54
55
  "translate": "translate-adapter"
55
56
  },
56
57
  "bugs": {
57
- "url": "https://github.com/DasBo1975/iobroker.poolcontrol/issues"
58
+ "url": "https://github.com/DasBo1975/ioBroker.poolcontrol/issues"
58
59
  },
59
60
  "readmeFilename": "README.md"
60
61
  }