iobroker.pv-notifications 1.1.3 → 1.1.5
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 +4 -6
- package/io-package.json +1 -1
- package/main.js +58 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -339,15 +339,13 @@ sadam6752@gmail.com
|
|
|
339
339
|
### **WORK IN PROGRESS**
|
|
340
340
|
-->
|
|
341
341
|
|
|
342
|
-
### 1.1.
|
|
342
|
+
### 1.1.5 (2026-03-01)
|
|
343
343
|
|
|
344
|
-
* (
|
|
345
|
-
* (ADD) Users can now choose where to show weather: in intermediate messages, daily statistics, or both
|
|
346
|
-
* (FIX) Weather data now respects individual checkbox settings
|
|
344
|
+
* (FIX) Migration code added to set weatherInIntermediate and weatherInDailyStats to true by default for updates from < v1.1.3
|
|
347
345
|
|
|
348
|
-
### 1.1.
|
|
346
|
+
### 1.1.4 (2026-03-01)
|
|
349
347
|
|
|
350
|
-
* (
|
|
348
|
+
* (ADD) Weather data (today and tomorrow) added to test message (testButton)
|
|
351
349
|
|
|
352
350
|
### 1.1.1 (2026-03-01)
|
|
353
351
|
|
package/io-package.json
CHANGED
package/main.js
CHANGED
|
@@ -90,6 +90,16 @@ class PvNotifications extends utils.Adapter {
|
|
|
90
90
|
|
|
91
91
|
this.log.info('PV Notifications Adapter started');
|
|
92
92
|
|
|
93
|
+
// Migration: Set weather checkboxes to true if not set (for updates from < v1.1.3)
|
|
94
|
+
if (this.config.weatherEnabled === true &&
|
|
95
|
+
(this.config.weatherInIntermediate === undefined || this.config.weatherInIntermediate === null)) {
|
|
96
|
+
this.log.info('Migration: Setting weatherInIntermediate to true (default)');
|
|
97
|
+
}
|
|
98
|
+
if (this.config.weatherEnabled === true &&
|
|
99
|
+
(this.config.weatherInDailyStats === undefined || this.config.weatherInDailyStats === null)) {
|
|
100
|
+
this.log.info('Migration: Setting weatherInDailyStats to true (default)');
|
|
101
|
+
}
|
|
102
|
+
|
|
93
103
|
// Log configuration
|
|
94
104
|
this.log.info(
|
|
95
105
|
`Configuration: Full=${this.config.thresholdFull}%, Empty=${this.config.thresholdEmpty}%, Intermediate=[${this.config.intermediateSteps}]`,
|
|
@@ -1457,7 +1467,7 @@ ${statusText}`;
|
|
|
1457
1467
|
'Own consumption': {
|
|
1458
1468
|
de: 'Eigenverbrauch',
|
|
1459
1469
|
en: 'Own consumption',
|
|
1460
|
-
ru: 'Собственное
|
|
1470
|
+
ru: 'Собственное потребле��ие',
|
|
1461
1471
|
},
|
|
1462
1472
|
'Feed-in': {
|
|
1463
1473
|
de: 'Einspeisung',
|
|
@@ -1494,6 +1504,11 @@ ${statusText}`;
|
|
|
1494
1504
|
en: 'Weather tomorrow',
|
|
1495
1505
|
ru: 'Погода завтра',
|
|
1496
1506
|
},
|
|
1507
|
+
'Weather today': {
|
|
1508
|
+
de: 'Wetter heute',
|
|
1509
|
+
en: 'Weather today',
|
|
1510
|
+
ru: 'Погода сегодня',
|
|
1511
|
+
},
|
|
1497
1512
|
'Good PV production expected': {
|
|
1498
1513
|
de: 'Gute PV-Produktion erwartet',
|
|
1499
1514
|
en: 'Good PV production expected',
|
|
@@ -1600,7 +1615,7 @@ ${statusText}`;
|
|
|
1600
1615
|
const selfConsumption = this.round(totalProd - feedIn, 1);
|
|
1601
1616
|
const selfConsumptionRate = totalProd > 0 ? this.round((selfConsumption / totalProd) * 100, 1) : 0;
|
|
1602
1617
|
|
|
1603
|
-
|
|
1618
|
+
let message = `🧪 *${this.translate('Daily statistics PV system')} - TEST*
|
|
1604
1619
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
1605
1620
|
🔋 ${this.translate('Current charge level')}: ${soc}%
|
|
1606
1621
|
⚡ ${this.translate('Current energy')}: ${currentKWh} kWh (${batteryCapacityKWh} kWh ${this.translate('Total capacity')})
|
|
@@ -1610,9 +1625,48 @@ ${statusText}`;
|
|
|
1610
1625
|
🔌 ${this.translate('Feed-in')}: ${feedIn} kWh
|
|
1611
1626
|
⚡ ${this.translate('Grid consumption')}: ${gridPower} kWh
|
|
1612
1627
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
1613
|
-
💡 ${this.translate('A healthy cycle per day is normal')}
|
|
1628
|
+
💡 ${this.translate('A healthy cycle per day is normal')}`;
|
|
1629
|
+
|
|
1630
|
+
// Wetterdaten hinzufügen (heute und morgen) für Test
|
|
1631
|
+
if (this.config.weatherEnabled !== false) {
|
|
1632
|
+
try {
|
|
1633
|
+
// Wetter heute
|
|
1634
|
+
if (this.config.weatherTodayText || this.config.weatherTodayTemp) {
|
|
1635
|
+
const weatherTodayTextState = await this.getForeignStateAsync(this.config.weatherTodayText);
|
|
1636
|
+
const weatherTodayState = await this.getForeignStateAsync(this.config.weatherTodayTemp);
|
|
1637
|
+
|
|
1638
|
+
const weatherTodayText = weatherTodayTextState && weatherTodayTextState.val !== null ? weatherTodayTextState.val : null;
|
|
1639
|
+
const weatherTodayTemp = weatherTodayState && weatherTodayState.val !== null ? weatherTodayState.val : null;
|
|
1640
|
+
const tempText = weatherTodayTemp ? ` ${this.round(weatherTodayTemp, 1)}°C` : '';
|
|
1641
|
+
|
|
1642
|
+
if (weatherTodayText || weatherTodayTemp) {
|
|
1643
|
+
const weatherDesc = weatherTodayText ? this.getWeatherDescription(weatherTodayText) : '🌡️';
|
|
1644
|
+
message += `\n\n🌤️ *${this.translate('Weather today')}:* ${weatherDesc}${tempText}`;
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
// Wetter morgen
|
|
1649
|
+
if (this.config.weatherTomorrowText || this.config.weatherTomorrowTemp) {
|
|
1650
|
+
const weatherTomorrowTextState = await this.getForeignStateAsync(this.config.weatherTomorrowText);
|
|
1651
|
+
const weatherTomorrowState = await this.getForeignStateAsync(this.config.weatherTomorrowTemp);
|
|
1614
1652
|
|
|
1615
|
-
|
|
1653
|
+
const weatherTomorrowText = weatherTomorrowTextState && weatherTomorrowTextState.val !== null ? weatherTomorrowTextState.val : null;
|
|
1654
|
+
const weatherTomorrowTemp = weatherTomorrowState && weatherTomorrowState.val !== null ? weatherTomorrowState.val : null;
|
|
1655
|
+
const tempText = weatherTomorrowTemp ? ` ${this.round(weatherTomorrowTemp, 1)}°C` : '';
|
|
1656
|
+
|
|
1657
|
+
if (weatherTomorrowText || weatherTomorrowTemp) {
|
|
1658
|
+
const weatherDesc = weatherTomorrowText ? this.getWeatherDescription(weatherTomorrowText) : '🌡️';
|
|
1659
|
+
message += `\n🌤️ *${this.translate('Weather tomorrow')}:* ${weatherDesc}${tempText}`;
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
} catch (e) {
|
|
1663
|
+
this.log.debug(`Weather data for test not available: ${e.message}`);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
message += `\n\n*${this.translate('Test Notification')} - pv-notifications v${this.version}*`;
|
|
1668
|
+
|
|
1669
|
+
return message;
|
|
1616
1670
|
}
|
|
1617
1671
|
|
|
1618
1672
|
/**
|