iobroker.poolcontrol 1.3.21 → 1.3.23

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,25 @@ New features are added regularly – please refer to the changelog.
188
188
  ---
189
189
 
190
190
  ## Changelog
191
+ ### 1.3.23 (2026-05-26)
192
+
193
+ - Added extended temperature diagnostics for all temperature sensors:
194
+ - last valid value
195
+ - last valid value timestamp
196
+ - minutes since last value
197
+ - source status (`ok`, `warning`, `not_received`, `invalid_timestamp`)
198
+ - Added automatic recovery mechanism for stalled temperature updates
199
+ - Recovery runs only when a sensor enters warning state and uses cooldown protection
200
+ - Switched temperature helper timers to ioBroker adapter timers
201
+ - Improved visibility and troubleshooting for missing or delayed temperature updates
202
+
203
+ ### 1.3.22 (2026-05-24)
204
+
205
+ - Improved ORP pH reference synchronization
206
+ - ORP helper now updates pH reference independently from ORP value processing
207
+ - Immediate update of ORP pH reference when pH enabled state or pH value changes
208
+ - Fixed missing pH reference updates when ORP evaluation was blocked, invalid or waiting for measurement conditions
209
+
191
210
  ### 1.3.21 (2026-05-17)
192
211
 
193
212
  NEW: Follow-pump devices
@@ -230,44 +249,6 @@ Features:
230
249
  - Fixed a rare synchronization issue where circulation counting could stop although pump live values were still available
231
250
  - Improved internal runtime synchronization
232
251
 
233
- ### 1.3.18 (2026-05-11)
234
-
235
- - Fixed incorrect date display in the pH, ORP and TDS areas.
236
- - Time states with `value.time` are now stored as numeric timestamps instead of localized date strings.
237
- - Improved compatibility with ioBroker/Admin date handling.
238
- - Added backward-compatible handling for previously stored German date strings.
239
- - Kept history JSON output unchanged with readable date strings for users and VIS displays.
240
-
241
- ### 1.3.17 (2026-05-11)
242
-
243
- - Fixed release/upload issue from v1.3.16.
244
- - Fixed circulation calculation in time mode when live flow values were not recalculated after helper-driven pump starts.
245
- - Improved speech system stability.
246
- - Stabilized runtime persistence.
247
- - Reduced repeated solar notifications.
248
- - Added internal stability improvements.
249
-
250
- - Added new ORP/Redox chemistry preparation:
251
- - new `chemistryOrpStates.js`
252
- - new `chemistryOrpHelper.js`
253
- - integrated ORP handling into `main.js`
254
- - supports disabled/manual/state input modes
255
- - ORP value handling in mV
256
- - pH reference from `chemistry.ph.enabled` and `chemistry.ph.input.current_value`
257
- - measurement location, pump and stabilization logic aligned with pH/TDS
258
- - ORP evaluation without automatic dosing or chlorine control
259
- - ORP 24h/7d/30d trend support
260
- - ORP history support
261
- - ORP text/HTML/JSON outputs
262
-
263
- - Added ORP i18n texts.
264
- - Aligned pH structure with TDS/ORP:
265
- - added `chemistry.ph.history.*`
266
- - added `chemistry.ph.trend.*`
267
- - added `chemistry.ph.outputs.*`
268
- - extended pH helper with history, trend and summary logic
269
- - existing pH input, evaluation and mix-run logic remain backward compatible
270
-
271
252
  ## Support
272
253
  - [ioBroker Forum](https://forum.iobroker.net/)
273
254
  - [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.21",
4
+ "version": "1.3.23",
5
5
  "news": {
6
+ "1.3.23": {
7
+ "en": "Temperature diagnostics extended: Added new diagnostic states for all temperature sensors (last valid value, timestamp, minutes since last value, source status). Added self-healing/recovery mechanism for stalled or missing temperature events. Temperature helper updated to ioBroker-compliant timers.",
8
+ "de": "Temperaturbereich erweitert: Neue Diagnosewerte für alle Temperatursensoren ergänzt (letzter gültiger Wert, Zeitstempel, Minuten seit letztem Wert, Quellenstatus). Zusätzlich Selbstheilungs-/Recovery-Mechanismus für ausgefallene oder hängende Temperatur-Events ergänzt. Temperaturhelper auf ioBroker-konforme Timer umgestellt.",
9
+ "ru": "Расширенная диагностика температуры: добавлены новые диагностические состояния для всех датчиков температуры (последнее действительное значение, временная метка, минуты с момента последнего значения, состояние источника). Добавлен механизм самовосстановления/восстановления при остановке или отсутствии температурных событий. Помощник по температуре обновлен до таймеров, совместимых с ioBroker.",
10
+ "pt": "Diagnóstico de temperatura estendido: Adicionados novos estados de diagnóstico para todos os sensores de temperatura (último valor válido, carimbo de data/hora, minutos desde o último valor, status da fonte). Adicionado mecanismo de autocorreção/recuperação para eventos de temperatura paralisados ​​ou ausentes. Auxiliar de temperatura atualizado para temporizadores compatíveis com ioBroker.",
11
+ "nl": "Temperatuurdiagnostiek uitgebreid: Nieuwe diagnostische statussen toegevoegd voor alle temperatuursensoren (laatste geldige waarde, tijdstempel, minuten sinds laatste waarde, bronstatus). Zelfherstel-/herstelmechanisme toegevoegd voor vastgelopen of ontbrekende temperatuurgebeurtenissen. Temperatuurhelper bijgewerkt naar ioBroker-compatibele timers.",
12
+ "fr": "Diagnostics de température étendus : ajout de nouveaux états de diagnostic pour tous les capteurs de température (dernière valeur valide, horodatage, minutes depuis la dernière valeur, état de la source). Ajout d'un mécanisme d'auto-guérison/récupération pour les événements de température bloqués ou manquants. Assistant de température mis à jour avec des minuteries conformes à ioBroker.",
13
+ "it": "Diagnostica della temperatura estesa: aggiunti nuovi stati diagnostici per tutti i sensori di temperatura (ultimo valore valido, timestamp, minuti dall'ultimo valore, stato della sorgente). Aggiunto meccanismo di autoriparazione/recupero per eventi di temperatura bloccati o mancanti. Assistente per la temperatura aggiornato ai timer compatibili con ioBroker.",
14
+ "es": "Diagnóstico de temperatura extendido: se agregaron nuevos estados de diagnóstico para todos los sensores de temperatura (último valor válido, marca de tiempo, minutos desde el último valor, estado de fuente). Se agregó un mecanismo de autorreparación/recuperación para eventos de temperatura estancados o faltantes. Asistente de temperatura actualizado a temporizadores compatibles con ioBroker.",
15
+ "pl": "Rozszerzona diagnostyka temperatury: Dodano nowe stany diagnostyczne dla wszystkich czujników temperatury (ostatnia ważna wartość, znacznik czasu, minuty od ostatniej wartości, stan źródła). Dodano mechanizm samonaprawy/odzyskiwania w przypadku zablokowania lub braku zdarzeń związanych z temperaturą. Pomocnik temperatury zaktualizowany do timerów zgodnych z ioBroker.",
16
+ "uk": "Розширено діагностику температури: додано нові діагностичні стани для всіх датчиків температури (останнє дійсне значення, позначка часу, хвилини з останнього значення, статус джерела). Додано механізм самовідновлення/відновлення для зупинених або відсутніх температурних подій. Помічник температури оновлено до таймерів, сумісних із ioBroker.",
17
+ "zh-cn": "温度诊断扩展:为所有温度传感器添加了新的诊断状态(最后一个有效值、时间戳、自最后一个值以来的分钟数、源状态)。添加了针对停滞或丢失温度事件的自我修复/恢复机制。温度助手更新为符合 ioBroker 标准的计时器。"
18
+ },
19
+ "1.3.22": {
20
+ "en": "Improved ORP pH reference synchronization. The ORP helper now updates the pH reference independently from ORP value processing and immediately reflects pH state changes.",
21
+ "de": "ORP-pH-Referenz verbessert. Der ORP-Helper aktualisiert die pH-Referenz jetzt unabhängig von der ORP-Wertverarbeitung und übernimmt pH-Änderungen sofort.",
22
+ "ru": "Улучшена синхронизация эталонного значения pH ОВП. Помощник по ОВП теперь обновляет эталонное значение pH независимо от обработки значений ОВП и немедленно отражает изменения состояния pH.",
23
+ "pt": "Sincronização de referência de pH ORP aprimorada. O auxiliar ORP agora atualiza a referência de pH independentemente do processamento do valor ORP e reflete imediatamente as alterações do estado de pH.",
24
+ "nl": "Verbeterde ORP pH-referentiesynchronisatie. De ORP-helper werkt nu de pH-referentie onafhankelijk van de ORP-waardeverwerking bij en weerspiegelt onmiddellijk veranderingen in de pH-toestand.",
25
+ "fr": "Synchronisation améliorée de la référence ORP pH. L'assistant ORP met désormais à jour la référence pH indépendamment du traitement de la valeur ORP et reflète immédiatement les changements d'état du pH.",
26
+ "it": "Sincronizzazione del riferimento pH ORP migliorata. L'assistente ORP ora aggiorna il riferimento del pH indipendentemente dall'elaborazione del valore ORP e riflette immediatamente i cambiamenti dello stato del pH.",
27
+ "es": "Sincronización de referencia de pH ORP mejorada. El asistente de ORP ahora actualiza la referencia de pH independientemente del procesamiento del valor de ORP y refleja inmediatamente los cambios en el estado del pH.",
28
+ "pl": "Ulepszona synchronizacja odniesienia pH ORP. Pomocnik ORP aktualizuje teraz wartość odniesienia pH niezależnie od przetwarzania wartości ORP i natychmiast odzwierciedla zmiany stanu pH.",
29
+ "uk": "Покращена синхронізація еталонного pH ОВП. Помічник ОВП тепер оновлює еталонний рН незалежно від обробки значення ОВП і негайно відображає зміни стану рН.",
30
+ "zh-cn": "改进了 ORP pH 参考同步。 ORP 助手现在独立于 ORP 值处理更新 pH 参考值,并立即反映 pH 状态变化。"
31
+ },
6
32
  "1.3.21": {
7
33
  "en": "Added new follow-pump devices. Up to three external devices can now automatically follow the main pump operation. Added validation for target states including existence, boolean type and writable checks. Added protection against internal follow-pump loops.",
8
34
  "de": "Neue Geräte mit Pumpenlauf hinzugefügt. Bis zu drei externe Geräte können jetzt automatisch dem Lauf der Hauptpumpe folgen. Zusätzlich wurden Prüfungen für Ziel-Datenpunkte (Existenz, Boolean-Typ und Schreibbarkeit) ergänzt. Schutz gegen interne Follow-Pump-Schleifen hinzugefügt.",
@@ -41,32 +67,6 @@
41
67
  "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.",
42
68
  "uk": "Додано самовідновлення під час виконання для пропущених подій запуску насоса. Стабілізований час роботи та обчислення циркуляції для відкладених або фільтрованих оновлень перемикача насоса. Виправлено рідкісну проблему синхронізації, через яку підрахунок циркуляції міг припинитися, хоча поточні значення насоса все ще були доступні. Покращена внутрішня синхронізація часу виконання.",
43
69
  "zh-cn": "为错过的泵启动事件添加了运行时自我修复功能。延迟或过滤泵开关更新的稳定运行时间和循环计算。修复了一个罕见的同步问题,即尽管泵的实时值仍然可用,但循环计数可能会停止。改进了内部运行时同步。"
44
- },
45
- "1.3.18": {
46
- "en": "Fixed incorrect date display for pH, ORP and TDS time states by storing value.time states as numeric timestamps.",
47
- "de": "Falsche Datumsanzeige für pH-, ORP- und TDS-Zeitzustände behoben, indem value.time-Zustände als numerische Zeitstempel gespeichert wurden.",
48
- "ru": "Исправлено неправильное отображение даты для состояний времени pH, ОВП и TDS за счет сохранения состояний value.time в виде числовых меток времени.",
49
- "pt": "Corrigida a exibição incorreta de data para estados de tempo de pH, ORP e TDS, armazenando estados de valor.tempo como carimbos de data/hora numéricos.",
50
- "nl": "Foutieve datumweergave voor pH-, ORP- en TDS-tijdstatussen opgelost door value.time-statussen op te slaan als numerieke tijdstempels.",
51
- "fr": "Correction de l'affichage incorrect de la date pour les états temporels pH, ORP et TDS en stockant les états value.time sous forme d'horodatages numériques.",
52
- "it": "Risolto il problema con la visualizzazione errata della data per gli stati temporali pH, ORP e TDS memorizzando gli stati value.time come timestamp numerici.",
53
- "es": "Se corrigió la visualización de fecha incorrecta para los estados de tiempo de pH, ORP y TDS al almacenar los estados de valor.hora como marcas de tiempo numéricas.",
54
- "pl": "Naprawiono nieprawidłowe wyświetlanie daty dla stanów czasowych pH, ​​ORP i TDS poprzez przechowywanie stanów wartość.czas jako numeryczne znaczniki czasu.",
55
- "uk": "Виправлено неправильне відображення дати для часових станів pH, ORP і TDS шляхом збереження станів value.time як числових позначок часу.",
56
- "zh-cn": "通过将 value.time 状态存储为数字时间戳,修复了 pH、ORP 和 TDS 时间状态的不正确日期显示。"
57
- },
58
- "1.3.17": {
59
- "en": "Fixed release packaging issue from v1.3.16. Improved speech system stability, stabilized runtime persistence, reduced repeated solar notifications, fixed circulation calculation in time mode and prepared new ORP/Redox chemistry analysis area.",
60
- "de": "Release-/Uploadproblem aus v1.3.16 behoben. Sprachsystem verbessert, Runtime-Persistenz stabilisiert, wiederholte Solarbenachrichtigungen reduziert, Umwälzberechnung im Zeitmodus korrigiert und neuer ORP-/Redox-Chemiebereich vorbereitet.",
61
- "ru": "Исправлена ​​проблема с упаковкой выпуска версии 1.3.16. Улучшена стабильность речевой системы, стабилизировано постоянство времени выполнения, уменьшено количество повторных уведомлений о солнечной радиации, исправлен расчет циркуляции во временном режиме и подготовлена ​​новая область химического анализа ОВП/окислительно-восстановительного потенциала.",
62
- "pt": "Problema de empacotamento de lançamento corrigido da v1.3.16. Melhor estabilidade do sistema de fala, persistência de tempo de execução estabilizada, redução de notificações solares repetidas, cálculo de circulação fixo no modo de tempo e nova área de análise química ORP/Redox preparada.",
63
- "nl": "Probleem met releaseverpakking vanaf v1.3.16 opgelost. Verbeterde stabiliteit van het spraaksysteem, gestabiliseerde runtime-persistentie, minder herhaalde zonnemeldingen, vaste circulatieberekening in tijdmodus en voorbereid voor een nieuw ORP/Redox-chemieanalysegebied.",
64
- "fr": "Correction d'un problème d'emballage de version à partir de la v1.3.16. Amélioration de la stabilité du système vocal, persistance d'exécution stabilisée, réduction des notifications solaires répétées, calcul de la circulation fixe en mode temps et préparation d'une nouvelle zone d'analyse chimique ORP/Redox.",
65
- "it": "Risolto il problema relativo al pacchetto di rilascio dalla v1.3.16. Stabilità del sistema vocale migliorata, persistenza del tempo di esecuzione stabilizzata, notifiche solari ripetute ridotte, calcolo della circolazione fissa in modalità temporale e nuova area di analisi chimica ORP/Redox preparata.",
66
- "es": "Se solucionó el problema del paquete de lanzamiento desde v1.3.16. Se mejoró la estabilidad del sistema de voz, se estabilizó la persistencia del tiempo de ejecución, se redujeron las notificaciones solares repetidas, se arregló el cálculo de la circulación en el modo de tiempo y se preparó una nueva área de análisis de química ORP/Redox.",
67
- "pl": "Naprawiono problem z pakowaniem wersji od wersji 1.3.16. 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.",
68
- "uk": "Виправлена ​​проблема упаковки випуску з версії 1.3.16. Покращена стабільність мовної системи, стабілізована стійкість під час виконання, зменшено кількість повторюваних сонячних сповіщень, виправлено обчислення циркуляції в часовому режимі та підготовлено нову область аналізу ORP/Redox.",
69
- "zh-cn": "修复了 v1.3.16 版本的打包问题。提高了语音系统的稳定性,稳定了运行时间的持久性,减少了重复的太阳通知,修复了时间模式下的循环计算,并准备了新的ORP/氧化还原化学分析区域。"
70
70
  }
71
71
  },
72
72
  "titleLang": {
@@ -16,6 +16,7 @@ const chemistryOrpHelper = {
16
16
 
17
17
  void this._subscribeStates();
18
18
  void this._loadSourceState();
19
+ void this._updatePhReference();
19
20
  this._scheduleEvaluation('init', 500);
20
21
 
21
22
  this.adapter.log.debug('[chemistryOrpHelper] Initialized');
@@ -86,6 +87,10 @@ const chemistryOrpHelper = {
86
87
  return;
87
88
  }
88
89
 
90
+ if (id.endsWith('chemistry.ph.enabled') || id.endsWith('chemistry.ph.input.current_value')) {
91
+ await this._updatePhReference();
92
+ }
93
+
89
94
  if (this._isRelevantOwnState(id)) {
90
95
  this._scheduleEvaluation(`state_change:${id}`, 500);
91
96
  }
@@ -20,10 +20,13 @@ const temperatureHelper = {
20
20
  minMax: {}, // { collector: { min, max }, ... }
21
21
  history: {}, // { sensorKey: [{ ts, val }, ...] }
22
22
  resetTimer: null,
23
+ diagnosticTimer: null,
24
+ recoveryLastRun: {}, // { sensorKey: timestamp }
23
25
 
24
26
  init(adapter) {
25
27
  this.adapter = adapter;
26
28
  this.sensors = this._collectActiveSensors(adapter);
29
+ this.recoveryLastRun = {};
27
30
 
28
31
  // Foreign-States abonnieren
29
32
  for (const id of Object.values(this.sensors)) {
@@ -39,6 +42,8 @@ const temperatureHelper = {
39
42
  const val = Number(state.val);
40
43
  this.values[key] = val;
41
44
  await this._setCurrentValue(key, val);
45
+ // NEU: Diagnosewerte für letzten gültigen Sensorwert aktualisieren
46
+ await this._updateSensorDiagnostics(key, val, state, 'ok');
42
47
  await this._updateMinMax(key, val);
43
48
  adapter.log.debug(`[temperatureHelper] Initial value for ${key}: ${val} °C`);
44
49
  } else {
@@ -67,6 +72,9 @@ const temperatureHelper = {
67
72
  // Reset um Mitternacht
68
73
  this._scheduleDailyReset();
69
74
 
75
+ // NEU: Diagnose-Timer für Sensor-Aktualität starten
76
+ this._scheduleSensorDiagnostics();
77
+
70
78
  adapter.log.debug(
71
79
  `[temperatureHelper] Aktiv: ${
72
80
  Object.keys(this.sensors).length
@@ -121,6 +129,9 @@ const temperatureHelper = {
121
129
  // Aktuellen Wert setzen
122
130
  await this._setCurrentValue(key, num);
123
131
 
132
+ // NEU: Diagnosewerte für letzten gültigen Sensorwert aktualisieren
133
+ await this._updateSensorDiagnostics(key, num, state, 'ok');
134
+
124
135
  // Deltas berechnen
125
136
  await this._maybeWriteDelta('temperature.delta.collector_outside', this.values.collector, this.values.outside);
126
137
  await this._maybeWriteDelta('temperature.delta.surface_ground', this.values.surface, this.values.ground);
@@ -144,6 +155,34 @@ const temperatureHelper = {
144
155
  }
145
156
  },
146
157
 
158
+ // NEU: Diagnosewerte für gültige Temperatursensorwerte schreiben
159
+ async _updateSensorDiagnostics(key, value, state, status) {
160
+ const sourceTs = state && Number.isFinite(Number(state.ts)) ? Number(state.ts) : Date.now();
161
+ const isoTime = new Date(sourceTs).toISOString();
162
+ const minutesSince = Math.max(0, Math.round((Date.now() - sourceTs) / 60000));
163
+
164
+ try {
165
+ await this.adapter.setStateAsync(`temperature.${key}.last_valid_value`, {
166
+ val: value,
167
+ ack: true,
168
+ });
169
+ await this.adapter.setStateAsync(`temperature.${key}.last_valid_value_at`, {
170
+ val: isoTime,
171
+ ack: true,
172
+ });
173
+ await this.adapter.setStateAsync(`temperature.${key}.minutes_since_last_value`, {
174
+ val: minutesSince,
175
+ ack: true,
176
+ });
177
+ await this.adapter.setStateAsync(`temperature.${key}.source_status`, {
178
+ val: status,
179
+ ack: true,
180
+ });
181
+ } catch (err) {
182
+ this.adapter.log.warn(`[temperatureHelper] sensor diagnostics ${key} failed: ${err.message}`);
183
+ }
184
+ },
185
+
147
186
  async _maybeWriteDelta(stateId, a, b) {
148
187
  if (a === undefined || b === undefined) {
149
188
  return;
@@ -221,12 +260,90 @@ const temperatureHelper = {
221
260
  nextMidnight.setHours(24, 0, 0, 0);
222
261
  const msUntilMidnight = nextMidnight.getTime() - now.getTime();
223
262
 
224
- this.resetTimer = setTimeout(() => {
225
- this._resetMinMax();
263
+ this.resetTimer = this.adapter.setTimeout(async () => {
264
+ await this._resetMinMax();
226
265
  this._scheduleDailyReset(); // neu für nächsten Tag
227
266
  }, msUntilMidnight);
228
267
  },
229
268
 
269
+ // NEU: Sensor-Aktualität regelmäßig prüfen
270
+ _scheduleSensorDiagnostics() {
271
+ this.diagnosticTimer = this.adapter.setInterval(async () => {
272
+ for (const key of Object.keys(this.sensors)) {
273
+ try {
274
+ const lastValidState = await this.adapter.getStateAsync(`temperature.${key}.last_valid_value_at`);
275
+ const lastValidAt = lastValidState?.val;
276
+
277
+ if (!lastValidAt) {
278
+ await this.adapter.setStateAsync(`temperature.${key}.source_status`, {
279
+ val: 'not_received',
280
+ ack: true,
281
+ });
282
+ continue;
283
+ }
284
+
285
+ const lastTs = Date.parse(lastValidAt);
286
+ if (!Number.isFinite(lastTs)) {
287
+ await this.adapter.setStateAsync(`temperature.${key}.source_status`, {
288
+ val: 'invalid_timestamp',
289
+ ack: true,
290
+ });
291
+ continue;
292
+ }
293
+
294
+ const minutesSince = Math.max(0, Math.round((Date.now() - lastTs) / 60000));
295
+
296
+ await this.adapter.setStateAsync(`temperature.${key}.minutes_since_last_value`, {
297
+ val: minutesSince,
298
+ ack: true,
299
+ });
300
+
301
+ await this.adapter.setStateAsync(`temperature.${key}.source_status`, {
302
+ val: minutesSince <= 15 ? 'ok' : 'warning',
303
+ ack: true,
304
+ });
305
+
306
+ if (minutesSince > 15) {
307
+ await this._tryRecoverSensorValue(key, minutesSince);
308
+ }
309
+ } catch (err) {
310
+ this.adapter.log.warn(`[temperatureHelper] sensor diagnostic check ${key} failed: ${err.message}`);
311
+ }
312
+ }
313
+ }, 60 * 1000);
314
+ },
315
+
316
+ async _tryRecoverSensorValue(key, minutesSince) {
317
+ const sensorId = this.sensors[key];
318
+ if (!sensorId) {
319
+ return;
320
+ }
321
+
322
+ const now = Date.now();
323
+ const lastRun = this.recoveryLastRun[key] || 0;
324
+ if (now - lastRun < 10 * 60 * 1000) {
325
+ return;
326
+ }
327
+
328
+ this.recoveryLastRun[key] = now;
329
+ this.adapter.log.debug(
330
+ `[temperatureHelper] Recovery check started for ${key} (${sensorId}), stale for ${minutesSince} min`,
331
+ );
332
+
333
+ try {
334
+ const state = await this.adapter.getForeignStateAsync(sensorId);
335
+ if (!state || state.val === null || state.val === undefined || !Number.isFinite(Number(state.val))) {
336
+ this.adapter.log.debug(`[temperatureHelper] Recovery check failed for ${key}: no valid numeric value`);
337
+ return;
338
+ }
339
+
340
+ await this.handleStateChange(sensorId, state);
341
+ this.adapter.log.debug(`[temperatureHelper] Recovery check successful for ${key}: ${state.val}`);
342
+ } catch (err) {
343
+ this.adapter.log.debug(`[temperatureHelper] Recovery check failed for ${key}: ${err.message}`);
344
+ }
345
+ },
346
+
230
347
  async _resetMinMax() {
231
348
  this.adapter.log.debug('[temperatureHelper] Resetting daily min/max');
232
349
  for (const key of Object.keys(this.sensors)) {
@@ -264,9 +381,14 @@ const temperatureHelper = {
264
381
 
265
382
  cleanup() {
266
383
  if (this.resetTimer) {
267
- clearTimeout(this.resetTimer);
384
+ this.adapter.clearTimeout(this.resetTimer);
268
385
  this.resetTimer = null;
269
386
  }
387
+
388
+ if (this.diagnosticTimer) {
389
+ this.adapter.clearInterval(this.diagnosticTimer);
390
+ this.diagnosticTimer = null;
391
+ }
270
392
  },
271
393
  };
272
394
 
@@ -214,6 +214,86 @@ async function createTemperatureStates(adapter) {
214
214
  },
215
215
  native: {},
216
216
  });
217
+
218
+ // NEU: Diagnose-States für letzte gültige Sensorwerte
219
+
220
+ await adapter.setObjectNotExistsAsync(`temperature.${sensorKey}.last_valid_value`, {
221
+ type: 'state',
222
+ common: {
223
+ name: {
224
+ en: `Last valid value sensor ${label.en}`,
225
+ de: `Letzter gueltiger Wert Sensor ${label.de}`,
226
+ },
227
+ desc: {
228
+ en: `Last valid temperature value of the ${label.en} sensor`,
229
+ de: `Letzter gueltiger Temperaturwert des Sensors ${label.de}`,
230
+ },
231
+ type: 'number',
232
+ role: 'value.temperature',
233
+ unit: '°C',
234
+ read: true,
235
+ write: false,
236
+ },
237
+ native: {},
238
+ });
239
+
240
+ await adapter.setObjectNotExistsAsync(`temperature.${sensorKey}.last_valid_value_at`, {
241
+ type: 'state',
242
+ common: {
243
+ name: {
244
+ en: `Last valid value time sensor ${label.en}`,
245
+ de: `Zeitpunkt letzter gueltiger Temperaturwert Sensor ${label.de}`,
246
+ },
247
+ desc: {
248
+ en: `Timestamp of the last valid temperature value of the ${label.en} sensor`,
249
+ de: `Zeitpunkt des letzten gueltigen Temperaturwertes des Sensors ${label.de}`,
250
+ },
251
+ type: 'string',
252
+ role: 'value.time',
253
+ read: true,
254
+ write: false,
255
+ },
256
+ native: {},
257
+ });
258
+
259
+ await adapter.setObjectNotExistsAsync(`temperature.${sensorKey}.minutes_since_last_value`, {
260
+ type: 'state',
261
+ common: {
262
+ name: {
263
+ en: `Minutes since last value sensor ${label.en}`,
264
+ de: `Minuten seit letztem Wert Sensor ${label.de}`,
265
+ },
266
+ desc: {
267
+ en: `Minutes since the last valid temperature value of the ${label.en} sensor`,
268
+ de: `Minuten seit dem letzten gueltigen Temperaturwert des Sensors ${label.de}`,
269
+ },
270
+ type: 'number',
271
+ role: 'value',
272
+ unit: 'min',
273
+ read: true,
274
+ write: false,
275
+ },
276
+ native: {},
277
+ });
278
+
279
+ await adapter.setObjectNotExistsAsync(`temperature.${sensorKey}.source_status`, {
280
+ type: 'state',
281
+ common: {
282
+ name: {
283
+ en: `Source status sensor ${label.en}`,
284
+ de: `Quellenstatus Sensor ${label.de}`,
285
+ },
286
+ desc: {
287
+ en: `Diagnostic status of the configured source for the ${label.en} sensor`,
288
+ de: `Diagnosestatus der konfigurierten Quelle fuer den Sensor ${label.de}`,
289
+ },
290
+ type: 'string',
291
+ role: 'text',
292
+ read: true,
293
+ write: false,
294
+ },
295
+ native: {},
296
+ });
217
297
  }
218
298
 
219
299
  // Reihenfolge wie in der Instanz-Config (jsonConfig)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.poolcontrol",
3
- "version": "1.3.21",
3
+ "version": "1.3.23",
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",