iobroker.pv-notifications 1.2.8 → 1.2.10

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
@@ -344,7 +344,11 @@ sadam6752@gmail.com
344
344
  ### **WORK IN PROGRESS**
345
345
  -->
346
346
 
347
- ### 1.2.8 (2026-03-02)
347
+ ### 1.2.10 (2026-03-02)
348
+
349
+ * (FIX) Fixed W4040/W4042: Updated schema definitions in .vscode/settings.json
350
+
351
+ ### 1.2.9 (2026-03-02)
348
352
 
349
353
  * (FIX) Fixed duplicate news entry in io-package.json (E1036/E2005 fix)
350
354
  * (FIX) Added full translations for common.news (pt, nl, fr, it, es, pl, uk, zh-cn)
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "pv-notifications",
4
- "version": "1.2.8",
4
+ "version": "1.2.10",
5
5
  "titleLang": {
6
6
  "en": "PV Notifications",
7
7
  "de": "PV-Benachrichtigungen",
@@ -29,6 +29,32 @@
29
29
  "zh-cn": "发送 Telegram 通知用于 PV 电池状态"
30
30
  },
31
31
  "news": {
32
+ "1.2.10": {
33
+ "en": "Fixed W4040/W4042: Updated schema definitions in .vscode/settings.json (fileMatch without leading slashes, URLs with /master/)",
34
+ "de": "W4040/W4042 behoben: Schema-Definitionen in .vscode/settings.json aktualisiert (fileMatch ohne führende Slashes, URLs mit /master/)",
35
+ "ru": "Исправлено W4040/W4042: обновлены определения схем в .vscode/settings.json (fileMatch без начальных слешей, URL с /master/)",
36
+ "pt": "Corrigido W4040/W4042: Atualizadas definições de esquema em .vscode/settings.json (fileMatch sem barras iniciais, URLs com /master/)",
37
+ "nl": "W4040/W4042 opgelost: Schema-definities bijgewerkt in .vscode/settings.json (fileMatch zonder voorloopslashes, URL's met /master/)",
38
+ "fr": "Correction W4040/W4042 : Définitions de schéma mises à jour dans .vscode/settings.json (fileMatch sans barres obliques, URLs avec /master/)",
39
+ "it": "Corretto W4040/W4042: Aggiornate definizioni di schema in .vscode/settings.json (fileMatch senza barre iniziali, URL con /master/)",
40
+ "es": "Corregido W4040/W4042: Actualizadas definiciones de esquema en .vscode/settings.json (fileMatch sin barras iniciales, URLs con /master/)",
41
+ "pl": "Naprawiono W4040/W4042: Zaktualizowano definicje schematu w .vscode/settings.json (fileMatch bez wiodących ukośników, adresy URL z /master/)",
42
+ "uk": "Виправлено W4040/W4042: Оновлено визначення схеми в .vscode/settings.json (fileMatch без початкових скісних рисок, URL-адреси з /master/)",
43
+ "zh-cn": "已修复 W4040/W4042:已更新 .vscode/settings.json 中的架构定义(fileMatch 无前导斜杠,URL 使用 /master/)"
44
+ },
45
+ "1.2.9": {
46
+ "en": "Fixed ESLint formatting issues (75 prettier/prettier errors auto-fixed with lint:fix)",
47
+ "de": "ESLint-Formatierungsfehler behoben (75 prettier/prettier Fehler mit lint:fix automatisch korrigiert)",
48
+ "ru": "Исправлены ошибки форматирования ESLint (75 ошибок prettier/prettier автоматически исправлены через lint:fix)",
49
+ "pt": "Corrigidos problemas de formatação ESLint (75 erros prettier/prettier corrigidos automaticamente com lint:fix)",
50
+ "nl": "ESLint-opmaakproblemen opgelost (75 prettier/prettier-fouten automatisch hersteld met lint:fix)",
51
+ "fr": "Correction des problèmes de formatage ESLint (75 erreurs prettier/prettier corrigées automatiquement avec lint:fix)",
52
+ "it": "Corretti problemi di formattazione ESLint (75 errori prettier/prettier corretti automaticamente con lint:fix)",
53
+ "es": "Corregidos problemas de formato ESLint (75 errores prettier/prettier corregidos automáticamente con lint:fix)",
54
+ "pl": "Naprawiono problemy z formatowaniem ESLint (75 błędów prettier/prettier automatycznie naprawionych za pomocą lint:fix)",
55
+ "uk": "Виправлено проблеми з форматуванням ESLint (75 помилок prettier/prettier автоматично виправлено за допомогою lint:fix)",
56
+ "zh-cn": "已修复 ESLint 格式化问题(75 个 prettier/prettier 错误已通过 lint:fix 自动修复)"
57
+ },
32
58
  "1.2.8": {
33
59
  "en": "Fixed duplicate news entry in io-package.json (E1036/E2005 fix)",
34
60
  "de": "Doppelten news-Eintrag in io-package.json behoben (E1036/E2005 Fix)",
@@ -93,32 +119,6 @@
93
119
  "pl": "Dodano plik LICENSE i poprawiono formatowanie praw autorskich (poprawki W6009/W6011/W7004)",
94
120
  "uk": "Додано файл LICENSE та виправлено форматування авторських прав (виправлення W6009/W6011/W7004)",
95
121
  "zh-cn": "已添加 LICENSE 文件并修复版权格式(W6009/W6011/W7004 修复)"
96
- },
97
- "1.2.3": {
98
- "en": "Added size attributes (xs, xl) for minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd fields in admin UI (E5507 fix)",
99
- "de": "Größenattribute (xs, xl) für minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd Felder im Admin-UI hinzugefügt (E5507 Fix)",
100
- "ru": "Добавлены атрибуты размеров (xs, xl) для полей minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd в админ-интерфейсе (исправление E5507)",
101
- "pt": "Atributos de tamanho (xs, xl) adicionados para os campos minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd na interface de administração (correção E5507)",
102
- "nl": "Grootte-attributen (xs, xl) toegevoegd voor minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd velden in admin UI (E5507 fix)",
103
- "fr": "Attributs de taille (xs, xl) ajoutés pour les champs minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd dans l'interface d'administration (correction E5507)",
104
- "it": "Aggiunti attributi di dimensione (xs, xl) per i campi minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd nell'interfaccia di amministrazione (correzione E5507)",
105
- "es": "Atributos de tamaño (xs, xl) agregados para los campos minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd en la interfaz de administración (corrección E5507)",
106
- "pl": "Dodano atrybuty rozmiaru (xs, xl) dla pól minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd w interfejsie administracyjnym (poprawka E5507)",
107
- "uk": "Додано атрибути розміру (xs, xl) для полів minIntervalFull, minIntervalEmpty, intermediateSteps, quietModeStart, quietModeEnd в адмін-інтерфейсі (виправлення E5507)",
108
- "zh-cn": "已为管理界面中的 minIntervalFull、minIntervalEmpty、intermediateSteps、quietModeStart、quietModeEnd 字段添加大小属性(xs, xl)(E5507 修复)"
109
- },
110
- "1.2.2": {
111
- "en": "Fixed weekly statistics: Now uses weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower fields instead of daily values",
112
- "de": "Wochenstatistik fixiert: Verwendet jetzt weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower Felder statt Tageswerten",
113
- "ru": "Исправлена недельная статистика: теперь используются поля weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower вместо дневных значений",
114
- "pt": "Estatísticas semanais corrigidas: Agora usa os campos weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower em vez de valores diários",
115
- "nl": "Wekelijkse statistieken hersteld: Gebruikt nu weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower velden in plaats van dagwaarden",
116
- "fr": "Statistiques hebdomadaires corrigées : Utilise maintenant les champs weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower au lieu des valeurs quotidiennes",
117
- "it": "Statistiche settimanali corrette: Ora utilizza i campi weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower invece dei valori giornalieri",
118
- "es": "Estadísticas semanales corregidas: Ahora usa los campos weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower en lugar de valores diarios",
119
- "pl": "Naprawiono statystyki tygodniowe: Teraz używa pól weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower zamiast wartości dziennych",
120
- "uk": "Виправлено тижневу статистику: Тепер використовуються поля weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower замість денних значень",
121
- "zh-cn": "已修复周统计:现在使用 weeklyProduction/weeklyConsumption/weeklyFeedIn/weeklyGridPower 字段而不是日值"
122
122
  }
123
123
  },
124
124
  "authors": [
package/main.js CHANGED
@@ -91,12 +91,16 @@ class PvNotifications extends utils.Adapter {
91
91
  this.log.info('PV Notifications Adapter started');
92
92
 
93
93
  // Migration: Set weather checkboxes to true if not set (for updates from < v1.1.3)
94
- if (this.config.weatherEnabled === true &&
95
- (this.config.weatherInIntermediate === undefined || this.config.weatherInIntermediate === null)) {
94
+ if (
95
+ this.config.weatherEnabled === true &&
96
+ (this.config.weatherInIntermediate === undefined || this.config.weatherInIntermediate === null)
97
+ ) {
96
98
  this.log.info('Migration: Setting weatherInIntermediate to true (default)');
97
99
  }
98
- if (this.config.weatherEnabled === true &&
99
- (this.config.weatherInDailyStats === undefined || this.config.weatherInDailyStats === null)) {
100
+ if (
101
+ this.config.weatherEnabled === true &&
102
+ (this.config.weatherInDailyStats === undefined || this.config.weatherInDailyStats === null)
103
+ ) {
100
104
  this.log.info('Migration: Setting weatherInDailyStats to true (default)');
101
105
  }
102
106
 
@@ -433,12 +437,17 @@ class PvNotifications extends utils.Adapter {
433
437
  const lastWeekFullCycles = await this.getStateAsync('statistics.lastWeekFullCycles');
434
438
  const lastWeekEmptyCycles = await this.getStateAsync('statistics.lastWeekEmptyCycles');
435
439
 
436
- this.stats.lastWeekProduction = lastWeekProduction && lastWeekProduction.val !== null ? lastWeekProduction.val : 0;
437
- this.stats.lastWeekConsumption = lastWeekConsumption && lastWeekConsumption.val !== null ? lastWeekConsumption.val : 0;
440
+ this.stats.lastWeekProduction =
441
+ lastWeekProduction && lastWeekProduction.val !== null ? lastWeekProduction.val : 0;
442
+ this.stats.lastWeekConsumption =
443
+ lastWeekConsumption && lastWeekConsumption.val !== null ? lastWeekConsumption.val : 0;
438
444
  this.stats.lastWeekFeedIn = lastWeekFeedIn && lastWeekFeedIn.val !== null ? lastWeekFeedIn.val : 0;
439
- this.stats.lastWeekGridPower = lastWeekGridPower && lastWeekGridPower.val !== null ? lastWeekGridPower.val : 0;
440
- this.stats.lastWeekFullCycles = lastWeekFullCycles && lastWeekFullCycles.val !== null ? lastWeekFullCycles.val : 0;
441
- this.stats.lastWeekEmptyCycles = lastWeekEmptyCycles && lastWeekEmptyCycles.val !== null ? lastWeekEmptyCycles.val : 0;
445
+ this.stats.lastWeekGridPower =
446
+ lastWeekGridPower && lastWeekGridPower.val !== null ? lastWeekGridPower.val : 0;
447
+ this.stats.lastWeekFullCycles =
448
+ lastWeekFullCycles && lastWeekFullCycles.val !== null ? lastWeekFullCycles.val : 0;
449
+ this.stats.lastWeekEmptyCycles =
450
+ lastWeekEmptyCycles && lastWeekEmptyCycles.val !== null ? lastWeekEmptyCycles.val : 0;
442
451
 
443
452
  // Load saved last month data from states
444
453
  const lastMonthProduction = await this.getStateAsync('statistics.lastMonthProduction');
@@ -448,12 +457,17 @@ class PvNotifications extends utils.Adapter {
448
457
  const lastMonthFullCycles = await this.getStateAsync('statistics.lastMonthFullCycles');
449
458
  const lastMonthEmptyCycles = await this.getStateAsync('statistics.lastMonthEmptyCycles');
450
459
 
451
- this.stats.lastMonthProduction = lastMonthProduction && lastMonthProduction.val !== null ? lastMonthProduction.val : 0;
452
- this.stats.lastMonthConsumption = lastMonthConsumption && lastMonthConsumption.val !== null ? lastMonthConsumption.val : 0;
460
+ this.stats.lastMonthProduction =
461
+ lastMonthProduction && lastMonthProduction.val !== null ? lastMonthProduction.val : 0;
462
+ this.stats.lastMonthConsumption =
463
+ lastMonthConsumption && lastMonthConsumption.val !== null ? lastMonthConsumption.val : 0;
453
464
  this.stats.lastMonthFeedIn = lastMonthFeedIn && lastMonthFeedIn.val !== null ? lastMonthFeedIn.val : 0;
454
- this.stats.lastMonthGridPower = lastMonthGridPower && lastMonthGridPower.val !== null ? lastMonthGridPower.val : 0;
455
- this.stats.lastMonthFullCycles = lastMonthFullCycles && lastMonthFullCycles.val !== null ? lastMonthFullCycles.val : 0;
456
- this.stats.lastMonthEmptyCycles = lastMonthEmptyCycles && lastMonthEmptyCycles.val !== null ? lastMonthEmptyCycles.val : 0;
465
+ this.stats.lastMonthGridPower =
466
+ lastMonthGridPower && lastMonthGridPower.val !== null ? lastMonthGridPower.val : 0;
467
+ this.stats.lastMonthFullCycles =
468
+ lastMonthFullCycles && lastMonthFullCycles.val !== null ? lastMonthFullCycles.val : 0;
469
+ this.stats.lastMonthEmptyCycles =
470
+ lastMonthEmptyCycles && lastMonthEmptyCycles.val !== null ? lastMonthEmptyCycles.val : 0;
457
471
 
458
472
  this.log.info('Statistics loaded from states');
459
473
  } catch (e) {
@@ -882,35 +896,56 @@ class PvNotifications extends utils.Adapter {
882
896
  🔌 ${this.translate('Feed-in today')}: ${this.round(Math.abs(feedIn), 0)} kWh`;
883
897
 
884
898
  // Wetter-Prognose hinzufügen (heute und morgen)
885
- const weatherConfigured = this.config.weatherTodayText || this.config.weatherTodayTemp || this.config.weatherTomorrowText || this.config.weatherTomorrow;
899
+ const weatherConfigured =
900
+ this.config.weatherTodayText ||
901
+ this.config.weatherTodayTemp ||
902
+ this.config.weatherTomorrowText ||
903
+ this.config.weatherTomorrow;
886
904
  if (this.config.weatherEnabled !== false && weatherConfigured) {
887
905
  try {
888
906
  // Wetter heute
889
907
  if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
890
- const weatherTodayTextState = this.config.weatherTodayText ? await this.getForeignStateAsync(this.config.weatherTodayText) : null;
891
- const weatherTodayTempState = this.config.weatherTodayTemp ? await this.getForeignStateAsync(this.config.weatherTodayTemp) : null;
892
-
893
- const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
894
- const weatherTodayTemp = weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
908
+ const weatherTodayTextState = this.config.weatherTodayText
909
+ ? await this.getForeignStateAsync(this.config.weatherTodayText)
910
+ : null;
911
+ const weatherTodayTempState = this.config.weatherTodayTemp
912
+ ? await this.getForeignStateAsync(this.config.weatherTodayTemp)
913
+ : null;
914
+
915
+ const weatherTodayText =
916
+ weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
917
+ const weatherTodayTemp =
918
+ weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
895
919
  const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
896
-
920
+
897
921
  if (weatherTodayText || weatherTodayTemp) {
898
922
  const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
899
923
  message += `\n🌤️ Heute: ${weatherDesc}${todayTempText}`;
900
924
  }
901
925
  }
902
-
926
+
903
927
  // Wetter morgen
904
928
  if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
905
- const weatherTomorrowTextState = this.config.weatherTomorrowText ? await this.getForeignStateAsync(this.config.weatherTomorrowText) : null;
906
- const weatherTomorrowState = this.config.weatherTomorrow ? await this.getForeignStateAsync(this.config.weatherTomorrow) : null;
907
- const tempTomorrowState = this.config.weatherTomorrowTemp ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp) : null;
908
-
909
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
910
- const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
911
- const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
929
+ const weatherTomorrowTextState = this.config.weatherTomorrowText
930
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowText)
931
+ : null;
932
+ const weatherTomorrowState = this.config.weatherTomorrow
933
+ ? await this.getForeignStateAsync(this.config.weatherTomorrow)
934
+ : null;
935
+ const tempTomorrowState = this.config.weatherTomorrowTemp
936
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp)
937
+ : null;
938
+
939
+ const weatherTomorrowText =
940
+ weatherTomorrowTextState && weatherTomorrowTextState.val !== null
941
+ ? weatherTomorrowTextState.val
942
+ : null;
943
+ const weatherTomorrow =
944
+ weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
945
+ const tempTomorrow =
946
+ tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
912
947
  const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
913
-
948
+
914
949
  const weatherText = weatherTomorrowText || weatherTomorrow;
915
950
  if (weatherText) {
916
951
  const weatherDesc = this.getWeatherDescription(weatherText);
@@ -953,35 +988,56 @@ class PvNotifications extends utils.Adapter {
953
988
  🏠 ${this.translate('Consumption today')}: ${this.round(consumption)} W`;
954
989
 
955
990
  // Wetter-Prognose hinzufügen (heute und morgen)
956
- const weatherConfigured = this.config.weatherTodayText || this.config.weatherTodayTemp || this.config.weatherTomorrowText || this.config.weatherTomorrow;
991
+ const weatherConfigured =
992
+ this.config.weatherTodayText ||
993
+ this.config.weatherTodayTemp ||
994
+ this.config.weatherTomorrowText ||
995
+ this.config.weatherTomorrow;
957
996
  if (this.config.weatherEnabled !== false && weatherConfigured) {
958
997
  try {
959
998
  // Wetter heute
960
999
  if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
961
- const weatherTodayTextState = this.config.weatherTodayText ? await this.getForeignStateAsync(this.config.weatherTodayText) : null;
962
- const weatherTodayTempState = this.config.weatherTodayTemp ? await this.getForeignStateAsync(this.config.weatherTodayTemp) : null;
963
-
964
- const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
965
- const weatherTodayTemp = weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
1000
+ const weatherTodayTextState = this.config.weatherTodayText
1001
+ ? await this.getForeignStateAsync(this.config.weatherTodayText)
1002
+ : null;
1003
+ const weatherTodayTempState = this.config.weatherTodayTemp
1004
+ ? await this.getForeignStateAsync(this.config.weatherTodayTemp)
1005
+ : null;
1006
+
1007
+ const weatherTodayText =
1008
+ weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1009
+ const weatherTodayTemp =
1010
+ weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
966
1011
  const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
967
-
1012
+
968
1013
  if (weatherTodayText || weatherTodayTemp) {
969
1014
  const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
970
1015
  message += `\n🌤️ Heute: ${weatherDesc}${todayTempText}`;
971
1016
  }
972
1017
  }
973
-
1018
+
974
1019
  // Wetter morgen
975
1020
  if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
976
- const weatherTomorrowTextState = this.config.weatherTomorrowText ? await this.getForeignStateAsync(this.config.weatherTomorrowText) : null;
977
- const weatherTomorrowState = this.config.weatherTomorrow ? await this.getForeignStateAsync(this.config.weatherTomorrow) : null;
978
- const tempTomorrowState = this.config.weatherTomorrowTemp ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp) : null;
979
-
980
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
981
- const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
982
- const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1021
+ const weatherTomorrowTextState = this.config.weatherTomorrowText
1022
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowText)
1023
+ : null;
1024
+ const weatherTomorrowState = this.config.weatherTomorrow
1025
+ ? await this.getForeignStateAsync(this.config.weatherTomorrow)
1026
+ : null;
1027
+ const tempTomorrowState = this.config.weatherTomorrowTemp
1028
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp)
1029
+ : null;
1030
+
1031
+ const weatherTomorrowText =
1032
+ weatherTomorrowTextState && weatherTomorrowTextState.val !== null
1033
+ ? weatherTomorrowTextState.val
1034
+ : null;
1035
+ const weatherTomorrow =
1036
+ weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1037
+ const tempTomorrow =
1038
+ tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
983
1039
  const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
984
-
1040
+
985
1041
  const weatherText = weatherTomorrowText || weatherTomorrow;
986
1042
  if (weatherText) {
987
1043
  const weatherDesc = this.getWeatherDescription(weatherText);
@@ -1038,39 +1094,64 @@ class PvNotifications extends utils.Adapter {
1038
1094
  ${statusText}`;
1039
1095
 
1040
1096
  // Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInIntermediate aktiv)
1041
- const weatherConfigured = this.config.weatherTomorrowText || this.config.weatherTomorrow || this.config.weatherTodayText || this.config.weatherTodayTemp;
1042
- this.log.debug(`Weather config: enabled=${this.config.weatherEnabled}, inIntermediate=${this.config.weatherInIntermediate}, configured=${weatherConfigured}`);
1043
- this.log.debug(`Weather data points: todayText="${this.config.weatherTodayText}", todayTemp="${this.config.weatherTodayTemp}", tomorrowText="${this.config.weatherTomorrowText}", tomorrow="${this.config.weatherTomorrow}", tomorrowTemp="${this.config.weatherTomorrowTemp}"`);
1044
-
1097
+ const weatherConfigured =
1098
+ this.config.weatherTomorrowText ||
1099
+ this.config.weatherTomorrow ||
1100
+ this.config.weatherTodayText ||
1101
+ this.config.weatherTodayTemp;
1102
+ this.log.debug(
1103
+ `Weather config: enabled=${this.config.weatherEnabled}, inIntermediate=${this.config.weatherInIntermediate}, configured=${weatherConfigured}`,
1104
+ );
1105
+ this.log.debug(
1106
+ `Weather data points: todayText="${this.config.weatherTodayText}", todayTemp="${this.config.weatherTodayTemp}", tomorrowText="${this.config.weatherTomorrowText}", tomorrow="${this.config.weatherTomorrow}", tomorrowTemp="${this.config.weatherTomorrowTemp}"`,
1107
+ );
1108
+
1045
1109
  if (this.config.weatherEnabled !== false && this.config.weatherInIntermediate !== false && weatherConfigured) {
1046
1110
  try {
1047
1111
  this.log.debug('Attempting to read weather data...');
1048
-
1112
+
1049
1113
  // Wetter heute lesen
1050
1114
  if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
1051
- const weatherTodayTextState = this.config.weatherTodayText ? await this.getForeignStateAsync(this.config.weatherTodayText) : null;
1052
- const weatherTodayTempState = this.config.weatherTodayTemp ? await this.getForeignStateAsync(this.config.weatherTodayTemp) : null;
1053
-
1054
- const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1055
- const weatherTodayTemp = weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
1115
+ const weatherTodayTextState = this.config.weatherTodayText
1116
+ ? await this.getForeignStateAsync(this.config.weatherTodayText)
1117
+ : null;
1118
+ const weatherTodayTempState = this.config.weatherTodayTemp
1119
+ ? await this.getForeignStateAsync(this.config.weatherTodayTemp)
1120
+ : null;
1121
+
1122
+ const weatherTodayText =
1123
+ weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1124
+ const weatherTodayTemp =
1125
+ weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
1056
1126
  const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
1057
-
1127
+
1058
1128
  if (weatherTodayText || weatherTodayTemp) {
1059
1129
  const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
1060
1130
  message += `\n\n🌤️ ${this.translate('Weather today')}: ${weatherDesc}${todayTempText}`;
1061
1131
  this.log.info(`Weather today added to intermediate message: ${weatherDesc}${todayTempText}`);
1062
1132
  }
1063
1133
  }
1064
-
1134
+
1065
1135
  // Wetter morgen lesen
1066
1136
  if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
1067
- const weatherTomorrowTextState = this.config.weatherTomorrowText ? await this.getForeignStateAsync(this.config.weatherTomorrowText) : null;
1068
- const weatherTomorrowState = this.config.weatherTomorrow ? await this.getForeignStateAsync(this.config.weatherTomorrow) : null;
1069
- const tempTomorrowState = this.config.weatherTomorrowTemp ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp) : null;
1070
-
1071
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1072
- const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1073
- const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1137
+ const weatherTomorrowTextState = this.config.weatherTomorrowText
1138
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowText)
1139
+ : null;
1140
+ const weatherTomorrowState = this.config.weatherTomorrow
1141
+ ? await this.getForeignStateAsync(this.config.weatherTomorrow)
1142
+ : null;
1143
+ const tempTomorrowState = this.config.weatherTomorrowTemp
1144
+ ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp)
1145
+ : null;
1146
+
1147
+ const weatherTomorrowText =
1148
+ weatherTomorrowTextState && weatherTomorrowTextState.val !== null
1149
+ ? weatherTomorrowTextState.val
1150
+ : null;
1151
+ const weatherTomorrow =
1152
+ weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1153
+ const tempTomorrow =
1154
+ tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1074
1155
  const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
1075
1156
 
1076
1157
  const weatherText = weatherTomorrowText || weatherTomorrow;
@@ -1082,7 +1163,9 @@ ${statusText}`;
1082
1163
  }
1083
1164
  } catch (e) {
1084
1165
  this.log.error(`Weather data error: ${e.message}`);
1085
- this.log.error(`Config: weatherTodayText="${this.config.weatherTodayText}", weatherTomorrowText="${this.config.weatherTomorrowText}"`);
1166
+ this.log.error(
1167
+ `Config: weatherTodayText="${this.config.weatherTodayText}", weatherTomorrowText="${this.config.weatherTomorrowText}"`,
1168
+ );
1086
1169
  }
1087
1170
  } else {
1088
1171
  if (this.config.weatherEnabled === false) {
@@ -1092,7 +1175,9 @@ ${statusText}`;
1092
1175
  this.log.debug('Weather disabled for intermediate (weatherInIntermediate=false)');
1093
1176
  }
1094
1177
  if (!weatherConfigured) {
1095
- this.log.debug('Weather not configured (no weatherTodayText, weatherTodayTemp, weatherTomorrowText or weatherTomorrow)');
1178
+ this.log.debug(
1179
+ 'Weather not configured (no weatherTodayText, weatherTodayTemp, weatherTomorrowText or weatherTomorrow)',
1180
+ );
1096
1181
  }
1097
1182
  }
1098
1183
 
@@ -1135,15 +1220,22 @@ ${statusText}`;
1135
1220
  ⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh`;
1136
1221
 
1137
1222
  // Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInDailyStats aktiv)
1138
- if (this.config.weatherEnabled !== false && this.config.weatherInDailyStats !== false &&
1139
- (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
1223
+ if (
1224
+ this.config.weatherEnabled !== false &&
1225
+ this.config.weatherInDailyStats !== false &&
1226
+ (this.config.weatherTomorrowText || this.config.weatherTomorrow)
1227
+ ) {
1140
1228
  try {
1141
1229
  const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
1142
1230
  const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrow);
1143
1231
  const tempTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
1144
1232
 
1145
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1146
- const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1233
+ const weatherTomorrowText =
1234
+ weatherTomorrowTextState && weatherTomorrowTextState.val !== null
1235
+ ? weatherTomorrowTextState.val
1236
+ : null;
1237
+ const weatherTomorrow =
1238
+ weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1147
1239
  const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1148
1240
  const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
1149
1241
 
@@ -1420,7 +1512,8 @@ ${statusText}`;
1420
1512
  const weeklyGridPower = await this.getForeignStateAsync(this.config.weeklyGridPower);
1421
1513
 
1422
1514
  this.stats.lastWeekProduction = weeklyProd && weeklyProd.val !== null ? weeklyProd.val : 0;
1423
- this.stats.lastWeekConsumption = weeklyConsumption && weeklyConsumption.val !== null ? weeklyConsumption.val : 0;
1515
+ this.stats.lastWeekConsumption =
1516
+ weeklyConsumption && weeklyConsumption.val !== null ? weeklyConsumption.val : 0;
1424
1517
  this.stats.lastWeekFeedIn = weeklyFeedIn && weeklyFeedIn.val !== null ? weeklyFeedIn.val : 0;
1425
1518
  this.stats.lastWeekGridPower = weeklyGridPower && weeklyGridPower.val !== null ? weeklyGridPower.val : 0;
1426
1519
  this.stats.lastWeekFullCycles = this.stats.weekFullCycles;
@@ -1431,7 +1524,9 @@ ${statusText}`;
1431
1524
  this.stats.weekEmptyCycles = 0;
1432
1525
 
1433
1526
  this.saveStatistics();
1434
- this.log.info(`Weekly stats saved: Production=${this.stats.lastWeekProduction} kWh, FeedIn=${this.stats.lastWeekFeedIn} kWh`);
1527
+ this.log.info(
1528
+ `Weekly stats saved: Production=${this.stats.lastWeekProduction} kWh, FeedIn=${this.stats.lastWeekFeedIn} kWh`,
1529
+ );
1435
1530
  // KEIN Senden hier - Senden erfolgt nur in startScheduledTasks() zur konfigurierten Zeit
1436
1531
  }
1437
1532
  }
@@ -1455,7 +1550,9 @@ ${statusText}`;
1455
1550
 
1456
1551
  // Automatische Speicherung: Letzter Tag des Monats um 23:55 (vor Mitternacht)
1457
1552
  if (today === lastDayOfMonth && hours === 23 && minutes === 55) {
1458
- this.log.info(`Auto-saving monthly statistics (last day of month ${today}. ${now.getMonth()+1}.${now.getFullYear()} 23:55, before sourceanalytix reset)`);
1553
+ this.log.info(
1554
+ `Auto-saving monthly statistics (last day of month ${today}. ${now.getMonth() + 1}.${now.getFullYear()} 23:55, before sourceanalytix reset)`,
1555
+ );
1459
1556
 
1460
1557
  // Aktuelle Daten aus externen States lesen (direkter Zugriff)
1461
1558
  const totalProd = await this.getForeignStateAsync(this.config.monthlyProduction);
@@ -1472,7 +1569,9 @@ ${statusText}`;
1472
1569
 
1473
1570
  this.stats.lastMonthReset = today;
1474
1571
  this.saveStatistics();
1475
- this.log.info(`Monthly stats saved: Production=${this.stats.lastMonthProduction} kWh, FeedIn=${this.stats.lastMonthFeedIn} kWh`);
1572
+ this.log.info(
1573
+ `Monthly stats saved: Production=${this.stats.lastMonthProduction} kWh, FeedIn=${this.stats.lastMonthFeedIn} kWh`,
1574
+ );
1476
1575
  }
1477
1576
  }
1478
1577
 
@@ -1719,8 +1818,10 @@ ${statusText}`;
1719
1818
  const weatherTodayTextState = await this.getForeignStateAsync(this.config.weatherTodayText);
1720
1819
  const weatherTodayState = await this.getForeignStateAsync(this.config.weatherTodayTemp);
1721
1820
 
1722
- const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1723
- const weatherTodayTemp = weatherTodayState && weatherTodayState.val !== null ? weatherTodayState.val : null;
1821
+ const weatherTodayText =
1822
+ weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1823
+ const weatherTodayTemp =
1824
+ weatherTodayState && weatherTodayState.val !== null ? weatherTodayState.val : null;
1724
1825
  const tempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
1725
1826
 
1726
1827
  if (weatherTodayText || weatherTodayTemp) {
@@ -1734,12 +1835,18 @@ ${statusText}`;
1734
1835
  const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
1735
1836
  const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
1736
1837
 
1737
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1738
- const weatherTomorrowTemp = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1838
+ const weatherTomorrowText =
1839
+ weatherTomorrowTextState && weatherTomorrowTextState.val !== null
1840
+ ? weatherTomorrowTextState.val
1841
+ : null;
1842
+ const weatherTomorrowTemp =
1843
+ weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1739
1844
  const tempText = weatherTomorrowTemp ? ` ${this.round(weatherTomorrowTemp, 1)}°C` : '';
1740
1845
 
1741
1846
  if (weatherTomorrowText || weatherTomorrowTemp) {
1742
- const weatherDesc = weatherTomorrowText ? this.getWeatherDescription(weatherTomorrowText) : '🌡️';
1847
+ const weatherDesc = weatherTomorrowText
1848
+ ? this.getWeatherDescription(weatherTomorrowText)
1849
+ : '🌡️';
1743
1850
  message += `\n🌤️ *${this.translate('Weather tomorrow')}:* ${weatherDesc}${tempText}`;
1744
1851
  }
1745
1852
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.pv-notifications",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "description": "PV-Anlage Batterie-Status Telegram Benachrichtigungen",
5
5
  "author": {
6
6
  "name": "Alex1808 via LLM: Qwen",