iobroker.pv-notifications 1.1.6 → 1.1.7

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,13 +339,14 @@ sadam6752@gmail.com
339
339
  ### **WORK IN PROGRESS**
340
340
  -->
341
341
 
342
- ### 1.1.6 (2026-03-01)
342
+ ### 1.1.7 (2026-03-01)
343
343
 
344
- * (ADD) Debug logging added to buildIntermediateMessage() for troubleshooting weather data issues
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
345
346
 
346
- ### 1.1.5 (2026-03-01)
347
+ ### 1.1.6 (2026-03-01)
347
348
 
348
- * (FIX) Migration code added to set weatherInIntermediate and weatherInDailyStats to true by default for updates from < v1.1.3
349
+ * (ADD) Debug logging added to buildIntermediateMessage() for troubleshooting weather data issues
349
350
 
350
351
  ### 1.1.1 (2026-03-01)
351
352
 
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "pv-notifications",
4
- "version": "1.1.6",
4
+ "version": "1.1.7",
5
5
  "titleLang": {
6
6
  "en": "PV Notifications",
7
7
  "de": "PV-Benachrichtigungen",
package/main.js CHANGED
@@ -992,15 +992,17 @@ 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
- this.log.debug(`Weather config: enabled=${this.config.weatherEnabled}, inIntermediate=${this.config.weatherInIntermediate}, tomorrowText=${this.config.weatherTomorrowText}, tomorrow=${this.config.weatherTomorrow}`);
995
+ const weatherConfigured = this.config.weatherTomorrowText || this.config.weatherTomorrow;
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}"`);
996
998
 
997
- if (this.config.weatherEnabled !== false && this.config.weatherInIntermediate !== false &&
998
- (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
999
+ if (this.config.weatherEnabled !== false && this.config.weatherInIntermediate !== false && weatherConfigured) {
999
1000
  try {
1000
1001
  this.log.debug('Attempting to read weather data...');
1001
- const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
1002
- const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrow);
1003
- const tempTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
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;
1004
1006
 
1005
1007
  const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1006
1008
  const weatherTomorrow = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
@@ -1015,13 +1017,22 @@ ${statusText}`;
1015
1017
  message += `\n\n🌤️ ${this.translate('Weather tomorrow')}: ${weatherDesc}${tempText}`;
1016
1018
  this.log.info(`Weather added to intermediate message: ${weatherDesc}${tempText}`);
1017
1019
  } else {
1018
- this.log.debug('No weather text found');
1020
+ this.log.debug('No weather text found (states may be null or empty)');
1019
1021
  }
1020
1022
  } catch (e) {
1021
1023
  this.log.error(`Weather data error: ${e.message}`);
1024
+ this.log.error(`Config: weatherTomorrowText="${this.config.weatherTomorrowText}", weatherTomorrow="${this.config.weatherTomorrow}"`);
1022
1025
  }
1023
1026
  } else {
1024
- this.log.debug('Weather not enabled or config missing');
1027
+ if (this.config.weatherEnabled === false) {
1028
+ this.log.debug('Weather disabled (weatherEnabled=false)');
1029
+ }
1030
+ if (this.config.weatherInIntermediate === false) {
1031
+ this.log.debug('Weather disabled for intermediate (weatherInIntermediate=false)');
1032
+ }
1033
+ if (!weatherConfigured) {
1034
+ this.log.debug('Weather not configured (no weatherTomorrowText or weatherTomorrow)');
1035
+ }
1025
1036
  }
1026
1037
 
1027
1038
  return message;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.pv-notifications",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "PV-Anlage Batterie-Status Telegram Benachrichtigungen",
5
5
  "author": {
6
6
  "name": "Alex1808 via LLM: Qwen",