iobroker.pv-notifications 1.1.7 → 1.1.8

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.7 (2026-03-01)
342
+ ### 1.1.8 (2026-03-01)
343
343
 
344
- * (FIX) Weather data reading: Added null checks before calling getForeignStateAsync() to prevent "id needs to be string" error
345
- * (FIX) Better error logging shows which weather data points are configured
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
346
346
 
347
- ### 1.1.6 (2026-03-01)
347
+ ### 1.1.7 (2026-03-01)
348
348
 
349
- * (ADD) Debug logging added to buildIntermediateMessage() for troubleshooting weather data issues
349
+ * (FIX) Weather data reading: Added null checks before calling getForeignStateAsync() to prevent "id needs to be string" error
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.7",
4
+ "version": "1.1.8",
5
5
  "titleLang": {
6
6
  "en": "PV Notifications",
7
7
  "de": "PV-Benachrichtigungen",
package/main.js CHANGED
@@ -992,36 +992,51 @@ class PvNotifications extends utils.Adapter {
992
992
  ${statusText}`;
993
993
 
994
994
  // Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInIntermediate aktiv)
995
- const weatherConfigured = this.config.weatherTomorrowText || this.config.weatherTomorrow;
995
+ const weatherConfigured = this.config.weatherTomorrowText || this.config.weatherTomorrow || this.config.weatherTodayText || this.config.weatherTodayTemp;
996
996
  this.log.debug(`Weather config: enabled=${this.config.weatherEnabled}, inIntermediate=${this.config.weatherInIntermediate}, configured=${weatherConfigured}`);
997
- this.log.debug(`Weather data points: tomorrowText="${this.config.weatherTomorrowText}", tomorrow="${this.config.weatherTomorrow}", tomorrowTemp="${this.config.weatherTomorrowTemp}"`);
997
+ 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}"`);
998
998
 
999
999
  if (this.config.weatherEnabled !== false && this.config.weatherInIntermediate !== false && weatherConfigured) {
1000
1000
  try {
1001
1001
  this.log.debug('Attempting to read weather data...');
1002
1002
 
1003
- const weatherTomorrowTextState = this.config.weatherTomorrowText ? await this.getForeignStateAsync(this.config.weatherTomorrowText) : null;
1004
- const weatherTomorrowState = this.config.weatherTomorrow ? await this.getForeignStateAsync(this.config.weatherTomorrow) : null;
1005
- const tempTomorrowState = this.config.weatherTomorrowTemp ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp) : null;
1006
-
1007
- const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1008
- const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1009
- const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1010
- const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
1011
-
1012
- this.log.debug(`Weather data read: text=${weatherTomorrowText}, temp=${weatherTomorrow}, tempValue=${tempTomorrow}`);
1003
+ // Wetter heute lesen
1004
+ if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
1005
+ const weatherTodayTextState = this.config.weatherTodayText ? await this.getForeignStateAsync(this.config.weatherTodayText) : null;
1006
+ const weatherTodayTempState = this.config.weatherTodayTemp ? await this.getForeignStateAsync(this.config.weatherTodayTemp) : null;
1007
+
1008
+ const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1009
+ const weatherTodayTemp = weatherTodayTempState && weatherTodayTempState.val !== null ? weatherTodayTempState.val : null;
1010
+ const todayTempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
1011
+
1012
+ if (weatherTodayText || weatherTodayTemp) {
1013
+ const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
1014
+ message += `\n\n🌤️ ${this.translate('Weather today')}: ${weatherDesc}${todayTempText}`;
1015
+ this.log.info(`Weather today added to intermediate message: ${weatherDesc}${todayTempText}`);
1016
+ }
1017
+ }
1018
+
1019
+ // Wetter morgen lesen
1020
+ if (this.config.weatherTomorrowText || this.config.weatherTomorrow) {
1021
+ const weatherTomorrowTextState = this.config.weatherTomorrowText ? await this.getForeignStateAsync(this.config.weatherTomorrowText) : null;
1022
+ const weatherTomorrowState = this.config.weatherTomorrow ? await this.getForeignStateAsync(this.config.weatherTomorrow) : null;
1023
+ const tempTomorrowState = this.config.weatherTomorrowTemp ? await this.getForeignStateAsync(this.config.weatherTomorrowTemp) : null;
1013
1024
 
1014
- const weatherText = weatherTomorrowText || weatherTomorrow;
1015
- if (weatherText) {
1016
- const weatherDesc = this.getWeatherDescription(weatherText);
1017
- message += `\n\n🌤️ ${this.translate('Weather tomorrow')}: ${weatherDesc}${tempText}`;
1018
- this.log.info(`Weather added to intermediate message: ${weatherDesc}${tempText}`);
1019
- } else {
1020
- this.log.debug('No weather text found (states may be null or empty)');
1025
+ const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1026
+ const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1027
+ const tempTomorrow = tempTomorrowState && tempTomorrowState.val !== null ? tempTomorrowState.val : null;
1028
+ const tempText = tempTomorrow ? ` ${this.round(tempTomorrow, 1)}°C` : '';
1029
+
1030
+ const weatherText = weatherTomorrowText || weatherTomorrow;
1031
+ if (weatherText) {
1032
+ const weatherDesc = this.getWeatherDescription(weatherText);
1033
+ message += `\n🌤️ ${this.translate('Weather tomorrow')}: ${weatherDesc}${tempText}`;
1034
+ this.log.info(`Weather tomorrow added to intermediate message: ${weatherDesc}${tempText}`);
1035
+ }
1021
1036
  }
1022
1037
  } catch (e) {
1023
1038
  this.log.error(`Weather data error: ${e.message}`);
1024
- this.log.error(`Config: weatherTomorrowText="${this.config.weatherTomorrowText}", weatherTomorrow="${this.config.weatherTomorrow}"`);
1039
+ this.log.error(`Config: weatherTodayText="${this.config.weatherTodayText}", weatherTomorrowText="${this.config.weatherTomorrowText}"`);
1025
1040
  }
1026
1041
  } else {
1027
1042
  if (this.config.weatherEnabled === false) {
@@ -1031,7 +1046,7 @@ ${statusText}`;
1031
1046
  this.log.debug('Weather disabled for intermediate (weatherInIntermediate=false)');
1032
1047
  }
1033
1048
  if (!weatherConfigured) {
1034
- this.log.debug('Weather not configured (no weatherTomorrowText or weatherTomorrow)');
1049
+ this.log.debug('Weather not configured (no weatherTodayText, weatherTodayTemp, weatherTomorrowText or weatherTomorrow)');
1035
1050
  }
1036
1051
  }
1037
1052
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.pv-notifications",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "PV-Anlage Batterie-Status Telegram Benachrichtigungen",
5
5
  "author": {
6
6
  "name": "Alex1808 via LLM: Qwen",