iobroker.sprinklecontrol 1.0.0 → 1.0.2
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 +8 -6
- package/admin/i18n/de/translations.json +11 -0
- package/admin/i18n/en/translations.json +11 -0
- package/admin/i18n/es/translations.json +11 -0
- package/admin/i18n/fr/translations.json +11 -0
- package/admin/i18n/it/translations.json +11 -0
- package/admin/i18n/nl/translations.json +11 -0
- package/admin/i18n/pl/translations.json +11 -0
- package/admin/i18n/pt/translations.json +11 -0
- package/admin/i18n/ru/translations.json +11 -0
- package/admin/i18n/uk/translations.json +11 -0
- package/admin/i18n/zh-cn/translations.json +11 -0
- package/admin/index_m.html +515 -455
- package/admin/index_m.js +35 -18
- package/admin/words.js +20 -9
- package/io-package.json +31 -29
- package/lib/evaporation.js +9 -10
- package/lib/myConfig.js +46 -24
- package/lib/sendMessageText.js +5 -5
- package/lib/tools.js +242 -200
- package/lib/valveControl.js +239 -87
- package/main.js +84 -42
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -15,9 +15,8 @@ const controlVoltage = require('./lib/valveControl.js').controlVoltage; // state
|
|
|
15
15
|
const currentPumpUse = require('./lib/valveControl.js').currentPumpUse; // state der Pumpen
|
|
16
16
|
const threadList = require('./lib/valveControl.js').threadList; // Auflistung aller aktiver Sprenger-Kreise
|
|
17
17
|
const myConfig = require('./lib/myConfig.js'); // myConfig → Speichern und abrufen von Konfigurationsdaten der Ventile
|
|
18
|
-
const evaporation = require('./lib/evaporation.js');
|
|
19
|
-
const
|
|
20
|
-
const formatTime = require('./lib/tools.js').formatTime;
|
|
18
|
+
const evaporation = require('./lib/evaporation.js'); // Berechnung der Verdunstung, Ermittlung der täglichen Höchsttemperatur, Speicherung der aktuellen Werte von Temperatur, Luftfeuchtigkeit, Helligkeit, Windgeschwindigkeit und Regenmenge
|
|
19
|
+
const tools = require('./lib/tools.js').tools; // tools => laden von Hilfsfunktionen
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* The adapter instance
|
|
@@ -30,6 +29,7 @@ let weatherForecastTodayPfadStr; // Pfad zur Regenvorhersage in mm (Regenvorh
|
|
|
30
29
|
let weatherForecastTodayNum = 0; // heutige Regenvorhersage in mm
|
|
31
30
|
let weatherForecastTomorrowNum = 0; // morgige Regenvorhersage in mm
|
|
32
31
|
let addStartTimeSwitch = false; // Externer Schalter für Zusatzbewässerung
|
|
32
|
+
let irrigationRestriction = false; // Schalter für Bewässerungseinschränkung
|
|
33
33
|
|
|
34
34
|
let startTimeStr;
|
|
35
35
|
let sunriseStr;
|
|
@@ -68,6 +68,8 @@ function startAdapter(options) {
|
|
|
68
68
|
/*Startzeiten der Timer löschen*/
|
|
69
69
|
schedule.cancelJob('calcPosTimer');
|
|
70
70
|
schedule.cancelJob('sprinkleStartTime');
|
|
71
|
+
schedule.cancelJob('irrigationRestrictionOn');
|
|
72
|
+
schedule.cancelJob('irrigationRestrictionOff');
|
|
71
73
|
schedule.cancelJob('sprinkleAddStartTime');
|
|
72
74
|
/* alle Ventile und Aktoren deaktivieren */
|
|
73
75
|
valveControl.clearEntireList();
|
|
@@ -137,7 +139,7 @@ function startAdapter(options) {
|
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
// Wettervorhersage
|
|
140
|
-
if (adapter.config.
|
|
142
|
+
if (adapter.config.weatherForecastService !== 'noWeatherData') {
|
|
141
143
|
if (id === weatherForecastTodayPfadStr) {
|
|
142
144
|
if (typeof state.val == 'string') {
|
|
143
145
|
weatherForecastTodayNum = parseFloat(state.val);
|
|
@@ -288,7 +290,7 @@ function startAdapter(options) {
|
|
|
288
290
|
const _extBreak = await valveControl.extBreak(_found.sprinkleID, state.val).catch((e) => {
|
|
289
291
|
adapter.log.warn(`main.extBreak: ${e}`);
|
|
290
292
|
});
|
|
291
|
-
adapter.log.info(`
|
|
293
|
+
if (_extBreak?.name) adapter.log.info(`_extBreak: ${_extBreak.name}, ${_extBreak.val ? 'on' : 'off'}`);
|
|
292
294
|
if (_extBreak?.val === false) {
|
|
293
295
|
/* Zustand des Ventils im Thread < 0 > off, < 1 > wait, < 2 > on, < 3 > break, < 4 > Boost(on), < 5 > off(Boost), < 6 > Cistern empty, <<< 7 >>> extBreak */
|
|
294
296
|
adapter.setState(`sprinkle.${_found.objectName}.sprinklerState`, {
|
|
@@ -317,24 +319,24 @@ function startAdapter(options) {
|
|
|
317
319
|
// Bestätigung für das Schalten der Ventile
|
|
318
320
|
if (myConfig.config) {
|
|
319
321
|
//adapter.log.info(`vor found: ${id} (${state.val}) => ack === ${state.ack}`);
|
|
320
|
-
const found = myConfig.config.find((d) => d.
|
|
322
|
+
const found = myConfig.config.find((d) => d.control.idACK === id);
|
|
321
323
|
//adapter.log.info(`nach found: ${id} => ${JSON.stringify(found)}`);
|
|
322
|
-
if (found && (id === myConfig.config[found.sprinkleID].
|
|
324
|
+
if (found && (id === myConfig.config[found.sprinkleID].control.idACK)) {
|
|
323
325
|
found.state = state;
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
328
|
if (threadList) {
|
|
327
|
-
const found = threadList.find((d) => d.
|
|
329
|
+
const found = threadList.find((d) => d.control.idACK === id);
|
|
328
330
|
if (found !== undefined && typeof found.controller.ackTrue === 'function') {
|
|
329
331
|
found.controller.ackTrue(state);
|
|
330
332
|
}
|
|
331
333
|
}
|
|
332
334
|
// 24V Steuerspannung
|
|
333
|
-
if (id ===
|
|
335
|
+
if (id === controlVoltage.control.idACK && typeof controlVoltage.controller.ackTrue === 'function') {
|
|
334
336
|
controlVoltage.controller.ackTrue(state);
|
|
335
337
|
}
|
|
336
338
|
// Pumpe (aktuell verwendete Pumpe)
|
|
337
|
-
if (id === currentPumpUse.
|
|
339
|
+
if (id === currentPumpUse.control.idACK && typeof currentPumpUse.controller.ackTrue === 'function') {
|
|
338
340
|
currentPumpUse.controller.ackTrue(state);
|
|
339
341
|
}
|
|
340
342
|
// The state was deleted
|
|
@@ -414,7 +416,7 @@ async function curNextFixDay (sprinkleID, returnOn) {
|
|
|
414
416
|
const objPfad = `sprinkle.${myConfig.config[sprinkleID].objectName}`;
|
|
415
417
|
const weekday = ['Sun','Mon','Tue','Wed','Thur','Fri','Sat'];
|
|
416
418
|
let found = false;
|
|
417
|
-
let curDay = formatTime().day;
|
|
419
|
+
let curDay = tools.formatTime().day;
|
|
418
420
|
const d = new Date();
|
|
419
421
|
const curTime = `${zweiStellen(d.getHours())}:${zweiStellen(d.getMinutes())}`;
|
|
420
422
|
|
|
@@ -460,7 +462,7 @@ async function curNextFixDay (sprinkleID, returnOn) {
|
|
|
460
462
|
* false → Zweitage-modus (twoNd)
|
|
461
463
|
*/
|
|
462
464
|
async function setNewDay (indexNr, threeRd) {
|
|
463
|
-
const today = formatTime().day;
|
|
465
|
+
const today = tools.formatTime().day;
|
|
464
466
|
const nextStartDay = ((today + 1) > 6 ? 0 : (today + 1));
|
|
465
467
|
const objectName = myConfig.config[indexNr].objectName;
|
|
466
468
|
const _actualSoilMoisture = await adapter.getStateAsync(
|
|
@@ -494,7 +496,7 @@ async function setNewDay (indexNr, threeRd) {
|
|
|
494
496
|
* @returns {number} - resultierende Regenmenge
|
|
495
497
|
*/
|
|
496
498
|
function resRain (inGreenhouse) {
|
|
497
|
-
return +((adapter.config.
|
|
499
|
+
return +((adapter.config.weatherForecastService !== 'noWeatherData' && !inGreenhouse) ? (((+ weatherForecastTodayNum) - parseFloat(adapter.config.thresholdRain)).toFixed(1)) : 0);
|
|
498
500
|
}
|
|
499
501
|
|
|
500
502
|
/**
|
|
@@ -567,7 +569,7 @@ async function checkStates() {
|
|
|
567
569
|
}
|
|
568
570
|
|
|
569
571
|
/* akt. kW ermitteln für history last week */
|
|
570
|
-
const _formatTime = formatTime();
|
|
572
|
+
const _formatTime = tools.formatTime();
|
|
571
573
|
kw = _formatTime.kW;
|
|
572
574
|
today = _formatTime.day;
|
|
573
575
|
} catch (e) {
|
|
@@ -620,7 +622,7 @@ async function checkActualStates () {
|
|
|
620
622
|
}
|
|
621
623
|
}
|
|
622
624
|
|
|
623
|
-
if (adapter.config.
|
|
625
|
+
if (adapter.config.weatherForecastService !== 'noWeatherData' && (weatherForecastTodayPfadStr !== undefined || weatherForecastTodayPfadStr !== '')) {
|
|
624
626
|
/* Niederschlagsmenge HEUTE in mm */
|
|
625
627
|
const _weatherForInstanceToday = await adapter.getForeignStateAsync(
|
|
626
628
|
weatherForecastTodayPfadStr
|
|
@@ -712,7 +714,7 @@ async function checkActualStates () {
|
|
|
712
714
|
const calcPos = schedule.scheduleJob('calcPosTimer', '5 0 * * *', function() {
|
|
713
715
|
// Berechnungen mittels SunCalc
|
|
714
716
|
sunPos();
|
|
715
|
-
const _curTime = formatTime();
|
|
717
|
+
const _curTime = tools.formatTime();
|
|
716
718
|
today = _curTime.day;
|
|
717
719
|
|
|
718
720
|
// History Daten aktualisieren, wenn eine neue Woche beginnt
|
|
@@ -751,6 +753,10 @@ const calcPos = schedule.scheduleJob('calcPosTimer', '5 0 * * *', function() {
|
|
|
751
753
|
// Startzeit Festlegen → verzögert wegen Daten von SunCalc
|
|
752
754
|
setTimeout(() => {
|
|
753
755
|
startTimeSprinkle();
|
|
756
|
+
if (adapter.config.enableTimeBasedRestriction === true) {
|
|
757
|
+
irrigationRestrictionOn();
|
|
758
|
+
irrigationRestrictionOff();
|
|
759
|
+
}
|
|
754
760
|
addStartTimeSprinkle();
|
|
755
761
|
},1000);
|
|
756
762
|
|
|
@@ -780,6 +786,28 @@ function sunPos() {
|
|
|
780
786
|
}
|
|
781
787
|
}
|
|
782
788
|
|
|
789
|
+
function irrigationRestrictionOn() {
|
|
790
|
+
schedule.cancelJob('irrigationRestrictionOn');
|
|
791
|
+
if (adapter.config.enableTimeBasedRestriction === true) {
|
|
792
|
+
const startOfInterruptionSplit = adapter.config.startOfInterruption.split(':');
|
|
793
|
+
const scheduleStartOfInterruption = schedule.scheduleJob('irrigationRestrictionOn', `${ startOfInterruptionSplit[1] } ${ startOfInterruptionSplit[0] } * * *`, function() {
|
|
794
|
+
irrigationRestriction = true;
|
|
795
|
+
valveControl.timeBasedRestriction(true);
|
|
796
|
+
adapter.log.info(`Time-based irrigation restriction is enabled! (${adapter.config.startOfInterruption} - ${adapter.config.endOfInterruption})`);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function irrigationRestrictionOff() {
|
|
802
|
+
schedule.cancelJob('irrigationRestrictionOff');
|
|
803
|
+
const endOfInterruptionSplit = adapter.config.endOfInterruption.split(':');
|
|
804
|
+
const scheduleEndOfInterruption = schedule.scheduleJob('irrigationRestrictionOff', `${ endOfInterruptionSplit[1] } ${ endOfInterruptionSplit[0] } * * *`, function() {
|
|
805
|
+
irrigationRestriction = false;
|
|
806
|
+
valveControl.timeBasedRestriction(false);
|
|
807
|
+
adapter.log.info('Time-based irrigation restrictions have been disabled!');
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
|
|
783
811
|
function addStartTimeSprinkle() {
|
|
784
812
|
schedule.cancelJob('sprinkleAddStartTime');
|
|
785
813
|
if (adapter.config.selectAddStartTime === 'greaterETpCurrent'
|
|
@@ -827,7 +855,7 @@ function addStartTimeSprinkle() {
|
|
|
827
855
|
case 'bistable': {
|
|
828
856
|
if (res.bistable.bool) {
|
|
829
857
|
messageText += `<b>${res.objectName}</b> (${res.bistable.bool})\n`
|
|
830
|
-
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
858
|
+
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
831
859
|
memAddList.push({
|
|
832
860
|
auto: false,
|
|
833
861
|
sprinkleID: res.sprinkleID,
|
|
@@ -838,7 +866,7 @@ function addStartTimeSprinkle() {
|
|
|
838
866
|
}
|
|
839
867
|
case 'fixDay': {
|
|
840
868
|
messageText += `<b>${res.objectName}</b>\n`
|
|
841
|
-
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
869
|
+
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
842
870
|
memAddList.push({
|
|
843
871
|
auto: false,
|
|
844
872
|
sprinkleID: res.sprinkleID,
|
|
@@ -848,7 +876,7 @@ function addStartTimeSprinkle() {
|
|
|
848
876
|
}
|
|
849
877
|
case 'calculation': {
|
|
850
878
|
messageText += `<b>${res.objectName}</b> ${res.calculation.pct}% (${res.calculation.pctTriggerIrrigation}%)\n`
|
|
851
|
-
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
879
|
+
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
852
880
|
memAddList.push({
|
|
853
881
|
auto: false,
|
|
854
882
|
sprinkleID: res.sprinkleID,
|
|
@@ -859,7 +887,7 @@ function addStartTimeSprinkle() {
|
|
|
859
887
|
case 'analog': {
|
|
860
888
|
if (res.analog.pct < res.analog.pctAddTriggersIrrigation) {
|
|
861
889
|
messageText += `<b>${res.objectName}</b> ${res.analog.pct} %(${res.analog.pctAddTriggersIrrigation}%)\n`
|
|
862
|
-
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
890
|
+
+ ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60 * res.addWateringTime), '')}\n`;
|
|
863
891
|
memAddList.push({
|
|
864
892
|
auto: false,
|
|
865
893
|
sprinkleID: res.sprinkleID,
|
|
@@ -947,7 +975,7 @@ function startTimeSprinkle() {
|
|
|
947
975
|
case 'livingSunrise' : /*Startauswahl = Sonnenaufgang*/
|
|
948
976
|
infoMessage = 'Start mit Sonnenaufgang ';
|
|
949
977
|
// format sunrise time from the Date object
|
|
950
|
-
newStartTime = addTime(sunriseStr, parseInt(adapter.config.timeShift));
|
|
978
|
+
newStartTime = tools.addTime(sunriseStr, parseInt(adapter.config.timeShift));
|
|
951
979
|
break;
|
|
952
980
|
case 'livingGoldenHourEnd' : /*Startauswahl = Ende der Golden Hour*/
|
|
953
981
|
infoMessage = 'Start zum Ende der Golden Hour ';
|
|
@@ -957,7 +985,7 @@ function startTimeSprinkle() {
|
|
|
957
985
|
case 'livingSunset' : /*Startauswahl = Sonnenuntergang*/
|
|
958
986
|
infoMessage = 'Start mit Sonnenuntergang ';
|
|
959
987
|
// format sunset time from the Date object
|
|
960
|
-
newStartTime = addTime(sunsetStr, parseInt(adapter.config.timeShift));
|
|
988
|
+
newStartTime = tools.addTime(sunsetStr, parseInt(adapter.config.timeShift));
|
|
961
989
|
break;
|
|
962
990
|
}
|
|
963
991
|
// Start am Wochenende →, wenn andere Zeiten verwendet werden soll
|
|
@@ -1061,8 +1089,8 @@ const startOfIrrigation = async () => {
|
|
|
1061
1089
|
sprinkleID: res.sprinkleID,
|
|
1062
1090
|
wateringTime: curWateringTime
|
|
1063
1091
|
});
|
|
1064
|
-
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(curWateringTime, '')}\n`;
|
|
1065
|
-
} else if (adapter.config.
|
|
1092
|
+
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(curWateringTime, '')}\n`;
|
|
1093
|
+
} else if (adapter.config.weatherForecastService !== 'noWeatherData') {
|
|
1066
1094
|
/* Bewässerung unterdrückt da ausreichende Regenvorhersage */
|
|
1067
1095
|
messageText += ` <i>Start verschoben, da heute ${weatherForecastTodayNum}mm Niederschlag</i> \n`;
|
|
1068
1096
|
adapter.log.info(`${res.objectName}: Start verschoben, da Regenvorhersage für Heute ${weatherForecastTodayNum} mm [ ${resRain(res.inGreenhouse)} > 0 ]`);
|
|
@@ -1085,8 +1113,8 @@ const startOfIrrigation = async () => {
|
|
|
1085
1113
|
sprinkleID: res.sprinkleID,
|
|
1086
1114
|
wateringTime: Math.round(60* countdown)
|
|
1087
1115
|
});
|
|
1088
|
-
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60*countdown), '')}\n}`;
|
|
1089
|
-
} else if (adapter.config.
|
|
1116
|
+
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60*countdown), '')}\n}`;
|
|
1117
|
+
} else if (adapter.config.weatherForecastService !== 'noWeatherData') {
|
|
1090
1118
|
/* Bewässerung unterdrückt da ausreichende Regenvorhersage */
|
|
1091
1119
|
messageText += ` <i>Start verschoben, da heute ${weatherForecastTodayNum}mm Niederschlag</i> \n`;
|
|
1092
1120
|
adapter.log.info(`${res.objectName}: Start verschoben, da Regenvorhersage für Heute ${weatherForecastTodayNum}mm [ ${resRain(res.inGreenhouse)} > 0 ]`);
|
|
@@ -1106,7 +1134,7 @@ const startOfIrrigation = async () => {
|
|
|
1106
1134
|
sprinkleID: res.sprinkleID,
|
|
1107
1135
|
wateringTime: curWateringTime
|
|
1108
1136
|
});
|
|
1109
|
-
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(curWateringTime, '')}\n`;
|
|
1137
|
+
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(curWateringTime, '')}\n`;
|
|
1110
1138
|
if (res.fixDay.startDay === 'threeRd'){ // Next Start in 3 Tagen
|
|
1111
1139
|
res.fixDay.startFixDay[today] = false;
|
|
1112
1140
|
res.fixDay.startFixDay[(+ today + 3 > 6) ? (+ today-4) : (+ today+3)] = true;
|
|
@@ -1115,7 +1143,7 @@ const startOfIrrigation = async () => {
|
|
|
1115
1143
|
res.fixDay.startFixDay[(+ today + 2 > 6) ? (+ today-5) : (+ today+2)] = true;
|
|
1116
1144
|
}
|
|
1117
1145
|
}
|
|
1118
|
-
} else if (adapter.config.
|
|
1146
|
+
} else if (adapter.config.weatherForecastService !== 'noWeatherData'){
|
|
1119
1147
|
messageText += ` <i>Start verschoben, da heute ${weatherForecastTodayNum}mm Niederschlag</i> \n`;
|
|
1120
1148
|
adapter.log.info(`${res.objectName}: Start verschoben, da Regenvorhersage für Heute ${weatherForecastTodayNum} mm [ ${resRain(res.inGreenhouse)} > 0 ]`);
|
|
1121
1149
|
if ((res.fixDay.startDay === 'threeRd') || (res.fixDay.startDay === 'twoNd')) {
|
|
@@ -1140,7 +1168,7 @@ const startOfIrrigation = async () => {
|
|
|
1140
1168
|
case 'calculation':
|
|
1141
1169
|
if (res.calculation.val <= res.calculation.triggersIrrigation) {
|
|
1142
1170
|
/* Wenn in der Config Regenvorhersage aktiviert: Startvorgang abbrechen, wenn es heute ausreichend regnen sollte. */
|
|
1143
|
-
const resMoisture = (adapter.config.
|
|
1171
|
+
const resMoisture = (adapter.config.weatherForecastService !== 'noWeatherData')?((+ res.calculation.val) + (+ weatherForecastTodayNum) - parseFloat(adapter.config.thresholdRain)):(res.calculation.val); // aktualisierte Bodenfeuchte mit Regenvorhersage
|
|
1144
1172
|
if ((resMoisture <= res.calculation.triggersIrrigation) || res.inGreenhouse) { // Kontrolle ob Regenvorhersage ausreicht || Bewässerung inGreenhouse
|
|
1145
1173
|
let countdown = res.wateringTime * (res.calculation.maxIrrigation - res.calculation.val) / (res.calculation.maxIrrigation - res.calculation.triggersIrrigation); // in min
|
|
1146
1174
|
// Begrenzung der Bewässerungszeit auf dem in der Config eingestellten Überschreitung (in Prozent)
|
|
@@ -1152,8 +1180,8 @@ const startOfIrrigation = async () => {
|
|
|
1152
1180
|
sprinkleID: res.sprinkleID,
|
|
1153
1181
|
wateringTime: Math.round(60*countdown)
|
|
1154
1182
|
});
|
|
1155
|
-
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${addTime(Math.round(60*countdown), '')}\n`;
|
|
1156
|
-
} else if (adapter.config.
|
|
1183
|
+
messageText += ` ${res.extBreak ? 'extBreak ||' : 'START =>'} ${tools.addTime(Math.round(60*countdown), '')}\n`;
|
|
1184
|
+
} else if (adapter.config.weatherForecastService !== 'noWeatherData') {
|
|
1157
1185
|
/* Bewässerung unterdrückt da ausreichende Regenvorhersage */
|
|
1158
1186
|
messageText += ` <i>Start verschoben, da heute ${weatherForecastTodayNum}mm Niederschlag</i> \n`;
|
|
1159
1187
|
adapter.log.info(`${res.objectName}: Start verschoben, da Regenvorhersage für Heute ${weatherForecastTodayNum} mm [ ${res.calculation.val.toFixed(1)} (${resMoisture.toFixed(1)}) <= ${res.calculation.triggersIrrigation} ]`);
|
|
@@ -2151,18 +2179,18 @@ async function main() {
|
|
|
2151
2179
|
await adapter.subscribeStatesAsync('control.Holiday');
|
|
2152
2180
|
//adapter.subscribeStates('info.Elevation');
|
|
2153
2181
|
//adapter.subscribeStates('info.Azimut');
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
}
|
|
2182
|
+
|
|
2183
|
+
if (adapter.config.weatherForecastService === 'ownDataPoint') {
|
|
2184
|
+
weatherForecastTodayPfadStr = adapter.config.pathRainForecast;
|
|
2185
|
+
adapter.subscribeForeignStates(weatherForecastTodayPfadStr);
|
|
2186
|
+
} else if (adapter.config.weatherForecastService === 'dasWetter' && (adapter.config.weatherForInstance.length > 10)) {
|
|
2187
|
+
weatherForecastTodayPfadStr = `${ adapter.config.weatherForInstance }.location_1.ForecastDaily.Day_1.Rain`;
|
|
2188
|
+
adapter.subscribeForeignStates(weatherForecastTodayPfadStr);
|
|
2189
|
+
adapter.subscribeForeignStates(`${ adapter.config.weatherForInstance }.location_1.ForecastDaily.Day_2.Rain`);
|
|
2190
|
+
} else {
|
|
2191
|
+
adapter.log.warn('There is no valid data record stored in the weather forecast, please correct it!');
|
|
2165
2192
|
}
|
|
2193
|
+
|
|
2166
2194
|
// Request a notification from a third-party adapter => Fordern Sie eine Benachrichtigung von einem Drittanbieter-Adapter an
|
|
2167
2195
|
if (adapter.config.publicHolidays === true && (`${ adapter.config.publicHolInstance }.heute.*`)) {
|
|
2168
2196
|
adapter.subscribeForeignStates(`${ adapter.config.publicHolInstance }.heute.*`);
|
|
@@ -2203,6 +2231,20 @@ async function main() {
|
|
|
2203
2231
|
timer = setTimeout(() => {
|
|
2204
2232
|
startTimeSprinkle();
|
|
2205
2233
|
addStartTimeSprinkle();
|
|
2234
|
+
if (adapter.config.enableTimeBasedRestriction === true) {
|
|
2235
|
+
if(tools.laterThanTime(adapter.config.startOfInterruption) === true){ // Bewässerungsverbot wird heute noch aktiviert
|
|
2236
|
+
irrigationRestriction = false
|
|
2237
|
+
irrigationRestrictionOn();
|
|
2238
|
+
irrigationRestrictionOff();
|
|
2239
|
+
} else if (tools.laterThanTime(adapter.config.endOfInterruption) === true){ // Bewässerungsverbot aktiv
|
|
2240
|
+
irrigationRestriction = true;
|
|
2241
|
+
irrigationRestrictionOff();
|
|
2242
|
+
valveControl.timeBasedRestriction(true);
|
|
2243
|
+
adapter.log.info(`Time-based irrigation restriction is enabled! (${adapter.config.startOfInterruption} - ${adapter.config.endOfInterruption})`);
|
|
2244
|
+
} else {
|
|
2245
|
+
irrigationRestriction = false; // Bewässerungsverbot war schon aktiv, wird heute nicht mehr aktiviert
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2206
2248
|
}, 1000);
|
|
2207
2249
|
}
|
|
2208
2250
|
|