iobroker.pv-notifications 1.1.8 → 1.2.0

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
@@ -339,14 +339,14 @@ sadam6752@gmail.com
339
339
  ### **WORK IN PROGRESS**
340
340
  -->
341
341
 
342
- ### 1.1.8 (2026-03-01)
342
+ ### 1.2.0 (2026-03-01)
343
343
 
344
- * (ADD) Weather today added to intermediate messages (when weatherTodayText or weatherTodayTemp is configured)
345
- * (ADD) Intermediate messages now show both today and tomorrow weather
344
+ * (ADD) common.news section added to io-package.json for repository checker (E136 fix)
345
+ * (ADD) News for versions 1.1.7, 1.1.8, 1.1.9 in multiple languages
346
346
 
347
- ### 1.1.7 (2026-03-01)
347
+ ### 1.1.9 (2026-03-01)
348
348
 
349
- * (FIX) Weather data reading: Added null checks before calling getForeignStateAsync() to prevent "id needs to be string" error
349
+ * (ADD) Weather today added to battery full (100%) and empty (0%) messages
350
350
 
351
351
  ### 1.1.1 (2026-03-01)
352
352
 
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "pv-notifications",
4
- "version": "1.1.8",
4
+ "version": "1.2.0",
5
5
  "titleLang": {
6
6
  "en": "PV Notifications",
7
7
  "de": "PV-Benachrichtigungen",
@@ -28,6 +28,23 @@
28
28
  "uk": "Надсилати Telegram-сповіщення про стан батареї PV",
29
29
  "zh-cn": "发送 Telegram 通知用于 PV 电池状态"
30
30
  },
31
+ "news": {
32
+ "1.1.9": {
33
+ "en": "Weather today added to battery full (100%) and empty (0%) messages",
34
+ "de": "Wetter heute zu Batterie VOLL (100%) und LEER (0%) Nachrichten hinzugefügt",
35
+ "ru": "Погода сегодня добавлена в сообщения о полной (100%) и пустой (0%) батарее"
36
+ },
37
+ "1.1.8": {
38
+ "en": "Weather today added to intermediate messages",
39
+ "de": "Wetter heute zu Intermediate-Nachrichten hinzugefügt",
40
+ "ru": "Погода сегодня добавлена в промежуточные сообщения"
41
+ },
42
+ "1.1.7": {
43
+ "en": "Weather data null-check fix to prevent errors",
44
+ "de": "Wetterdaten null-check Fix um Fehler zu vermeiden",
45
+ "ru": "Исправлена проверка null для данных о погоде"
46
+ }
47
+ },
31
48
  "authors": [
32
49
  "Alex <alex@example.com>"
33
50
  ],
package/main.js CHANGED
@@ -881,21 +881,44 @@ class PvNotifications extends utils.Adapter {
881
881
  ☀️ ${this.translate('Production today')}: ${this.round(totalProd)} kWh
882
882
  🔌 ${this.translate('Feed-in today')}: ${this.round(Math.abs(feedIn), 0)} kWh`;
883
883
 
884
- // Wetter-Prognose hinzufügen (optional)
885
- if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
884
+ // Wetter-Prognose hinzufügen (heute und morgen)
885
+ const weatherConfigured = this.config.weatherTodayText || this.config.weatherTodayTemp || this.config.weatherTomorrowText || this.config.weatherTomorrow;
886
+ if (this.config.weatherEnabled !== false && weatherConfigured) {
886
887
  try {
887
- const weatherTomorrowText = this.getStateValue(this.config.weatherTomorrowText);
888
- const weatherTomorrow = this.getStateValue(this.config.weatherTomorrow);
889
- const tempTomorrow = this.getStateValue(this.config.weatherTomorrowTemp);
890
- const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
891
-
892
- const weatherText = weatherTomorrowText || weatherTomorrow;
893
- if (weatherText) {
894
- const weatherDesc = this.getWeatherDescription(weatherText);
895
- message += `\n🌤️ Morgen: ${weatherDesc}${tempText}`;
888
+ // Wetter heute
889
+ 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;
895
+ const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
896
+
897
+ if (weatherTodayText || weatherTodayTemp) {
898
+ const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
899
+ message += `\n🌤️ Heute: ${weatherDesc}${todayTempText}`;
900
+ }
901
+ }
902
+
903
+ // Wetter morgen
904
+ 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;
912
+ const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
913
+
914
+ const weatherText = weatherTomorrowText || weatherTomorrow;
915
+ if (weatherText) {
916
+ const weatherDesc = this.getWeatherDescription(weatherText);
917
+ message += `\n🌤️ Morgen: ${weatherDesc}${tempText}`;
896
918
 
897
- if (this.isWeatherBad(weatherText)) {
898
- message += `\n💡 ${this.translate('Tip tomorrow little sun use consumers today')}`;
919
+ if (this.isWeatherBad(weatherText)) {
920
+ message += `\n💡 ${this.translate('Tip tomorrow little sun use consumers today')}`;
921
+ }
899
922
  }
900
923
  }
901
924
  } catch (e) {
@@ -929,21 +952,44 @@ class PvNotifications extends utils.Adapter {
929
952
  ⚠️ ${this.translate('Grid consumption today')}: ${this.round(gridPower)} W
930
953
  🏠 ${this.translate('Consumption today')}: ${this.round(consumption)} W`;
931
954
 
932
- // Wetter-Prognose
933
- if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
955
+ // Wetter-Prognose hinzufügen (heute und morgen)
956
+ const weatherConfigured = this.config.weatherTodayText || this.config.weatherTodayTemp || this.config.weatherTomorrowText || this.config.weatherTomorrow;
957
+ if (this.config.weatherEnabled !== false && weatherConfigured) {
934
958
  try {
935
- const weatherTomorrowText = this.getStateValue(this.config.weatherTomorrowText);
936
- const weatherTomorrow = this.getStateValue(this.config.weatherTomorrow);
937
- const tempTomorrow = this.getStateValue(this.config.weatherTomorrowTemp);
938
- const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
939
-
940
- const weatherText = weatherTomorrowText || weatherTomorrow;
941
- if (weatherText) {
942
- const weatherDesc = this.getWeatherDescription(weatherText);
943
- message += `\n🌤️ Morgen: ${weatherDesc}${tempText}`;
959
+ // Wetter heute
960
+ 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;
966
+ const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
967
+
968
+ if (weatherTodayText || weatherTodayTemp) {
969
+ const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
970
+ message += `\n🌤️ Heute: ${weatherDesc}${todayTempText}`;
971
+ }
972
+ }
973
+
974
+ // Wetter morgen
975
+ 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;
983
+ const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
984
+
985
+ const weatherText = weatherTomorrowText || weatherTomorrow;
986
+ if (weatherText) {
987
+ const weatherDesc = this.getWeatherDescription(weatherText);
988
+ message += `\n🌤️ Morgen: ${weatherDesc}${tempText}`;
944
989
 
945
- if (this.isWeatherGood(weatherText)) {
946
- message += `\n💡 ${this.translate('Good news tomorrow more sun')}`;
990
+ if (this.isWeatherGood(weatherText)) {
991
+ message += `\n💡 ${this.translate('Good news tomorrow more sun')}`;
992
+ }
947
993
  }
948
994
  }
949
995
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.pv-notifications",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "PV-Anlage Batterie-Status Telegram Benachrichtigungen",
5
5
  "author": {
6
6
  "name": "Alex1808 via LLM: Qwen",