iobroker.pv-notifications 1.1.2 → 1.1.4

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,11 +339,14 @@ sadam6752@gmail.com
339
339
  ### **WORK IN PROGRESS**
340
340
  -->
341
341
 
342
- ### 1.1.2 (2026-03-01)
342
+ ### 1.1.4 (2026-03-01)
343
343
 
344
- * (FIX) Weather data now read correctly using getForeignStateAsync() instead of getStateValue()
345
- * (FIX) Weather data added to daily statistics (buildDailyStatsMessage) and intermediate messages (buildIntermediateMessage)
346
- * (ADD) New checkbox 'weatherEnabled' to enable/disable weather data in messages
344
+ * (ADD) Weather data (today and tomorrow) added to test message (testButton)
345
+ * (ADD) "Weather today" translation key added
346
+
347
+ ### 1.1.3 (2026-03-01)
348
+
349
+ * (ADD) Two separate checkboxes for weather data: 'weatherInIntermediate' and 'weatherInDailyStats'
347
350
 
348
351
  ### 1.1.1 (2026-03-01)
349
352
 
@@ -70,6 +70,10 @@
70
70
  "header_weather": "Wetter (Optional)",
71
71
  "label_weatherEnabled": "Wetterdaten in Nachrichten anzeigen",
72
72
  "tooltip_weatherEnabled": "Wenn aktiviert, werden Wetterdaten in Tagesstatistik und Batterie-Status-Nachrichten angezeigt",
73
+ "label_weatherInIntermediate": "Intermediate-Stufen",
74
+ "tooltip_weatherInIntermediate": "Wetterdaten in Intermediate-Nachrichten (20%, 40%, 60%, 80%) anzeigen",
75
+ "label_weatherInDailyStats": "Tagesstatistik",
76
+ "tooltip_weatherInDailyStats": "Wetterdaten in Tagesstatistik (22:00) anzeigen",
73
77
  "label_weatherTodayText": "Wetter heute",
74
78
  "tooltip_weatherTodayText": "Z.B. daswetter.0.Day0.forecast.currentSymbol",
75
79
  "label_weatherTodayTemp": "Temperatur heute (°C)",
@@ -70,6 +70,10 @@
70
70
  "header_weather": "Weather (Optional)",
71
71
  "label_weatherEnabled": "Show weather data in messages",
72
72
  "tooltip_weatherEnabled": "If enabled, weather data will be shown in daily statistics and battery status messages",
73
+ "label_weatherInIntermediate": "Intermediate levels",
74
+ "tooltip_weatherInIntermediate": "Show weather data in intermediate messages (20%, 40%, 60%, 80%)",
75
+ "label_weatherInDailyStats": "Daily statistics",
76
+ "tooltip_weatherInDailyStats": "Show weather data in daily statistics (22:00)",
73
77
  "label_weatherTodayText": "Weather today",
74
78
  "tooltip_weatherTodayText": "e.g. daswetter.0.Day0.forecast.currentSymbol",
75
79
  "label_weatherTodayTemp": "Temperature today (°C)",
@@ -70,6 +70,10 @@
70
70
  "header_weather": "Погода (опционально)",
71
71
  "label_weatherEnabled": "Показывать данные о погоде в сообщениях",
72
72
  "tooltip_weatherEnabled": "Если включено, данные о погоде будут отображаться в дневной статистике и сообщениях о статусе батареи",
73
+ "label_weatherInIntermediate": "Промежуточные уровни",
74
+ "tooltip_weatherInIntermediate": "Показывать погоду в промежуточных сообщениях (20%, 40%, 60%, 80%)",
75
+ "label_weatherInDailyStats": "Дневная статистика",
76
+ "tooltip_weatherInDailyStats": "Показывать погоду в дневной статистике (22:00)",
73
77
  "label_weatherTodayText": "Погода сегодня",
74
78
  "tooltip_weatherTodayText": "Например: daswetter.0.Day0.forecast.currentSymbol",
75
79
  "label_weatherTodayTemp": "Температура сегодня (°C)",
@@ -433,6 +433,26 @@
433
433
  "default": true,
434
434
  "tooltip": "tooltip_weatherEnabled"
435
435
  },
436
+ "weatherInIntermediate": {
437
+ "type": "checkbox",
438
+ "label": "label_weatherInIntermediate",
439
+ "sm": 6,
440
+ "md": 6,
441
+ "lg": 6,
442
+ "default": true,
443
+ "tooltip": "tooltip_weatherInIntermediate",
444
+ "disabled": "!weatherEnabled"
445
+ },
446
+ "weatherInDailyStats": {
447
+ "type": "checkbox",
448
+ "label": "label_weatherInDailyStats",
449
+ "sm": 6,
450
+ "md": 6,
451
+ "lg": 6,
452
+ "default": true,
453
+ "tooltip": "tooltip_weatherInDailyStats",
454
+ "disabled": "!weatherEnabled"
455
+ },
436
456
  "weatherTodayText": {
437
457
  "type": "objectId",
438
458
  "label": "label_weatherTodayText",
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "pv-notifications",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "titleLang": {
6
6
  "en": "PV Notifications",
7
7
  "de": "PV-Benachrichtigungen",
package/main.js CHANGED
@@ -981,8 +981,9 @@ class PvNotifications extends utils.Adapter {
981
981
  ⚡ ${production}: ${this.round(power)} W
982
982
  ${statusText}`;
983
983
 
984
- // Wetter-Prognose für morgen hinzufügen (optional)
985
- if (this.config.weatherEnabled !== false && (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
984
+ // Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInIntermediate aktiv)
985
+ if (this.config.weatherEnabled !== false && this.config.weatherInIntermediate !== false &&
986
+ (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
986
987
  try {
987
988
  const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
988
989
  const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrow);
@@ -1041,8 +1042,9 @@ ${statusText}`;
1041
1042
  🔌 ${this.translate('Feed-in')}: ${feedIn} kWh
1042
1043
  ⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh`;
1043
1044
 
1044
- // Wetter-Prognose für morgen hinzufügen
1045
- if (this.config.weatherEnabled !== false && (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
1045
+ // Wetter-Prognose für morgen hinzufügen (optional, nur wenn weatherInDailyStats aktiv)
1046
+ if (this.config.weatherEnabled !== false && this.config.weatherInDailyStats !== false &&
1047
+ (this.config.weatherTomorrowText || this.config.weatherTomorrow)) {
1046
1048
  try {
1047
1049
  const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
1048
1050
  const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrow);
@@ -1492,6 +1494,11 @@ ${statusText}`;
1492
1494
  en: 'Weather tomorrow',
1493
1495
  ru: 'Погода завтра',
1494
1496
  },
1497
+ 'Weather today': {
1498
+ de: 'Wetter heute',
1499
+ en: 'Weather today',
1500
+ ru: 'Погода сегодня',
1501
+ },
1495
1502
  'Good PV production expected': {
1496
1503
  de: 'Gute PV-Produktion erwartet',
1497
1504
  en: 'Good PV production expected',
@@ -1598,7 +1605,7 @@ ${statusText}`;
1598
1605
  const selfConsumption = this.round(totalProd - feedIn, 1);
1599
1606
  const selfConsumptionRate = totalProd > 0 ? this.round((selfConsumption / totalProd) * 100, 1) : 0;
1600
1607
 
1601
- return `🧪 *${this.translate('Daily statistics PV system')} - TEST*
1608
+ let message = `🧪 *${this.translate('Daily statistics PV system')} - TEST*
1602
1609
  ━━━━━━━━━━━━━━━━━━━━━━
1603
1610
  🔋 ${this.translate('Current charge level')}: ${soc}%
1604
1611
  ⚡ ${this.translate('Current energy')}: ${currentKWh} kWh (${batteryCapacityKWh} kWh ${this.translate('Total capacity')})
@@ -1608,9 +1615,48 @@ ${statusText}`;
1608
1615
  🔌 ${this.translate('Feed-in')}: ${feedIn} kWh
1609
1616
  ⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh
1610
1617
  ━━━━━━━━━━━━━━━━━━━━━━
1611
- 💡 ${this.translate('A healthy cycle per day is normal')}
1618
+ 💡 ${this.translate('A healthy cycle per day is normal')}`;
1619
+
1620
+ // Wetterdaten hinzufügen (heute und morgen) für Test
1621
+ if (this.config.weatherEnabled !== false) {
1622
+ try {
1623
+ // Wetter heute
1624
+ if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
1625
+ const weatherTodayTextState = await this.getForeignStateAsync(this.config.weatherTodayText);
1626
+ const weatherTodayState = await this.getForeignStateAsync(this.config.weatherTodayTemp);
1627
+
1628
+ const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
1629
+ const weatherTodayTemp = weatherTodayState && weatherTodayState.val !== null ? weatherTodayState.val : null;
1630
+ const tempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
1631
+
1632
+ if (weatherTodayText || weatherTodayTemp) {
1633
+ const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
1634
+ message += `\n\n🌤️ *${this.translate('Weather today')}:* ${weatherDesc}${tempText}`;
1635
+ }
1636
+ }
1637
+
1638
+ // Wetter morgen
1639
+ if (this.config.weatherTomorrowText || this.config.weatherTomorrowTemp) {
1640
+ const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
1641
+ const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
1642
+
1643
+ const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
1644
+ const weatherTomorrowTemp = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
1645
+ const tempText = weatherTomorrowTemp ? ` ${this.round(weatherTomorrowTemp, 1)}°C` : '';
1612
1646
 
1613
- *${this.translate('Test Notification')} - pv-notifications v${this.version}*`;
1647
+ if (weatherTomorrowText || weatherTomorrowTemp) {
1648
+ const weatherDesc = weatherTomorrowText ? this.getWeatherDescription(weatherTomorrowText) : '🌡️';
1649
+ message += `\n🌤️ *${this.translate('Weather tomorrow')}:* ${weatherDesc}${tempText}`;
1650
+ }
1651
+ }
1652
+ } catch (e) {
1653
+ this.log.debug(`Weather data for test not available: ${e.message}`);
1654
+ }
1655
+ }
1656
+
1657
+ message += `\n\n*${this.translate('Test Notification')} - pv-notifications v${this.version}*`;
1658
+
1659
+ return message;
1614
1660
  }
1615
1661
 
1616
1662
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.pv-notifications",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "PV-Anlage Batterie-Status Telegram Benachrichtigungen",
5
5
  "author": {
6
6
  "name": "Alex1808 via LLM: Qwen",