iobroker.pv-notifications 1.2.10 → 1.2.12
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 +5 -3
- package/admin/i18n/de/translations.json +3 -1
- package/admin/i18n/en/translations.json +3 -1
- package/admin/i18n/es/translations.json +3 -1
- package/admin/i18n/fr/translations.json +3 -1
- package/admin/i18n/it/translations.json +3 -1
- package/admin/i18n/nl/translations.json +3 -1
- package/admin/i18n/pl/translations.json +3 -1
- package/admin/i18n/pt/translations.json +3 -1
- package/admin/i18n/ru/translations.json +3 -1
- package/admin/i18n/uk/translations.json +3 -1
- package/admin/i18n/zh-cn/translations.json +3 -1
- package/io-package.json +27 -27
- package/main.js +107 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -344,11 +344,13 @@ sadam6752@gmail.com
|
|
|
344
344
|
### **WORK IN PROGRESS**
|
|
345
345
|
-->
|
|
346
346
|
|
|
347
|
-
### 1.2.
|
|
347
|
+
### 1.2.11 (2026-03-02)
|
|
348
348
|
|
|
349
|
-
* (FIX)
|
|
349
|
+
* (FIX) Daily statistics: Self-consumption cannot be negative (Math.max(0, totalProd - feedIn))
|
|
350
|
+
* (FIX) Daily statistics: Added weather today to message (in addition to weather tomorrow)
|
|
351
|
+
* (FIX) Weather error logging improved (warn instead of debug for better visibility)
|
|
350
352
|
|
|
351
|
-
### 1.2.
|
|
353
|
+
### 1.2.10 (2026-03-02)
|
|
352
354
|
|
|
353
355
|
* (FIX) Fixed duplicate news entry in io-package.json (E1036/E2005 fix)
|
|
354
356
|
* (FIX) Added full translations for common.news (pt, nl, fr, it, es, pl, uk, zh-cn)
|
|
@@ -88,5 +88,7 @@
|
|
|
88
88
|
"label_testButton": "Test-Benachrichtigung",
|
|
89
89
|
"buttonText_testButton": "Test senden",
|
|
90
90
|
"tooltip_testButton": "Sendet eine Test-Benachrichtigung an alle konfigurierten Telegram-Benutzer",
|
|
91
|
-
"Test Notification": "Test-Benachrichtigung"
|
|
91
|
+
"Test Notification": "Test-Benachrichtigung",
|
|
92
|
+
"Production today": "Produktion heute",
|
|
93
|
+
"Current production": "Aktuelle Produktion"
|
|
92
94
|
}
|
|
@@ -88,5 +88,7 @@
|
|
|
88
88
|
"label_testButton": "Test Notification",
|
|
89
89
|
"buttonText_testButton": "Send Test",
|
|
90
90
|
"tooltip_testButton": "Sends a test notification to all configured Telegram users",
|
|
91
|
-
"Test Notification": "Test Notification"
|
|
91
|
+
"Test Notification": "Test Notification",
|
|
92
|
+
"Production today": "Production today",
|
|
93
|
+
"Current production": "Current production"
|
|
92
94
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Notificación de Prueba",
|
|
83
83
|
"buttonText_testButton": "Enviar Prueba",
|
|
84
84
|
"tooltip_testButton": "Envía una notificación de prueba a todos los usuarios de Telegram configurados",
|
|
85
|
-
"Test Notification": "Notificación de Prueba"
|
|
85
|
+
"Test Notification": "Notificación de Prueba",
|
|
86
|
+
"Production today": "Producción hoy",
|
|
87
|
+
"Current production": "Producción actual"
|
|
86
88
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Notification de Test",
|
|
83
83
|
"buttonText_testButton": "Envoyer Test",
|
|
84
84
|
"tooltip_testButton": "Envoie une notification de test à tous les utilisateurs Telegram configurés",
|
|
85
|
-
"Test Notification": "Notification de Test"
|
|
85
|
+
"Test Notification": "Notification de Test",
|
|
86
|
+
"Production today": "Production aujourd'hui",
|
|
87
|
+
"Current production": "Production actuelle"
|
|
86
88
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Notifica di Test",
|
|
83
83
|
"buttonText_testButton": "Invia Test",
|
|
84
84
|
"tooltip_testButton": "Invia una notifica di test a tutti gli utenti Telegram configurati",
|
|
85
|
-
"Test Notification": "Notifica di Test"
|
|
85
|
+
"Test Notification": "Notifica di Test",
|
|
86
|
+
"Production today": "Produzione oggi",
|
|
87
|
+
"Current production": "Produzione attuale"
|
|
86
88
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Testmelding",
|
|
83
83
|
"buttonText_testButton": "Verstuur Test",
|
|
84
84
|
"tooltip_testButton": "Verstuurt een testmelding naar alle geconfigureerde Telegram-gebruikers",
|
|
85
|
-
"Test Notification": "Testmelding"
|
|
85
|
+
"Test Notification": "Testmelding",
|
|
86
|
+
"Production today": "Productie vandaag",
|
|
87
|
+
"Current production": "Huidige productie"
|
|
86
88
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Powiadomienie Testowe",
|
|
83
83
|
"buttonText_testButton": "Wyślij Test",
|
|
84
84
|
"tooltip_testButton": "Wysyła powiadomienie testowe do wszystkich skonfigurowanych użytkowników Telegram",
|
|
85
|
-
"Test Notification": "Powiadomienie Testowe"
|
|
85
|
+
"Test Notification": "Powiadomienie Testowe",
|
|
86
|
+
"Production today": "Produkcja dzisiaj",
|
|
87
|
+
"Current production": "Aktualna produkcja"
|
|
86
88
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Notificação de Teste",
|
|
83
83
|
"buttonText_testButton": "Enviar Teste",
|
|
84
84
|
"tooltip_testButton": "Envia uma notificação de teste para todos os usuários do Telegram configurados",
|
|
85
|
-
"Test Notification": "Notificação de Teste"
|
|
85
|
+
"Test Notification": "Notificação de Teste",
|
|
86
|
+
"Production today": "Produção hoje",
|
|
87
|
+
"Current production": "Produção atual"
|
|
86
88
|
}
|
|
@@ -88,5 +88,7 @@
|
|
|
88
88
|
"label_testButton": "Тестовое уведомление",
|
|
89
89
|
"buttonText_testButton": "Отправить тест",
|
|
90
90
|
"tooltip_testButton": "Отправляет тестовое уведомление всем настроенным пользователям Telegram",
|
|
91
|
-
"Test Notification": "Тестовое уведомление"
|
|
91
|
+
"Test Notification": "Тестовое уведомление",
|
|
92
|
+
"Production today": "Выработка сегодня",
|
|
93
|
+
"Current production": "Текущая мощность"
|
|
92
94
|
}
|
|
@@ -82,5 +82,7 @@
|
|
|
82
82
|
"label_testButton": "Тестове Сповіщення",
|
|
83
83
|
"buttonText_testButton": "Надіслати Тест",
|
|
84
84
|
"tooltip_testButton": "Надсилає тестове сповіщення всім налаштованим користувачам Telegram",
|
|
85
|
-
"Test Notification": "Тестове Сповіщення"
|
|
85
|
+
"Test Notification": "Тестове Сповіщення",
|
|
86
|
+
"Production today": "Виробництво сьогодні",
|
|
87
|
+
"Current production": "Поточне виробництво"
|
|
86
88
|
}
|
package/io-package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "pv-notifications",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.12",
|
|
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.12": {
|
|
33
|
+
"en": "Added current production (W) to test message, daily statistics and intermediate messages with improved layout",
|
|
34
|
+
"de": "Aktuelle Produktion (W) zu Test-Nachricht, Tagesstatistik und Zwischenmeldungen mit verbessertem Layout hinzugefügt",
|
|
35
|
+
"ru": "Добавлена текущая выработка (Вт) в тестовое сообщение, дневную статистику и промежуточные уведомления с улучшенным макетом",
|
|
36
|
+
"pt": "Adicionada produção atual (W) à mensagem de teste, estatísticas diárias e mensagens intermediárias com layout aprimorado",
|
|
37
|
+
"nl": "Huidige productie (W) toegevoegd aan testbericht, dagelijkse statistieken en intermediate-berichten met verbeterde lay-out",
|
|
38
|
+
"fr": "Ajout de la production actuelle (W) au message de test, statistiques quotidiennes et messages intermédiaires avec une mise en page améliorée",
|
|
39
|
+
"it": "Aggiunta produzione attuale (W) al messaggio di test, statistiche giornaliere e messaggi intermedi con layout migliorato",
|
|
40
|
+
"es": "Agregada producción actual (W) al mensaje de prueba, estadísticas diarias y mensajes intermedios con diseño mejorado",
|
|
41
|
+
"pl": "Dodano aktualną produkcję (W) do wiadomości testowej, statystyk dziennych i wiadomości pośrednich z ulepszonym układem",
|
|
42
|
+
"uk": "Додано поточне виробництво (Вт) до тестового повідомлення, денної статистики та проміжних повідомлень з покращеним макетом",
|
|
43
|
+
"zh-cn": "已添加当前发电量(W)到测试消息、每日统计和中间消息,并改进了布局"
|
|
44
|
+
},
|
|
45
|
+
"1.2.11": {
|
|
46
|
+
"en": "Fixed daily statistics: self-consumption cannot be negative (Math.max), added weather today to daily stats message",
|
|
47
|
+
"de": "Tagesstatistik fixiert: Eigenverbrauch kann nicht negativ sein (Math.max), Wetter heute zur Tagesstatistik hinzugefügt",
|
|
48
|
+
"ru": "Исправлена дневная статистика: собственное потребление не может быть отрицательным (Math.max), добавлена погода сегодня в дневную статистику",
|
|
49
|
+
"pt": "Estatísticas diárias corrigidas: autoconsumo não pode ser negativo (Math.max), adicionado clima de hoje às estatísticas diárias",
|
|
50
|
+
"nl": "Dagelijkse statistieken hersteld: eigen verbruik kan niet negatief zijn (Math.max), weer vandaag toegevoegd aan dagelijkse statistieken",
|
|
51
|
+
"fr": "Statistiques quotidiennes corrigées : l'autoconsommation ne peut pas être négative (Math.max), météo d'aujourd'hui ajoutée aux statistiques quotidiennes",
|
|
52
|
+
"it": "Statistiche giornaliere corrette: l'autoconsumo non può essere negativo (Math.max), aggiunto meteo di oggi alle statistiche giornaliere",
|
|
53
|
+
"es": "Estadísticas diarias corregidas: el autoconsumo no puede ser negativo (Math.max), agregado clima de hoy a las estadísticas diarias",
|
|
54
|
+
"pl": "Naprawiono statystyki dzienne: zużycie własne nie może być ujemne (Math.max), dodano pogodę dzisiaj do statystyk dziennych",
|
|
55
|
+
"uk": "Виправлено денну статистику: власне споживання не може бути від'ємним (Math.max), додано погоду сьогодні до денної статистики",
|
|
56
|
+
"zh-cn": "已修复每日统计:自用电量不能为负数(Math.max),已添加今日天气到每日统计"
|
|
57
|
+
},
|
|
32
58
|
"1.2.10": {
|
|
33
59
|
"en": "Fixed W4040/W4042: Updated schema definitions in .vscode/settings.json (fileMatch without leading slashes, URLs with /master/)",
|
|
34
60
|
"de": "W4040/W4042 behoben: Schema-Definitionen in .vscode/settings.json aktualisiert (fileMatch ohne führende Slashes, URLs mit /master/)",
|
|
@@ -93,32 +119,6 @@
|
|
|
93
119
|
"pl": "Dodano atrybuty rozmiaru (xs, xl) dla pól monthlyStatsDay, monthlyStatsTime, weatherEnabled, weatherInIntermediate, weatherInDailyStats, highProduction, highConsumption (poprawka E5507)",
|
|
94
120
|
"uk": "Додано атрибути розміру (xs, xl) для полів monthlyStatsDay, monthlyStatsTime, weatherEnabled, weatherInIntermediate, weatherInDailyStats, highProduction, highConsumption (виправлення E5507)",
|
|
95
121
|
"zh-cn": "已为 monthlyStatsDay、monthlyStatsTime、weatherEnabled、weatherInIntermediate、weatherInDailyStats、highProduction、highConsumption 字段添加大小属性(xs, xl)(E5507 修复)"
|
|
96
|
-
},
|
|
97
|
-
"1.2.5": {
|
|
98
|
-
"en": "Added size attributes (xs, xl) for monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime fields (E5507 fix)",
|
|
99
|
-
"de": "Größenattribute (xs, xl) für monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime Felder hinzugefügt (E5507 Fix)",
|
|
100
|
-
"ru": "Добавлены атрибуты размеров (xs, xl) для полей monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (исправление E5507)",
|
|
101
|
-
"pt": "Atributos de tamanho (xs, xl) adicionados para os campos monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (correção E5507)",
|
|
102
|
-
"nl": "Grootte-attributen (xs, xl) toegevoegd voor monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime velden (E5507 fix)",
|
|
103
|
-
"fr": "Attributs de taille (xs, xl) ajoutés pour les champs monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (correction E5507)",
|
|
104
|
-
"it": "Aggiunti attributi di dimensione (xs, xl) per i campi monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (correzione E5507)",
|
|
105
|
-
"es": "Atributos de tamaño (xs, xl) agregados para los campos monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (corrección E5507)",
|
|
106
|
-
"pl": "Dodano atrybuty rozmiaru (xs, xl) dla pól monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (poprawka E5507)",
|
|
107
|
-
"uk": "Додано атрибути розміру (xs, xl) для полів monthlyStatsEnabled, minIntervalIntermediate, statsDayTime, statsWeekDay, statsWeekTime (виправлення E5507)",
|
|
108
|
-
"zh-cn": "已为 monthlyStatsEnabled、minIntervalIntermediate、statsDayTime、statsWeekDay、statsWeekTime 字段添加大小属性(xs, xl)(E5507 修复)"
|
|
109
|
-
},
|
|
110
|
-
"1.2.4": {
|
|
111
|
-
"en": "Added LICENSE file and fixed copyright formatting (W6009/W6011/W7004 fixes)",
|
|
112
|
-
"de": "LICENSE-Datei hinzugefügt und Copyright-Formatierung korrigiert (W6009/W6011/W7004 Fixes)",
|
|
113
|
-
"ru": "Добавлен файл LICENSE и исправлено форматирование авторских прав (исправления W6009/W6011/W7004)",
|
|
114
|
-
"pt": "Arquivo LICENSE adicionado e formatação de copyright corrigida (correções W6009/W6011/W7004)",
|
|
115
|
-
"nl": "LICENSE-bestand toegevoegd en copyright-opmaak hersteld (W6009/W6011/W7007 fixes)",
|
|
116
|
-
"fr": "Fichier LICENSE ajouté et formatage des droits d'auteur corrigé (corrections W6009/W6011/W7004)",
|
|
117
|
-
"it": "Aggiunto file LICENSE e corretta formattazione del copyright (correzioni W6009/W6011/W7004)",
|
|
118
|
-
"es": "Archivo LICENSE agregado y formato de derechos de autor corregido (correcciones W6009/W6011/W7004)",
|
|
119
|
-
"pl": "Dodano plik LICENSE i poprawiono formatowanie praw autorskich (poprawki W6009/W6011/W7004)",
|
|
120
|
-
"uk": "Додано файл LICENSE та виправлено форматування авторських прав (виправлення W6009/W6011/W7004)",
|
|
121
|
-
"zh-cn": "已添加 LICENSE 文件并修复版权格式(W6009/W6011/W7004 修复)"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
"authors": [
|
package/main.js
CHANGED
|
@@ -1072,6 +1072,16 @@ class PvNotifications extends utils.Adapter {
|
|
|
1072
1072
|
const powerState = await this.getStateAsync('statistics.currentPower');
|
|
1073
1073
|
const power = powerState && powerState.val !== null ? powerState.val : 0;
|
|
1074
1074
|
|
|
1075
|
+
// Gesamtproduktion heute lesen
|
|
1076
|
+
const totalProdState = await this.getStateAsync('statistics.currentTotalProduction');
|
|
1077
|
+
const totalProd = totalProdState && totalProdState.val !== null ? this.round(totalProdState.val, 1) : 0;
|
|
1078
|
+
|
|
1079
|
+
// Eigenverbrauch berechnen
|
|
1080
|
+
const feedInState = await this.getStateAsync('statistics.currentFeedIn');
|
|
1081
|
+
const feedIn = feedInState && feedInState.val !== null ? Math.abs(feedInState.val) : 0;
|
|
1082
|
+
const selfConsumption = this.round(Math.max(0, totalProd - feedIn), 1);
|
|
1083
|
+
const selfConsumptionRate = totalProd > 0 ? this.round((selfConsumption / totalProd) * 100, 1) : 0;
|
|
1084
|
+
|
|
1075
1085
|
const trend = direction === 'up' ? '⬆️' : '⬇️';
|
|
1076
1086
|
const currentKWh = this.round(((soc / 100) * this.config.batteryCapacityWh) / 1000, 1);
|
|
1077
1087
|
|
|
@@ -1088,10 +1098,16 @@ class PvNotifications extends utils.Adapter {
|
|
|
1088
1098
|
// Einheitliche Nachricht für alle Stufen (20, 40, 60, 80)
|
|
1089
1099
|
const batteryAt = this.translate('Battery at');
|
|
1090
1100
|
const production = this.translate('Production');
|
|
1101
|
+
const productionToday = this.translate('Production today');
|
|
1102
|
+
const ownConsumption = this.translate('Own consumption');
|
|
1091
1103
|
|
|
1092
1104
|
let message = `🔋 ${batteryAt} ${soc}% (${currentKWh} kWh) ${trend}
|
|
1093
|
-
|
|
1094
|
-
|
|
1105
|
+
${statusText}
|
|
1106
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
1107
|
+
⚡️ ${production}: ${this.round(power)} W
|
|
1108
|
+
✅ ${productionToday}: ${totalProd} kWh
|
|
1109
|
+
🏠 ${ownConsumption}: ${selfConsumption} kWh (${selfConsumptionRate}%)
|
|
1110
|
+
━━━━━━━━━━━━━━━━━━━━━━`;
|
|
1095
1111
|
|
|
1096
1112
|
// Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInIntermediate aktiv)
|
|
1097
1113
|
const weatherConfigured =
|
|
@@ -1205,8 +1221,12 @@ ${statusText}`;
|
|
|
1205
1221
|
const gridPowerState = await this.getStateAsync('statistics.currentGridPower');
|
|
1206
1222
|
const gridPower = gridPowerState && gridPowerState.val !== null ? this.round(gridPowerState.val, 0) : 0;
|
|
1207
1223
|
|
|
1208
|
-
//
|
|
1209
|
-
const
|
|
1224
|
+
// Aktuelle Leistung (W) lesen
|
|
1225
|
+
const powerState = await this.getStateAsync('statistics.currentPower');
|
|
1226
|
+
const power = powerState && powerState.val !== null ? this.round(powerState.val, 0) : 0;
|
|
1227
|
+
|
|
1228
|
+
// Eigenverbrauch berechnen (kann nicht negativ sein)
|
|
1229
|
+
const selfConsumption = this.round(Math.max(0, totalProd - feedIn), 1);
|
|
1210
1230
|
const selfConsumptionRate = totalProd > 0 ? this.round((selfConsumption / totalProd) * 100, 1) : 0;
|
|
1211
1231
|
|
|
1212
1232
|
let message = `📊 *${this.translate('Daily statistics PV system')}*
|
|
@@ -1215,44 +1235,98 @@ ${statusText}`;
|
|
|
1215
1235
|
⚡ ${this.translate('Current energy')}: ${currentKWh} kWh (${batteryCapacityKWh} kWh ${this.translate('Total capacity')})
|
|
1216
1236
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
1217
1237
|
☀️ ${this.translate('Production')}: ${totalProd} kWh
|
|
1238
|
+
⚡️ ${this.translate('Current production')}: ${power} W
|
|
1218
1239
|
🏠 ${this.translate('Own consumption')}: ${selfConsumption} kWh (${selfConsumptionRate}%)
|
|
1219
1240
|
🔌 ${this.translate('Feed-in')}: ${feedIn} kWh
|
|
1220
1241
|
⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh`;
|
|
1221
1242
|
|
|
1222
|
-
// Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInDailyStats aktiv)
|
|
1243
|
+
// Wetter-Prognose für heute und morgen hinzufügen (optional, nur wenn weatherInDailyStats aktiv)
|
|
1244
|
+
const weatherTodayConfigured = this.config.weatherTodayText || this.config.weatherTodayTemp;
|
|
1245
|
+
const weatherTomorrowConfigured = this.config.weatherTomorrowText || this.config.weatherTomorrow;
|
|
1246
|
+
|
|
1223
1247
|
if (
|
|
1224
1248
|
this.config.weatherEnabled !== false &&
|
|
1225
1249
|
this.config.weatherInDailyStats !== false &&
|
|
1226
|
-
(
|
|
1250
|
+
(weatherTodayConfigured || weatherTomorrowConfigured)
|
|
1227
1251
|
) {
|
|
1228
1252
|
try {
|
|
1229
|
-
|
|
1230
|
-
const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrow);
|
|
1231
|
-
const tempTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
|
|
1253
|
+
let weatherAdded = false;
|
|
1232
1254
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1255
|
+
// Wetter heute lesen
|
|
1256
|
+
if (weatherTodayConfigured) {
|
|
1257
|
+
const weatherTodayTextState = this.config.weatherTodayText
|
|
1258
|
+
? await this.getForeignStateAsync(this.config.weatherTodayText)
|
|
1259
|
+
: null;
|
|
1260
|
+
const weatherTodayTempState = this.config.weatherTodayTemp
|
|
1261
|
+
? await this.getForeignStateAsync(this.config.weatherTodayTemp)
|
|
1262
|
+
: null;
|
|
1263
|
+
|
|
1264
|
+
const weatherTodayText =
|
|
1265
|
+
weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
|
|
1266
|
+
const weatherTodayTemp =
|
|
1267
|
+
weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
|
|
1268
|
+
const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
|
|
1269
|
+
|
|
1270
|
+
if (weatherTodayText || weatherTodayTemp) {
|
|
1271
|
+
const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
|
|
1272
|
+
message += `\n━━━━━━━━━━━━━━━━━━━━━━\n🌤️ *${this.translate('Weather today')}:* ${weatherDesc}${todayTempText}`;
|
|
1273
|
+
weatherAdded = true;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
// Wetter morgen lesen
|
|
1278
|
+
if (weatherTomorrowConfigured) {
|
|
1279
|
+
const weatherTomorrowTextState = this.config.weatherTomorrowText
|
|
1280
|
+
? await this.getForeignStateAsync(this.config.weatherTomorrowText)
|
|
1236
1281
|
: null;
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1282
|
+
const weatherTomorrowState = this.config.weatherTomorrow
|
|
1283
|
+
? await this.getForeignStateAsync(this.config.weatherTomorrow)
|
|
1284
|
+
: null;
|
|
1285
|
+
const tempTomorrowState = this.config.weatherTomorrowTemp
|
|
1286
|
+
? await this.getForeignStateAsync(this.config.weatherTomorrowTemp)
|
|
1287
|
+
: null;
|
|
1288
|
+
|
|
1289
|
+
const weatherTomorrowText =
|
|
1290
|
+
weatherTomorrowTextState && weatherTomorrowTextState.val !== null
|
|
1291
|
+
? weatherTomorrowTextState.val
|
|
1292
|
+
: null;
|
|
1293
|
+
const weatherTomorrow =
|
|
1294
|
+
weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
|
|
1295
|
+
const tempTomorrow =
|
|
1296
|
+
tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
|
|
1297
|
+
const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
|
|
1298
|
+
|
|
1299
|
+
const weatherText = weatherTomorrowText || weatherTomorrow;
|
|
1300
|
+
if (weatherText) {
|
|
1301
|
+
const weatherDesc = this.getWeatherDescription(weatherText);
|
|
1302
|
+
message += `\n🌤️ *${this.translate('Weather tomorrow')}:* ${weatherDesc}${tempText}`;
|
|
1303
|
+
weatherAdded = true;
|
|
1304
|
+
|
|
1305
|
+
// Zusätzliche Info bei gutem/schlechtem Wetter
|
|
1306
|
+
if (this.isWeatherGood(weatherText)) {
|
|
1307
|
+
message += `\n☀️ ${this.translate('Good PV production expected')}`;
|
|
1308
|
+
} else if (this.isWeatherBad(weatherText)) {
|
|
1309
|
+
message += `\n⛅ ${this.translate('Less PV production expected')}`;
|
|
1310
|
+
}
|
|
1252
1311
|
}
|
|
1253
1312
|
}
|
|
1313
|
+
|
|
1314
|
+
if (weatherAdded) {
|
|
1315
|
+
message += `\n`;
|
|
1316
|
+
}
|
|
1254
1317
|
} catch (e) {
|
|
1255
|
-
this.log.
|
|
1318
|
+
this.log.warn(`Weather data error in daily stats: ${e.message}`);
|
|
1319
|
+
this.log.warn(`Please check weather configuration in adapter settings`);
|
|
1320
|
+
}
|
|
1321
|
+
} else {
|
|
1322
|
+
if (this.config.weatherEnabled === false) {
|
|
1323
|
+
this.log.debug('Weather disabled (weatherEnabled=false)');
|
|
1324
|
+
}
|
|
1325
|
+
if (this.config.weatherInDailyStats === false) {
|
|
1326
|
+
this.log.debug('Weather in daily stats disabled (weatherInDailyStats=false)');
|
|
1327
|
+
}
|
|
1328
|
+
if (!weatherTodayConfigured && !weatherTomorrowConfigured) {
|
|
1329
|
+
this.log.debug('No weather data points configured for daily stats');
|
|
1256
1330
|
}
|
|
1257
1331
|
}
|
|
1258
1332
|
|
|
@@ -1794,6 +1868,10 @@ ${statusText}`;
|
|
|
1794
1868
|
const gridPowerState = await this.getStateAsync('statistics.currentGridPower');
|
|
1795
1869
|
const gridPower = gridPowerState && gridPowerState.val !== null ? this.round(gridPowerState.val, 0) : 0;
|
|
1796
1870
|
|
|
1871
|
+
// Aktuelle Leistung (W) lesen
|
|
1872
|
+
const powerState = await this.getStateAsync('statistics.currentPower');
|
|
1873
|
+
const power = powerState && powerState.val !== null ? this.round(powerState.val, 0) : 0;
|
|
1874
|
+
|
|
1797
1875
|
// Eigenverbrauch berechnen
|
|
1798
1876
|
const selfConsumption = this.round(totalProd - feedIn, 1);
|
|
1799
1877
|
const selfConsumptionRate = totalProd > 0 ? this.round((selfConsumption / totalProd) * 100, 1) : 0;
|
|
@@ -1804,6 +1882,7 @@ ${statusText}`;
|
|
|
1804
1882
|
⚡ ${this.translate('Current energy')}: ${currentKWh} kWh (${batteryCapacityKWh} kWh ${this.translate('Total capacity')})
|
|
1805
1883
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
1806
1884
|
✅ ${this.translate('Production')}: ${totalProd} kWh
|
|
1885
|
+
⚡️ ${this.translate('Current production')}: ${power} W
|
|
1807
1886
|
🏠 ${this.translate('Own consumption')}: ${selfConsumption} kWh (${selfConsumptionRate}%)
|
|
1808
1887
|
🔌 ${this.translate('Feed-in')}: ${feedIn} kWh
|
|
1809
1888
|
⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh
|