iobroker.poolcontrol 1.3.18 → 1.3.20

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
@@ -188,6 +188,21 @@ New features are added regularly – please refer to the changelog.
188
188
  ---
189
189
 
190
190
  ## Changelog
191
+ ### 1.3.20 (2026-05-13)
192
+
193
+ - Added runtime self-healing for missed pump start events.
194
+ - Stabilized runtime and circulation calculations for delayed or filtered pump switch updates.
195
+ - Fixed a rare synchronization issue where circulation counting could stop although pump live values were still available.
196
+ - Protected time control states from being overwritten during adapter updates.
197
+ - Preserved configured time windows, start/end times and weekdays during adapter reinstallations or updates.
198
+
199
+ ### 1.3.19 (2026-05-13)
200
+
201
+ - Added runtime self-healing for missed pump start events
202
+ - Stabilized runtime and circulation calculations for delayed or filtered pump switch updates
203
+ - Fixed a rare synchronization issue where circulation counting could stop although pump live values were still available
204
+ - Improved internal runtime synchronization
205
+
191
206
  ### 1.3.18 (2026-05-11)
192
207
 
193
208
  - Fixed incorrect date display in the pH, ORP and TDS areas.
@@ -255,31 +270,6 @@ New features are added regularly – please refer to the changelog.
255
270
  - extended pH helper with history, trend and summary logic
256
271
  - existing pH input, evaluation and mix-run logic remain backward compatible
257
272
 
258
- ### 1.3.15 (2026-05-08)
259
-
260
- - Added speech source cooldown handling for solar and time announcements
261
- - Added configurable `speech.sources.*` states for source-based speech control
262
- - Reduced excessive solar speech notifications during unstable weather conditions
263
- - Added persistent numeric runtime second states:
264
- - `runtime.total_seconds`
265
- - `runtime.today_seconds`
266
- - `runtime.current_session_seconds`
267
- - `runtime.season_total_seconds`
268
- - Improved runtime restore handling using numeric fallback logic
269
- - Fixed live runtime display consistency for total, today and season runtimes
270
- - Improved season runtime handling using `status.season_active`
271
- - Converted runtime helper timers to ioBroker adapter timer methods
272
- - Improved runtime timer cleanup and reset protection
273
- - Improved speech logging for skipped and cooldown-limited announcements
274
-
275
- ### 1.3.14 (2026-05-08)
276
-
277
- - Improved runtime handling and persistence
278
- - Fixed season runtime calculation using the correct season state
279
- - Unified live runtime calculations for total, today and season values
280
- - Added numeric runtime second states for robust persistence and recovery
281
- - Converted runtime timers to adapter-managed timers for improved ioBroker compatibility
282
-
283
273
  ## Support
284
274
  - [ioBroker Forum](https://forum.iobroker.net/)
285
275
  - [GitHub Issues](https://github.com/DasBo1975/ioBroker.poolcontrol/issues)
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "poolcontrol",
4
- "version": "1.3.18",
4
+ "version": "1.3.20",
5
5
  "news": {
6
+ "1.3.20": {
7
+ "en": "Added runtime self-healing for missed pump start events and protected time control states from being overwritten during adapter updates.",
8
+ "de": "Runtime-Selbstheilung für verpasste Pumpenstart-Ereignisse ergänzt und Zeitsteuerungs-Datenpunkte vor dem Überschreiben bei Adapter-Updates geschützt.",
9
+ "ru": "Добавлено самовосстановление во время выполнения для пропущенных событий запуска насоса и защищены состояния контроля времени от перезаписи во время обновлений адаптера.",
10
+ "pt": "Adicionada autocorreção em tempo de execução para eventos de inicialização de bomba perdidos e estados de controle de tempo protegidos contra substituição durante atualizações do adaptador.",
11
+ "nl": "Zelfherstel tijdens runtime toegevoegd voor gemiste pompstartgebeurtenissen en beschermde tijdcontrolestatussen tegen overschrijving tijdens adapterupdates.",
12
+ "fr": "Ajout de l'auto-réparation au moment de l'exécution pour les événements de démarrage de pompe manqués et des états de contrôle du temps protégés contre l'écrasement lors des mises à jour de l'adaptateur.",
13
+ "it": "Aggiunta l'autoriparazione del runtime per gli eventi di mancato avvio della pompa e gli stati di controllo temporale protetti dalla sovrascrittura durante gli aggiornamenti dell'adattatore.",
14
+ "es": "Se agregó autorreparación en tiempo de ejecución para eventos de inicio de bomba perdidos y estados de control de tiempo protegidos para que no se sobrescriban durante las actualizaciones del adaptador.",
15
+ "pl": "Dodano funkcję samonaprawy w czasie wykonywania w przypadku nieodebranych zdarzeń uruchomienia pompy i zabezpieczono stany kontroli czasu przed nadpisaniem podczas aktualizacji adaptera.",
16
+ "uk": "Додано самовідновлення під час виконання для пропущених подій запуску насоса та захищено стани керування часом від перезапису під час оновлення адаптера.",
17
+ "zh-cn": "添加了针对错过的泵启动事件的运行时自我修复,并保护时间控制状态在适配器更新期间不被覆盖。"
18
+ },
19
+ "1.3.19": {
20
+ "en": "Added runtime self-healing for missed pump start events. Stabilized runtime and circulation calculations for delayed or filtered pump switch updates. Fixed a rare synchronization issue where circulation counting could stop although pump live values were still available. Improved internal runtime synchronization.",
21
+ "de": "Runtime-Selbstheilung für verpasste Pumpenstart-Ereignisse ergänzt. Laufzeit- und Umwälzberechnung bei verzögerten oder gefilterten Pumpenschalter-Updates stabilisiert. Seltenen Synchronisationsfehler behoben, bei dem die Umwälzberechnung trotz aktiver Pumpen-Livewerte stehen bleiben konnte. Interne Runtime-Synchronisierung verbessert.",
22
+ "ru": "Добавлено самовосстановление во время выполнения для пропущенных событий запуска насоса. Стабилизированные расчеты времени работы и циркуляции для отложенных или отфильтрованных обновлений переключателей насосов. Исправлена ​​редкая проблема синхронизации, из-за которой подсчет циркуляции мог остановиться, хотя текущие значения насоса все еще были доступны. Улучшена внутренняя синхронизация времени выполнения.",
23
+ "pt": "Adicionada autocorreção em tempo de execução para eventos de inicialização de bomba perdidos. Cálculos de tempo de execução e circulação estabilizados para atualizações de interruptores de bomba filtrados ou atrasados. Foi corrigido um raro problema de sincronização em que a contagem de circulação poderia parar embora os valores ativos da bomba ainda estivessem disponíveis. Sincronização de tempo de execução interna aprimorada.",
24
+ "nl": "Zelfherstel tijdens runtime toegevoegd voor gemiste pompstartgebeurtenissen. Gestabiliseerde looptijd- en circulatieberekeningen voor vertraagde of gefilterde updates van pompschakelaars. Er is een zeldzaam synchronisatieprobleem opgelost waarbij het tellen van de circulatie kon stoppen, hoewel de live-waarden van de pomp nog steeds beschikbaar waren. Verbeterde interne runtime-synchronisatie.",
25
+ "fr": "Ajout de l'auto-réparation du temps d'exécution pour les événements de démarrage de pompe manqués. Calculs de temps de fonctionnement et de circulation stabilisés pour les mises à jour retardées ou filtrées des interrupteurs de pompe. Correction d'un problème de synchronisation rare où le comptage de circulation pouvait s'arrêter même si les valeurs en direct de la pompe étaient toujours disponibles. Synchronisation d'exécution interne améliorée.",
26
+ "it": "Aggiunta l'autoriparazione del tempo di esecuzione per gli eventi di avvio della pompa mancati. Calcoli di autonomia e circolazione stabilizzati per aggiornamenti ritardati o filtrati dell'interruttore della pompa. Risolto un raro problema di sincronizzazione per cui il conteggio della circolazione poteva interrompersi anche se i valori in tempo reale della pompa erano ancora disponibili. Sincronizzazione runtime interna migliorata.",
27
+ "es": "Se agregó autorreparación en tiempo de ejecución para eventos de inicio de bomba perdidos. Cálculos de circulación y tiempo de funcionamiento estabilizados para actualizaciones retrasadas o filtradas del interruptor de la bomba. Se solucionó un problema de sincronización poco común por el cual el conteo de circulación podía detenerse aunque los valores activos de la bomba todavía estaban disponibles. Sincronización interna del tiempo de ejecución mejorada.",
28
+ "pl": "Dodano funkcję samonaprawy w czasie wykonywania w przypadku zdarzeń związanych z nieudanym uruchomieniem pompy. Stabilizowane obliczenia czasu pracy i cyrkulacji dla opóźnionych lub filtrowanych aktualizacji przełączników pomp. Naprawiono rzadki problem z synchronizacją, w wyniku którego zliczanie cyrkulacji mogło zostać zatrzymane, mimo że wartości bieżące pompy były nadal dostępne. Ulepszona wewnętrzna synchronizacja środowiska wykonawczego.",
29
+ "uk": "Додано самовідновлення під час виконання для пропущених подій запуску насоса. Стабілізований час роботи та обчислення циркуляції для відкладених або фільтрованих оновлень перемикача насоса. Виправлено рідкісну проблему синхронізації, через яку підрахунок циркуляції міг припинитися, хоча поточні значення насоса все ще були доступні. Покращена внутрішня синхронізація часу виконання.",
30
+ "zh-cn": "为错过的泵启动事件添加了运行时自我修复功能。延迟或过滤泵开关更新的稳定运行时间和循环计算。修复了一个罕见的同步问题,即尽管泵的实时值仍然可用,但循环计数可能会停止。改进了内部运行时同步。"
31
+ },
6
32
  "1.3.18": {
7
33
  "en": "Fixed incorrect date display for pH, ORP and TDS time states by storing value.time states as numeric timestamps.",
8
34
  "de": "Falsche Datumsanzeige für pH-, ORP- und TDS-Zeitzustände behoben, indem value.time-Zustände als numerische Zeitstempel gespeichert wurden.",
@@ -41,32 +67,6 @@
41
67
  "pl": "Poprawiona stabilność systemu mowy, ustabilizowana trwałość czasu działania, zmniejszona liczba powtarzających się powiadomień słonecznych, stałe obliczanie cyrkulacji w trybie czasowym i przygotowany nowy obszar analizy chemicznej ORP/Redox.",
42
68
  "uk": "Покращена стабільність мовної системи, стабілізована стійкість під час виконання, зменшено кількість повторюваних сонячних сповіщень, виправлено обчислення циркуляції в часовому режимі та підготовлено нову область аналізу ORP/Redox.",
43
69
  "zh-cn": "提高了语音系统的稳定性,稳定了运行时间的持久性,减少了重复的太阳通知,修复了时间模式下的循环计算,并准备了新的ORP/氧化还原化学分析区域。"
44
- },
45
- "1.3.15": {
46
- "en": "Added speech source cooldown handling, improved solar/time speech control, added persistent runtime second states, improved runtime restore logic and converted runtime timers to ioBroker adapter timers.",
47
- "de": "Sprachquellen mit Cooldown-Steuerung ergänzt, Solar-/Zeit-Sprachsteuerung verbessert, persistente Runtime-Sekundenstates hinzugefügt, Runtime-Wiederherstellung verbessert und Runtime-Timer auf ioBroker-Adapter-Timer umgestellt.",
48
- "ru": "Добавлена ​​обработка перезарядки источника речи, улучшено управление речью по солнечной энергии и времени, добавлены постоянные секунды времени выполнения, улучшена логика восстановления времени выполнения и преобразованы таймеры времени выполнения в таймеры адаптера ioBroker.",
49
- "pt": "Adicionado tratamento de resfriamento da fonte de fala, controle de fala solar/tempo aprimorado, segundos estados de tempo de execução persistentes adicionados, lógica de restauração de tempo de execução aprimorada e temporizadores de tempo de execução convertidos em temporizadores de adaptador ioBroker.",
50
- "nl": "Afkoeling van spraakbronnen toegevoegd, verbeterde spraakcontrole op zonne-energie/tijd, persistente tweede runtime-statussen toegevoegd, verbeterde runtime-herstellogica en geconverteerde runtime-timers naar ioBroker-adaptertimers.",
51
- "fr": "Ajout de la gestion du temps de recharge de la source vocale, du contrôle vocal solaire/temporel amélioré, ajout des seconds états d'exécution persistants, amélioration de la logique de restauration de l'exécution et conversion des minuteries d'exécution en minuteries d'adaptateur ioBroker.",
52
- "it": "Aggiunta la gestione del raffreddamento della sorgente vocale, controllo vocale solare/ora migliorato, aggiunti secondi stati di runtime persistenti, logica di ripristino del runtime migliorata e timer di runtime convertiti in timer dell'adattatore ioBroker.",
53
- "es": "Se agregó manejo de enfriamiento de la fuente de voz, control de voz solar/tiempo mejorado, se agregaron segundos estados de tiempo de ejecución persistentes, lógica de restauración de tiempo de ejecución mejorada y temporizadores de tiempo de ejecución convertidos en temporizadores de adaptador ioBroker.",
54
- "pl": "Dodano obsługę schładzania źródła mowy, ulepszoną kontrolę mowy w czasie słonecznym/czasem, dodano trwałe drugie stany czasu wykonania, ulepszoną logikę przywracania w czasie wykonywania i przekonwertowano liczniki czasu działania na liczniki czasu adaptera ioBroker.",
55
- "uk": "Додано обробку перезарядки джерела мовлення, покращено керування мовленням із сонячними променями/часом, додано постійні другі стани під час виконання, покращено логіку відновлення під час виконання та перетворено таймери часу виконання на таймери адаптера ioBroker.",
56
- "zh-cn": "添加了语音源冷却处理、改进了太阳/时间语音控制、添加了持久运行时第二状态、改进了运行时恢复逻辑并将运行时计时器转换为 ioBroker 适配器计时器。"
57
- },
58
- "1.3.14": {
59
- "en": "Improved runtime handling and persistence. Fixed season runtime calculation to use the correct season state, improved live runtime updates, added robust numeric runtime second states for safer persistence and recovery, and converted runtime timers to adapter-managed timers for better ioBroker compatibility.",
60
- "de": "Laufzeit-Handling und Persistenz verbessert. Saisonlaufzeit nutzt jetzt den korrekten Saison-Status, Live-Laufzeiten wurden vereinheitlicht, robuste Sekunden-States fuer Laufzeiten zur sicheren Wiederherstellung hinzugefuegt und Runtime-Timer auf adapterverwaltete Timer fuer bessere ioBroker-Kompatibilitaet umgestellt.",
61
- "ru": "Улучшена обработка и сохранение во время выполнения. Исправлен расчет времени выполнения сезона для использования правильного состояния сезона, улучшены обновления времени выполнения в режиме реального времени, добавлены надежные числовые значения второго состояния времени выполнения для более безопасного сохранения и восстановления, а также преобразованы таймеры времени выполнения в таймеры, управляемые адаптером, для лучшей совместимости с ioBroker.",
62
- "pt": "Melhor manipulação e persistência do tempo de execução. Cálculo de tempo de execução de temporada corrigido para usar o estado de temporada correto, atualizações de tempo de execução ao vivo aprimoradas, segundos estados de tempo de execução numéricos robustos adicionados para persistência e recuperação mais seguras e temporizadores de tempo de execução convertidos em temporizadores gerenciados por adaptador para melhor compatibilidade com ioBroker.",
63
- "nl": "Verbeterde runtime-afhandeling en persistentie. Vaste seizoensruntimeberekening om de juiste seizoensstatus te gebruiken, verbeterde live runtime-updates, robuuste numerieke runtime-secondestatussen toegevoegd voor veiliger persistentie en herstel, en geconverteerde runtime-timers naar door adapter beheerde timers voor betere ioBroker-compatibiliteit.",
64
- "fr": "Gestion de l'exécution et persistance améliorées. Correction du calcul de la durée d'exécution de la saison pour utiliser l'état de saison correct, mises à jour d'exécution en direct améliorées, ajout de seconds états d'exécution numériques robustes pour une persistance et une récupération plus sûres, et conversion des minuteries d'exécution en minuteries gérées par l'adaptateur pour une meilleure compatibilité ioBroker.",
65
- "it": "Gestione e persistenza del runtime migliorate. Risolto il problema con il calcolo del runtime della stagione per utilizzare lo stato della stagione corretto, aggiornamenti migliorati del runtime in tempo reale, aggiunti robusti secondi stati di runtime numerici per persistenza e ripristino più sicuri e timer di runtime convertiti in timer gestiti dall'adattatore per una migliore compatibilità con ioBroker.",
66
- "es": "Manejo y persistencia del tiempo de ejecución mejorados. Se corrigió el cálculo del tiempo de ejecución de la temporada para usar el estado correcto de la temporada, se mejoraron las actualizaciones del tiempo de ejecución en vivo, se agregaron segundos estados de tiempo de ejecución numéricos sólidos para una persistencia y recuperación más seguras y se convirtieron los temporizadores de tiempo de ejecución en temporizadores administrados por adaptador para una mejor compatibilidad con ioBroker.",
67
- "pl": "Poprawiona obsługa i trwałość środowiska wykonawczego. Naprawiono obliczanie czasu wykonania sezonu w celu wykorzystania prawidłowego stanu sezonu, ulepszono aktualizacje czasu działania na żywo, dodano solidne numeryczne drugie stany czasu działania dla bezpieczniejszej trwałości i odzyskiwania oraz przekonwertowano liczniki czasu działania na zegary zarządzane przez adapter dla lepszej kompatybilności z ioBroker.",
68
- "uk": "Покращена обробка та збереження часу виконання. Виправлено розрахунок часу виконання сезону для використання правильного стану сезону, покращено поточні оновлення середовища виконання, додано надійні численні секунди часу виконання для безпечнішого збереження та відновлення, а також перетворено таймери часу виконання на таймери, керовані адаптером, для кращої сумісності з ioBroker.",
69
- "zh-cn": "改进了运行时处理和持久性。修复了季节运行时计算以使用正确的季节状态,改进了实时运行时更新,添加了强大的数字运行时第二状态以实现更安全的持久性和恢复,并将运行时计时器转换为适配器管理的计时器以实现更好的 ioBroker 兼容性。"
70
70
  }
71
71
  },
72
72
  "titleLang": {
@@ -21,6 +21,7 @@ const runtimeHelper = {
21
21
  restoreTimer: null, // FIX: ioBroker timer for delayed restore
22
22
  resetTimer: null,
23
23
  liveTimer: null, // Timer für Live-Updates
24
+ syncTimer: null, // FIX: Timer zur Selbstheilung bei verpasstem Pumpenstart/-stopp
24
25
 
25
26
  /**
26
27
  * Initialisiert den Runtime-Helper.
@@ -54,6 +55,9 @@ const runtimeHelper = {
54
55
  // Tagesreset einplanen
55
56
  this._scheduleDailyReset();
56
57
 
58
+ // FIX: Start sync timer to recover from missed pump start/stop events
59
+ this._startSyncTimer();
60
+
57
61
  // Erst nach Restore einmal berechnen
58
62
  this._updateStates();
59
63
 
@@ -62,6 +66,10 @@ const runtimeHelper = {
62
66
  .catch(err => {
63
67
  this.adapter.log.warn(`[runtimeHelper] Restore failed: ${err.message}`);
64
68
  this._scheduleDailyReset();
69
+
70
+ // FIX: Start sync timer to recover from missed pump start/stop events
71
+ this._startSyncTimer();
72
+
65
73
  this._updateStates();
66
74
  this.adapter.log.debug('[runtimeHelper] Initialized (without restore)');
67
75
  });
@@ -112,7 +120,7 @@ const runtimeHelper = {
112
120
  this.lastOn = Date.now();
113
121
  this.startCountToday += 1;
114
122
 
115
- // Live-Timer starten (jede Minute)
123
+ // Live-Timer starten (alle 10 Sekunden)
116
124
  this._startLiveTimer();
117
125
 
118
126
  // Start sofort in State schreiben
@@ -389,6 +397,43 @@ const runtimeHelper = {
389
397
  }
390
398
  },
391
399
 
400
+ _startSyncTimer() {
401
+ if (this.syncTimer) {
402
+ this.adapter.clearInterval(this.syncTimer);
403
+ }
404
+
405
+ this.syncTimer = this.adapter.setInterval(() => this._syncPumpRuntimeState(), 30 * 1000);
406
+ this.adapter.log.debug('[runtimeHelper] FIX: Runtime sync timer started (checks every 30 seconds)');
407
+ },
408
+
409
+ async _syncPumpRuntimeState() {
410
+ try {
411
+ const pumpState = await this.adapter.getStateAsync('pump.pump_switch');
412
+ const pumpOn = pumpState?.val === true;
413
+
414
+ if (pumpOn && (!this.isRunning || !this.lastOn)) {
415
+ this.adapter.log.debug(
416
+ '[runtimeHelper] FIX: Pump switch is ON but runtime was not running. Synchronizing runtime start.',
417
+ );
418
+ await this.handleStateChange('pump.pump_switch', { val: true, ack: true });
419
+ return;
420
+ }
421
+
422
+ // FIX: Stop synchronization is intentionally not handled here.
423
+ // A missed stop event could otherwise cause duplicate runtime accounting
424
+ // during parallel async stop handling. Normal stop events are still handled
425
+ // through handleStateChange().
426
+ // if (!pumpOn && (this.isRunning || this.lastOn)) {
427
+ // this.adapter.log.debug(
428
+ // '[runtimeHelper] FIX: Pump switch is OFF but runtime was still running. Synchronizing runtime stop.',
429
+ // );
430
+ // await this.handleStateChange('pump.pump_switch', { val: false, ack: true });
431
+ // }
432
+ } catch (err) {
433
+ this.adapter.log.warn(`[runtimeHelper] Error while synchronizing pump runtime state: ${err.message}`);
434
+ }
435
+ },
436
+
392
437
  cleanup() {
393
438
  if (this.restoreTimer) {
394
439
  this.adapter.clearTimeout(this.restoreTimer);
@@ -400,6 +445,11 @@ const runtimeHelper = {
400
445
  this.resetTimer = null;
401
446
  }
402
447
 
448
+ if (this.syncTimer) {
449
+ this.adapter.clearInterval(this.syncTimer);
450
+ this.syncTimer = null;
451
+ }
452
+
403
453
  this._stopLiveTimer();
404
454
  },
405
455
  };
@@ -21,6 +21,16 @@ async function createTimeStates(adapter) {
21
21
  native: {},
22
22
  });
23
23
 
24
+ async function setInitialStateIfMissing(id, value) {
25
+ const current = await adapter.getStateAsync(id);
26
+ if (!current || current.val === null || current.val === undefined) {
27
+ await adapter.setStateAsync(id, {
28
+ val: value,
29
+ ack: true,
30
+ });
31
+ }
32
+ }
33
+
24
34
  async function createTimeWindow(prefix, label) {
25
35
  // Aktiv
26
36
  await adapter.setObjectNotExistsAsync(`timecontrol.${prefix}_active`, {
@@ -38,13 +48,13 @@ async function createTimeStates(adapter) {
38
48
  role: 'switch',
39
49
  read: true,
40
50
  write: true,
51
+ persist: true,
41
52
  },
42
53
  native: {},
43
54
  });
44
- await adapter.setStateAsync(`timecontrol.${prefix}_active`, {
45
- val: adapter.config[`${prefix}_active`],
46
- ack: true,
47
- });
55
+
56
+ // FIX: Initialwert nur setzen, wenn noch kein Statewert vorhanden ist
57
+ await setInitialStateIfMissing(`timecontrol.${prefix}_active`, !!adapter.config[`${prefix}_active`]);
48
58
 
49
59
  // Startzeit
50
60
  await adapter.setObjectNotExistsAsync(`timecontrol.${prefix}_start`, {
@@ -62,13 +72,12 @@ async function createTimeStates(adapter) {
62
72
  role: 'level',
63
73
  read: true,
64
74
  write: true,
75
+ persist: true,
65
76
  },
66
77
  native: {},
67
78
  });
68
- await adapter.setStateAsync(`timecontrol.${prefix}_start`, {
69
- val: adapter.config[`${prefix}_start`] || '00:00',
70
- ack: true,
71
- });
79
+ // FIX: Initialwert nur setzen, wenn noch kein Statewert vorhanden ist
80
+ await setInitialStateIfMissing(`timecontrol.${prefix}_start`, adapter.config[`${prefix}_start`] || '00:00');
72
81
 
73
82
  // Endzeit
74
83
  await adapter.setObjectNotExistsAsync(`timecontrol.${prefix}_end`, {
@@ -86,13 +95,12 @@ async function createTimeStates(adapter) {
86
95
  role: 'level',
87
96
  read: true,
88
97
  write: true,
98
+ persist: true,
89
99
  },
90
100
  native: {},
91
101
  });
92
- await adapter.setStateAsync(`timecontrol.${prefix}_end`, {
93
- val: adapter.config[`${prefix}_end`] || '00:00',
94
- ack: true,
95
- });
102
+ // FIX: Initialwert nur setzen, wenn noch kein Statewert vorhanden ist
103
+ await setInitialStateIfMissing(`timecontrol.${prefix}_end`, adapter.config[`${prefix}_end`] || '00:00');
96
104
 
97
105
  // Wochentage
98
106
  const days = [
@@ -121,13 +129,15 @@ async function createTimeStates(adapter) {
121
129
  role: 'switch',
122
130
  read: true,
123
131
  write: true,
132
+ persist: true,
124
133
  },
125
134
  native: {},
126
135
  });
127
- await adapter.setStateAsync(`timecontrol.${prefix}_day_${key}`, {
128
- val: adapter.config[`${prefix}_day_${key}`],
129
- ack: true,
130
- });
136
+ // FIX: Initialwert nur setzen, wenn noch kein Statewert vorhanden ist
137
+ await setInitialStateIfMissing(
138
+ `timecontrol.${prefix}_day_${key}`,
139
+ !!adapter.config[`${prefix}_day_${key}`],
140
+ );
131
141
  }
132
142
  }
133
143
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.poolcontrol",
3
- "version": "1.3.18",
3
+ "version": "1.3.20",
4
4
  "description": "Steuerung & Automatisierung für den Pool (Pumpe, Heizung, Ventile, Sensoren).",
5
5
  "author": "DasBo1975 <dasbo1975@outlook.de>",
6
6
  "homepage": "https://github.com/DasBo1975/ioBroker.poolcontrol",