iobroker.sprinklecontrol 0.2.9 → 0.2.12
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 +14 -16
- package/admin/index_m.html +115 -37
- package/admin/index_m.js +107 -10
- package/admin/words.js +131 -118
- package/docs/de/img/Extraeinstellungen.jpg +0 -0
- package/io-package.json +63 -69
- package/lib/evaporation.js +9 -2
- package/lib/myConfig.js +96 -36
- package/lib/sendMessageText.js +2 -1
- package/lib/tools.js +1 -1
- package/lib/valveControl.js +9 -1
- package/main.js +365 -128
- package/package.json +14 -14
|
Binary file
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sprinklecontrol",
|
|
4
|
-
"
|
|
4
|
+
"titleLang": {
|
|
5
|
+
"en": "Sprinkle Control",
|
|
6
|
+
"de": "Sprinkle Control",
|
|
7
|
+
"ru": "Управление дождеванием",
|
|
8
|
+
"pt": "Controle de aspersão",
|
|
9
|
+
"nl": "Strooi controle",
|
|
10
|
+
"fr": "Contrôle de l'arrosage",
|
|
11
|
+
"it": "Spruzzare il controllo",
|
|
12
|
+
"es": "Control de aspersión",
|
|
13
|
+
"pl": "Kontrola zraszania",
|
|
14
|
+
"zh-cn": "洒水控制"
|
|
15
|
+
},
|
|
16
|
+
"authors": [
|
|
17
|
+
"Dirk Peter <dirk.peter@freenet.de>"
|
|
18
|
+
],
|
|
19
|
+
"version": "0.2.12",
|
|
5
20
|
"news": {
|
|
21
|
+
"0.2.12": {
|
|
22
|
+
"en": "fixDay(twoNd,threeRd) => postpone by one day; Bug fixed => autoOn; Additional post-watering => in case of high evaporation / switchable externally",
|
|
23
|
+
"de": "fixDay(twoNd,threeRd) => Verschiebung um einen Tag; Bug fix => autoOn; Zusätzliche Nachbewässerung => bei hoher Verdampfung / schaltbar extern",
|
|
24
|
+
"ru": "fixDay(дваNd,триRd) => откладываться на один день; Bug Fixed => autoOn; Дополнительный пост-вода => в случае высокой испарения / переключаемый внешне",
|
|
25
|
+
"pt": "fixDay(twoNd,threeRd) => adiar por um dia; Bug corrigido => autoOn; Post-watering adicional => em caso de alta evaporação / comutável externamente",
|
|
26
|
+
"nl": "fixDay(tweeNd,drieRd) => één dag uitstellen; Bug opgelost => autoAan; Extra nabewatering => bij hoge verdamping / extern schakelbaar",
|
|
27
|
+
"fr": "correctionDay(twoNd, threeRd) = repousser d'un jour; Bug corrigé = vaccin autoOn; Additionnel post-arrosage = clinique en cas d'évaporation élevée / commutable extérieurement",
|
|
28
|
+
"it": "fixDay(twoNd,treRd) => rinviare entro un giorno; Bug fisso => autoOn; Ulteriori post-irrigazione => in caso di alta evaporazione / commutabile esternamente",
|
|
29
|
+
"es": "fixDay(twoNd,threeRd) = confianza posponer por un día; Bug fijo = prenda autoOn; Pos-aguas adicionales = prenda en caso de alta evaporación / conmutable externamente",
|
|
30
|
+
"pl": "fixDay(twoNd, tripleRd) =>. Odroczony przez jeden dzień; Bug fixed => autoOn; dodatkowy post-watering => w przypadku dużego odparowania i przełącznika zewnętrznego",
|
|
31
|
+
"zh-cn": "fix Day(两名Nd,三Rd)=> 一天推迟;Bug固定=汽车;额外的水事后=在高度疏散/外部可转换的情况下。"
|
|
32
|
+
},
|
|
33
|
+
"0.2.11": {
|
|
34
|
+
"en": "Bug fixed => analogue soil moisture sensor with negative characteristic; Attention => maximum soil moisture in rain now in %",
|
|
35
|
+
"de": "Fehler behoben => analoger Bodenfeuchtesensor mit negativer Kennlinie; Achtung => maximale Bodenfeuchte bei Regen jetzt in %",
|
|
36
|
+
"ru": "Исправлена ошибка => аналоговый датчик влажности почвы с отрицательной характеристикой; Внимание => максимальная влажность почвы в дождь теперь в %",
|
|
37
|
+
"pt": "Bug corrigido => sensor analógico de umidade do solo com característica negativa; Atenção => umidade máxima do solo na chuva agora em %",
|
|
38
|
+
"nl": "Bug opgelost => analoge bodemvochtsensor met negatieve karakteristiek; Let op => maximale bodemvochtigheid bij regen nu in %",
|
|
39
|
+
"fr": "Bug corrigé => capteur d'humidité du sol analogique avec caractéristique négative ; Attention => humidité maximale du sol sous la pluie maintenant en %",
|
|
40
|
+
"it": "Bug risolto => sensore di umidità del suolo analogico con caratteristica negativa; Attenzione => umidità massima del suolo sotto la pioggia ora in %",
|
|
41
|
+
"es": "Error solucionado => sensor de humedad del suelo analógico con característica negativa; Atención => humedad máxima del suelo en lluvia ahora en %",
|
|
42
|
+
"pl": "Poprawiony błąd => analogowy czujnik wilgotności gleby o charakterystyce ujemnej; Uwaga => maksymalna wilgotność gleby w deszczu teraz w %",
|
|
43
|
+
"zh-cn": "错误修复 => 具有负特性的模拟土壤湿度传感器;注意 => 现在雨中的最大土壤水分百分比"
|
|
44
|
+
},
|
|
45
|
+
"0.2.10": {
|
|
46
|
+
"en": "- manual watering limited to a maximum of 100%; - Error whatsapp message fixed",
|
|
47
|
+
"de": "- manuelle Bewässerung begrenzt auf maximal 100 %; - Fehler WhatsApp-Nachricht behoben",
|
|
48
|
+
"ru": "- ручной полив ограничен максимум 100%; - Исправлено сообщение об ошибке WhatsApp",
|
|
49
|
+
"pt": "- rega manual limitada a um máximo de 100%; - Mensagem de erro do whatsapp corrigida",
|
|
50
|
+
"nl": "- handmatige bewatering beperkt tot maximaal 100%; - Fout whatsapp-bericht opgelost",
|
|
51
|
+
"fr": "- arrosage manuel limité à 100% maximum ; - Message d'erreur WhatsApp corrigé",
|
|
52
|
+
"it": "- irrigazione manuale limitata ad un massimo del 100%; - Errore messaggio whatsapp risolto",
|
|
53
|
+
"es": "- riego manual limitado a un máximo del 100%; - Mensaje de error de whatsapp arreglado",
|
|
54
|
+
"pl": "- nawadnianie ręczne ograniczone do maksymalnie 100%; - Naprawiono błąd wiadomości WhatsApp",
|
|
55
|
+
"zh-cn": "- 手动浇水限制为最大 100%; - 错误whatsapp消息已修复"
|
|
56
|
+
},
|
|
6
57
|
"0.2.9": {
|
|
7
58
|
"en": "Bug initialization routine",
|
|
8
59
|
"de": "Bug-Initialisierungsroutine",
|
|
@@ -135,18 +186,6 @@
|
|
|
135
186
|
"pl": "Dodano opis w języku angielskim",
|
|
136
187
|
"zh-cn": "添加英文说明"
|
|
137
188
|
},
|
|
138
|
-
"0.1.6": {
|
|
139
|
-
"en": "AutoOn switch added per irrigation circuit, Bug fixed (js-controller), Precipitation counter detached from evaporation",
|
|
140
|
-
"de": "AutoOn-Schalter pro Bewässerungskreis hinzugefügt, Fehler behoben (js-Controller), Niederschlagszähler von der Verdunstung getrennt",
|
|
141
|
-
"ru": "Добавлен переключатель AutoOn для каждого контура орошения, исправлена ошибка (js-контроллер), счетчик осадков отключен от испарения",
|
|
142
|
-
"pt": "Interruptor AutoOn adicionado por circuito de irrigação, bug corrigido (controlador js), contador de precipitação separado da evaporação",
|
|
143
|
-
"nl": "AutoOn-schakelaar toegevoegd per irrigatiecircuit, Bug opgelost (js-controller), Neerslagteller losgekoppeld van verdamping",
|
|
144
|
-
"fr": "Commutateur AutoOn ajouté par circuit d'irrigation, bug corrigé (contrôleur js), compteur de précipitations détaché de l'évaporation",
|
|
145
|
-
"it": "Interruttore AutoOn aggiunto per circuito di irrigazione, Bug risolto (js-controller), Contatore di precipitazioni staccato dall'evaporazione",
|
|
146
|
-
"es": "Interruptor AutoOn agregado por circuito de riego, error corregido (controlador js), contador de precipitación separado de la evaporación",
|
|
147
|
-
"pl": "Dodano przełącznik AutoOn dla każdego obwodu irygacyjnego, naprawiono błąd (kontroler js), licznik opadów odłączony od parowania",
|
|
148
|
-
"zh-cn": "为每个灌溉回路添加了AutoOn开关,已修复错误(js控制器),降水计数器与蒸发分离"
|
|
149
|
-
},
|
|
150
189
|
"0.1.5": {
|
|
151
190
|
"en": "Resetting the amount of rain in 24-hour mode added",
|
|
152
191
|
"de": "Zurücksetzen der Regenmenge im 24-Stunden-Modus hinzugefügt",
|
|
@@ -171,18 +210,6 @@
|
|
|
171
210
|
"pl": "Naprawiono błąd z wyłączoną prognozą pogody",
|
|
172
211
|
"zh-cn": "修复了停用天气预报的错误"
|
|
173
212
|
},
|
|
174
|
-
"0.1.3": {
|
|
175
|
-
"en": "Switching distance built in between the valves, main.js split",
|
|
176
|
-
"de": "Schaltabstand zwischen den Ventilen eingebaut, main.js aufgeteilt",
|
|
177
|
-
"ru": "Расстояние переключения между клапанами, main.js split",
|
|
178
|
-
"pt": "Distância de comutação construída entre as válvulas, divisão main.js",
|
|
179
|
-
"nl": "Schakelafstand ingebouwd tussen de kleppen, main.js split",
|
|
180
|
-
"fr": "Distance de commutation intégrée entre les vannes, main.js split",
|
|
181
|
-
"it": "Distanza di commutazione incorporata tra le valvole, main.js split",
|
|
182
|
-
"es": "Distancia de conmutación integrada entre las válvulas, main.js split",
|
|
183
|
-
"pl": "Odległość przełączania wbudowana między zaworami, podział main.js.",
|
|
184
|
-
"zh-cn": "阀门之间内置的切换距离,main.js已拆分"
|
|
185
|
-
},
|
|
186
213
|
"0.1.2": {
|
|
187
214
|
"en": "Description of SprinkleControl revised",
|
|
188
215
|
"de": "Beschreibung von SprinkleControl überarbeitet",
|
|
@@ -195,18 +222,6 @@
|
|
|
195
222
|
"pl": "Poprawiony opis SprinkleControl",
|
|
196
223
|
"zh-cn": "SprinkleControl的说明已修订"
|
|
197
224
|
},
|
|
198
|
-
"0.1.1": {
|
|
199
|
-
"en": "Integration of messages via telegram, e-mail, pushover and WhatsApp",
|
|
200
|
-
"de": "Integration von Nachrichten per Telegramm, E-Mail, Pushover und WhatsApp",
|
|
201
|
-
"ru": "Интеграция сообщений через Telegram, e-mail, pushover и WhatsApp",
|
|
202
|
-
"pt": "Integração de mensagens via telegrama, e-mail, pushover e WhatsApp",
|
|
203
|
-
"nl": "Integratie van berichten via telegram, e-mail, pushover en WhatsApp",
|
|
204
|
-
"fr": "Intégration de messages via télégramme, e-mail, pushover et WhatsApp",
|
|
205
|
-
"it": "Integrazione di messaggi tramite telegramma, e-mail, pushover e WhatsApp",
|
|
206
|
-
"es": "Integración de mensajes vía telegrama, correo electrónico, pushover y WhatsApp",
|
|
207
|
-
"pl": "Integracja wiadomości przez telegram, e-mail, pushover i WhatsApp",
|
|
208
|
-
"zh-cn": "通过电报,电子邮件,推送和WhatsApp集成消息"
|
|
209
|
-
},
|
|
210
225
|
"0.0.12": {
|
|
211
226
|
"en": "Irrigation via a second pump (cistern with priority control) depending on the level.",
|
|
212
227
|
"de": "Bewässerung über eine zweite Pumpe (Zisterne mit Prioritätsregelung) je nach Füllstand.",
|
|
@@ -218,33 +233,9 @@
|
|
|
218
233
|
"es": "Riego mediante segunda bomba (cisterna con control prioritario) en función del nivel.",
|
|
219
234
|
"pl": "Nawadnianie przez drugą pompę (cysterna z priorytetem sterowania) w zależności od poziomu.",
|
|
220
235
|
"zh-cn": "根据液位,通过第二个泵(带优先控制的水箱)进行灌溉。"
|
|
221
|
-
},
|
|
222
|
-
"0.0.11": {
|
|
223
|
-
"en": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
224
|
-
"de": "Fehler bei der Lösung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
225
|
-
"ru": "Fehler bei der Verarbeitung der Regenvorhersage vom Адаптер \"Das Wetter\"",
|
|
226
|
-
"pt": "Fehler bei der Verarbeitung der Regenvorhersage vom Adaptador \"Das Wetter\"",
|
|
227
|
-
"nl": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
228
|
-
"fr": "Adaptateur pour Fehler bei der Verarbeitung der Regenvorhersage vom \"Das Wetter\"",
|
|
229
|
-
"it": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
230
|
-
"es": "Adaptador \"Das Wetter\" Fehler bei der Verarbeitung der Regenvorhersage vom",
|
|
231
|
-
"pl": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter „Das Wetter”",
|
|
232
|
-
"zh-cn": "Fehler bei der Verarbeitung der Regenvorhersage vom适配器“ Das Wetter”"
|
|
233
236
|
}
|
|
234
237
|
},
|
|
235
|
-
|
|
236
|
-
"titleLang": {
|
|
237
|
-
"en": "Sprinkle Control",
|
|
238
|
-
"de": "Sprinkle Control",
|
|
239
|
-
"ru": "Управление дождеванием",
|
|
240
|
-
"pt": "Controle de aspersão",
|
|
241
|
-
"nl": "Strooi controle",
|
|
242
|
-
"fr": "Contrôle de l'arrosage",
|
|
243
|
-
"it": "Spruzzare il controllo",
|
|
244
|
-
"es": "Control de aspersión",
|
|
245
|
-
"pl": "Kontrola zraszania",
|
|
246
|
-
"zh-cn": "洒水控制"
|
|
247
|
-
},
|
|
238
|
+
|
|
248
239
|
"desc": {
|
|
249
240
|
"en": "Control of several sprinklers depending on weather conditions and pump performance.",
|
|
250
241
|
"de": "Steuerung mehrerer Sprinkler je nach Witterung und Pumpenleistung.",
|
|
@@ -257,15 +248,11 @@
|
|
|
257
248
|
"pl": "Kontrola kilku tryskaczy w zależności od warunków pogodowych i wydajności pompy.",
|
|
258
249
|
"zh-cn": "根据天气条件和泵的性能控制多个喷头。"
|
|
259
250
|
},
|
|
260
|
-
"authors": [
|
|
261
|
-
"Dirk Peter <dirk.peter@freenet.de>"
|
|
262
|
-
],
|
|
263
251
|
"keywords": [
|
|
264
252
|
"Sprinkle",
|
|
265
253
|
"Irrigation",
|
|
266
254
|
"Bewässerung",
|
|
267
|
-
"Steuerung"
|
|
268
|
-
"ioBroker"
|
|
255
|
+
"Steuerung"
|
|
269
256
|
],
|
|
270
257
|
"docs": {
|
|
271
258
|
"en": "docs/en/sprinklecontrol.md",
|
|
@@ -302,11 +289,14 @@
|
|
|
302
289
|
"cisternSettings": false,
|
|
303
290
|
"triggerCisternPump": "",
|
|
304
291
|
"triggerCisternPumpPower": "1800",
|
|
305
|
-
"actualValueLevel": "
|
|
292
|
+
"actualValueLevel": "",
|
|
306
293
|
"triggerMinCisternLevel": "25",
|
|
307
294
|
"wateringStartTime": "livingGoldenHourEnd",
|
|
308
295
|
"timeShift": "0",
|
|
309
296
|
"weekLiving": "06:30",
|
|
297
|
+
"selectAddStartTime": "noAddStartTime",
|
|
298
|
+
"triggerAddStartTimeETpCur": "3.5",
|
|
299
|
+
"addWateringStartTime": "18:00",
|
|
310
300
|
"publicWeekend": true,
|
|
311
301
|
"weekEndLiving": "07:30",
|
|
312
302
|
"publicHolidays": false,
|
|
@@ -319,7 +309,9 @@
|
|
|
319
309
|
"sensorBrightness": "",
|
|
320
310
|
"sensorRainfall": "",
|
|
321
311
|
"weatherForecast": false,
|
|
312
|
+
"weatherForecastService": "dasWetter",
|
|
322
313
|
"weatherForInstance": "",
|
|
314
|
+
"pathRainForecast": "",
|
|
323
315
|
"thresholdRain": "2",
|
|
324
316
|
"notificationEnabled": false,
|
|
325
317
|
"notificationsType": "Telegram",
|
|
@@ -355,8 +347,10 @@
|
|
|
355
347
|
"wateringTime": "10",
|
|
356
348
|
"wateringAdd": "200",
|
|
357
349
|
"wateringInterval": "0",
|
|
350
|
+
"addWateringTime": "0",
|
|
351
|
+
"addTriggersIrrigation": "30",
|
|
358
352
|
"maxSoilMoistureIrrigation": "8",
|
|
359
|
-
"
|
|
353
|
+
"maxSoilMoistureRainPct": "120",
|
|
360
354
|
"triggersIrrigation": "50",
|
|
361
355
|
"pipeFlow": "1100",
|
|
362
356
|
"booster": false,
|
package/lib/evaporation.js
CHANGED
|
@@ -362,13 +362,13 @@ const evaporation = {
|
|
|
362
362
|
},
|
|
363
363
|
/**
|
|
364
364
|
* akt. Regenmengenzähler
|
|
365
|
-
* → Bei einer Änderung über
|
|
365
|
+
* → Bei einer Änderung über 20 mm wird der Wert nur intern gespeichert,
|
|
366
366
|
* es findet aber keine Anwendung statt!
|
|
367
367
|
* @param {number} value current rain counter → aktueller Regencontainer in mm
|
|
368
368
|
*/
|
|
369
369
|
setCurAmountOfRain (value) {
|
|
370
370
|
if ((value > lastRainCounter) // es regnet
|
|
371
|
-
&& ((value - lastRainCounter) <
|
|
371
|
+
&& ((value - lastRainCounter) < 20) // && Plausibilitätskontrolle (Regenmenge unter 10 mm)
|
|
372
372
|
) {
|
|
373
373
|
addEvaporation(lastRainCounter - value);
|
|
374
374
|
}
|
|
@@ -400,6 +400,13 @@ const evaporation = {
|
|
|
400
400
|
*/
|
|
401
401
|
timeExtension (maxExtension) {
|
|
402
402
|
return trend(minExtraTerStr, maxExtraTerStr,1, maxExtension / 100, toDayExtraTerStr);
|
|
403
|
+
},
|
|
404
|
+
/**Output of the current evaporation =>
|
|
405
|
+
* Ausgabe der aktuellen Verdunstung
|
|
406
|
+
* @returns {number}
|
|
407
|
+
*/
|
|
408
|
+
getETpTodayNum () {
|
|
409
|
+
return ETpTodayNum;
|
|
403
410
|
}
|
|
404
411
|
}
|
|
405
412
|
|
package/lib/myConfig.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/*
|
|
4
4
|
info: log aufbau myConfig.js: #1.*
|
|
5
5
|
*/
|
|
6
|
+
const {formatTime} = require("./tools");
|
|
6
7
|
const trend = require('./tools').trend; // tools => laden von Hilfsfunktionen
|
|
7
8
|
// const formatTime = require('./tools').formatTime; // tools => laden von Hilfsfunktionen
|
|
8
9
|
|
|
@@ -21,7 +22,7 @@ let adapter;
|
|
|
21
22
|
* @param {string} res.analogZPct - analog Zero Percent [Auswahlfeld in der Config des Sprinklers > Bodenfeuchte-Sensor > analog > Wert bei 0 %]
|
|
22
23
|
* @param {string} res.analogOHPct - analog One Hundert Percent [Auswahlfeld in der Config des Sprinklers > Bodenfeuchte-Sensor > analog > Wert bei 100 %]
|
|
23
24
|
* @param {string} res.maxSoilMoistureIrrigation - maximale Bodenfeuchte nach der Bewässerung [Auswahlfeld in der Config des Sprinklers]
|
|
24
|
-
* @param {string} res.startDay - Auswahl (threeRd = Start im 3
|
|
25
|
+
* @param {string} res.startDay - Auswahl (threeRd = Start im 3-Tages-Rhythmus,twoNd = Start im 2-Tages-Rhythmus, fixDay = Start an festen Tagen Sun-Sat)
|
|
25
26
|
* @param {boolean} res.sun - Sontag, Sunday (Sun)
|
|
26
27
|
* @param {boolean} res.mon - Montag, Monday (Mon)
|
|
27
28
|
* @param {boolean} res.tue - Dienstag, Tuesday (Tue) (Tues)
|
|
@@ -111,7 +112,18 @@ function getMetConSM(res) {
|
|
|
111
112
|
setBool: null
|
|
112
113
|
};
|
|
113
114
|
} else {
|
|
114
|
-
adapter.log.warn('No irrigation type is selected in the SprinkleControl configuration! Please adjust.');
|
|
115
|
+
adapter.log.warn('Emergency program! No irrigation type is selected in the SprinkleControl configuration! Please adjust.');
|
|
116
|
+
return {
|
|
117
|
+
setStartDay: 'twoNd',
|
|
118
|
+
setStartFixDay: [false, false, false, false, false, false, false], // Sun, Mon, Tue, Wed, Thur, Fri, Sat
|
|
119
|
+
setMetConSM: 'fixDay',
|
|
120
|
+
setTrigSM: '',
|
|
121
|
+
setAnalogZPct: null,
|
|
122
|
+
setAnalogOHPct: null,
|
|
123
|
+
setPct: null,
|
|
124
|
+
setVal: null,
|
|
125
|
+
setBool: null
|
|
126
|
+
};
|
|
115
127
|
}
|
|
116
128
|
}
|
|
117
129
|
|
|
@@ -140,7 +152,8 @@ const myConfig = {
|
|
|
140
152
|
/** Starttage in der Woche
|
|
141
153
|
* - 0(Sun); 1(Mon); 2(Tue); 3(Wed); 4(Thur); 5(Fri); 6(Sat)
|
|
142
154
|
* @type {Array.<boolean>}
|
|
143
|
-
* startFixDay */
|
|
155
|
+
* startFixDay */
|
|
156
|
+
startFixDay: metConSM.setStartFixDay, // Sontag, Sunday (Sun)// Montag, Monday (Mon)// Dienstag, Tuesday (Tue) (Tues)// Mittwoch, Wednesday (Wed)// Donnerstag, Thursday (Thur) (Thurs)// Freitag, Friday (Fri)// Samstag, Saturday (Sat)
|
|
144
157
|
/** - Auswahl:
|
|
145
158
|
* - threeRd = Start im 3 Tages Rhythmus,
|
|
146
159
|
* - twoNd = Start im 2 Tages Rhythmus
|
|
@@ -150,30 +163,32 @@ const myConfig = {
|
|
|
150
163
|
/** @type {boolean} */ booster: res.booster,
|
|
151
164
|
/** @type {number} */ endIrrigation: res.endIrrigation,
|
|
152
165
|
/** @type {boolean} */ autoOn: true,
|
|
153
|
-
/** @type {string} */ autoOnID: adapter.namespace + '.sprinkle.' + objectName + '.autoOn',
|
|
154
|
-
/** @type {string} */ objectName: objectName,
|
|
155
|
-
/** @type {string} */ objectID: adapter.namespace + '.sprinkle.' + objectName + '.runningTime',
|
|
156
|
-
/** @type {string} */ idState: res.name,
|
|
157
|
-
/** @type {any} */ updateStateTimerID: null,
|
|
158
|
-
/** @type {number} */ sprinkleID: myConfig.config.length,
|
|
159
|
-
/** @type {number} */ wateringTime: parseInt(res.wateringTime),
|
|
160
|
-
/** @type {number} */ wateringAdd: parseInt(res.wateringAdd),
|
|
161
|
-
/** @type {number} */ wateringInterval: ((60 * parseInt(res.wateringInterval)) || 0),
|
|
162
|
-
/** @type {number} */
|
|
163
|
-
/** @type {
|
|
164
|
-
/** @type {string} */
|
|
165
|
-
/** @type {
|
|
166
|
-
/** @type {
|
|
167
|
-
/** @type {number} */
|
|
166
|
+
/** @type {string} */ autoOnID: adapter.namespace + '.sprinkle.' + objectName + '.autoOn', // sprinklecontrol.0.sprinkle.Rasenumrandung.autoOnID
|
|
167
|
+
/** @type {string} */ objectName: objectName, // z.B. Rasenumrandung
|
|
168
|
+
/** @type {string} */ objectID: adapter.namespace + '.sprinkle.' + objectName + '.runningTime', // sprinklecontrol.0.sprinkle.Rasenumrandung.runningTime
|
|
169
|
+
/** @type {string} */ idState: res.name, // "hm-rpc.0.MEQ1234567.3.STATE"
|
|
170
|
+
/** @type {any} */ updateStateTimerID: null, // Timer wird gelöscht wenn Rückmeldung erfolgte
|
|
171
|
+
/** @type {number} */ sprinkleID: myConfig.config.length, // Array[0...]
|
|
172
|
+
/** @type {number} */ wateringTime: parseInt(res.wateringTime), // ...min
|
|
173
|
+
/** @type {number} */ wateringAdd: parseInt(res.wateringAdd), // 0 ... 200%
|
|
174
|
+
/** @type {number} */ wateringInterval: ((60 * parseInt(res.wateringInterval)) || 0), // 5,10,15min
|
|
175
|
+
/** @type {number} */ addWateringTime: (parseInt(res.addWateringTime) || 0), // ...min Zusatzbewässerung bei hohen Temperaturen
|
|
176
|
+
/** @type {number} */ pipeFlow: parseInt(res.pipeFlow), // Wasserverbrauch des sprinkler-Kreises
|
|
177
|
+
/** @type {string} */ methodControlSM: metConSM.setMetConSM, // Art der Kontrolle der Bodenfeuchte ('calculation'; 'bistable'; 'analog'; fixDay)
|
|
178
|
+
/** @type {string} */ triggerSM: metConSM.setTrigSM, // Sensor für die Bodenfeuchte
|
|
179
|
+
/** @type {boolean} */ inGreenhouse: res.inGreenhouse || false, // keine Wettervorhersage verwenden (Gewächshaus)
|
|
180
|
+
/** @type {number} */ analogZPct: metConSM.setAnalogZPct, // analoger Sensor Wert bei 0% (analog zero percent)
|
|
181
|
+
/** @type {number} */ analogOHPct: metConSM.setAnalogOHPct, // analoger Sensor Wert bei 100% (analog one hundert percent)
|
|
168
182
|
'soilMoisture': {
|
|
169
|
-
/** @type {number} */ val: metConSM.setVal,
|
|
170
|
-
/** @type {number} */ pct: metConSM.setPct,
|
|
171
|
-
/** @type {boolean} */ bool: metConSM.setBool,
|
|
172
|
-
/** @type {number} */ min: parseFloat(res.maxSoilMoistureIrrigation) / 100,
|
|
173
|
-
/** @type {number} */ maxIrrigation: parseFloat(res.maxSoilMoistureIrrigation),
|
|
174
|
-
/** @type {number} */ maxRain: parseFloat(res.
|
|
175
|
-
/** @type {number} */ triggersIrrigation: parseFloat(res.maxSoilMoistureIrrigation) * parseInt(res.triggersIrrigation) / 100,
|
|
176
|
-
/** @type {number} */ pctTriggerIrrigation: parseFloat(res.triggersIrrigation),
|
|
183
|
+
/** @type {number} */ val: metConSM.setVal, // Bodenfeuchte / Wassergehalt der oberen Bodenschicht (zB. 5 mm == 50%)
|
|
184
|
+
/** @type {number} */ pct: metConSM.setPct, // Bodenfeuchte in % zB. 50% = maxSoilMoistureIrrigation) / 2
|
|
185
|
+
/** @type {boolean} */ bool: metConSM.setBool, // Bodenfeuchtezustand trocken/feucht === true/false
|
|
186
|
+
/** @type {number} */ min: parseFloat(res.maxSoilMoistureIrrigation) / 100, // (zB. 0,02 mm)
|
|
187
|
+
/** @type {number} */ maxIrrigation: parseFloat(res.maxSoilMoistureIrrigation), // (zB. 10 mm)
|
|
188
|
+
/** @type {number} */ maxRain: parseFloat(res.maxSoilMoistureIrrigation) /100 * (parseFloat(/** @type {string} */ res.maxSoilMoistureRainPct) || 120), // (zB. 12 mm)
|
|
189
|
+
/** @type {number} */ triggersIrrigation: parseFloat(res.maxSoilMoistureIrrigation) * parseInt(res.triggersIrrigation) / 100, // (zB. 50 % ==> 5 mm)
|
|
190
|
+
/** @type {number} */ pctTriggerIrrigation: parseFloat(res.triggersIrrigation), // Auslöser der Bewässerung in % (zB. 50%)
|
|
191
|
+
/** @type {number} */ pctAddTriggersIrrigation: (parseFloat(/** @type {string} */ res.addTriggersIrrigation) < parseFloat(res.triggersIrrigation)) ? parseFloat(res.addTriggersIrrigation) : parseFloat(res.triggersIrrigation)
|
|
177
192
|
}
|
|
178
193
|
};
|
|
179
194
|
myConfig.config.push(newEntry);
|
|
@@ -190,7 +205,7 @@ const myConfig = {
|
|
|
190
205
|
},
|
|
191
206
|
/**
|
|
192
207
|
* apply Evaporation
|
|
193
|
-
*
|
|
208
|
+
* → Verdunstung anwenden auf die einzelnen Sprenger kreise
|
|
194
209
|
* @param {number} eTP - pot. Evapotranspiration nach Penman ETp in mm/d
|
|
195
210
|
*/
|
|
196
211
|
applyEvaporation: (eTP) => {
|
|
@@ -257,20 +272,35 @@ const myConfig = {
|
|
|
257
272
|
setSoilMoistPct: (mySprinkleID, newVal) => {
|
|
258
273
|
if (myConfig.config[mySprinkleID].methodControlSM === 'analog') {
|
|
259
274
|
if (typeof parseFloat(newVal) === 'number') {
|
|
275
|
+
/**aktueller Wert des Bodenfeuchte-Sensor
|
|
276
|
+
* @type {number} myVal
|
|
277
|
+
*/
|
|
260
278
|
let myVal;
|
|
279
|
+
/**Reversible Eingang des Bodenfeuchte sensors
|
|
280
|
+
* @type {boolean} reverse -Eingang analogOHPct < analogZPct
|
|
281
|
+
*
|
|
282
|
+
*/
|
|
283
|
+
const reverse = (myConfig.config[mySprinkleID].analogOHPct < myConfig.config[mySprinkleID].analogZPct);
|
|
284
|
+
if (myConfig.config[mySprinkleID].analogOHPct === myConfig.config[mySprinkleID].analogZPct) {
|
|
285
|
+
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 0% and at 100% => the values are the same`);
|
|
286
|
+
}
|
|
261
287
|
newVal = parseFloat(newVal);
|
|
262
|
-
|
|
288
|
+
|
|
289
|
+
if ((!reverse && newVal < myConfig.config[mySprinkleID].analogZPct)
|
|
290
|
+
|| (reverse && myConfig.config[mySprinkleID].analogZPct < newVal)) {
|
|
263
291
|
myVal = myConfig.config[mySprinkleID].analogZPct;
|
|
264
|
-
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 0 % => The value range was undercut`);
|
|
265
|
-
} else if (newVal > myConfig.config[mySprinkleID].analogOHPct)
|
|
292
|
+
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName} (${newVal}): analog soil moisture sensor at 0 % => ${reverse ? "The range of values has been exceeded (reverse)" : "The value range was undercut"}`);
|
|
293
|
+
} else if ((!reverse && newVal > myConfig.config[mySprinkleID].analogOHPct)
|
|
294
|
+
|| (reverse && myConfig.config[mySprinkleID].analogOHPct > newVal)) {
|
|
266
295
|
myVal = myConfig.config[mySprinkleID].analogOHPct;
|
|
267
|
-
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 100 % => The range of values has been exceeded`);
|
|
296
|
+
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName} (${newVal}): analog soil moisture sensor at 100 % => ${reverse ? "The value range was undercut (reverse)" : "The range of values has been exceeded"}`);
|
|
268
297
|
} else {
|
|
269
298
|
myVal = newVal;
|
|
270
299
|
}
|
|
271
|
-
|
|
300
|
+
|
|
301
|
+
myConfig.config[mySprinkleID].soilMoisture.pct = Math.round(10 * trend(myConfig.config[mySprinkleID].analogZPct, myConfig.config[mySprinkleID].analogOHPct, 0, 100, myVal)) / 10;
|
|
272
302
|
adapter.setState('sprinkle.' + [myConfig.config[mySprinkleID].objectName] + '.actualSoilMoisture', {
|
|
273
|
-
val:
|
|
303
|
+
val: myConfig.config[mySprinkleID].soilMoisture.pct,
|
|
274
304
|
ack: true
|
|
275
305
|
});
|
|
276
306
|
} else {
|
|
@@ -281,19 +311,49 @@ const myConfig = {
|
|
|
281
311
|
}
|
|
282
312
|
},
|
|
283
313
|
/**
|
|
284
|
-
* Bodenfeuchte (soilMoisture) erhöhen bis
|
|
314
|
+
* Bodenfeuchte (soilMoisture) erhöhen bis maxIrrigation (100%)
|
|
285
315
|
* @param {number} mySprinkleID - ID des Bewässerungskreis
|
|
286
316
|
* @param {number} addVal - soilMoisture.val wird um den Wert addVal erhöht
|
|
287
317
|
*/
|
|
288
318
|
addSoilMoistVal: (mySprinkleID, addVal) => {
|
|
289
|
-
myConfig.config[mySprinkleID].soilMoisture.val
|
|
290
|
-
|
|
319
|
+
if (myConfig.config[mySprinkleID].soilMoisture.val < myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) {
|
|
320
|
+
myConfig.config[mySprinkleID].soilMoisture.val += addVal;
|
|
321
|
+
if (myConfig.config[mySprinkleID].soilMoisture.val > myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) {
|
|
322
|
+
myConfig.config[mySprinkleID].soilMoisture.val = myConfig.config[mySprinkleID].soilMoisture.maxIrrigation;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
291
326
|
myConfig.config[mySprinkleID].soilMoisture.pct = Math.round(1000 * myConfig.config[mySprinkleID].soilMoisture.val
|
|
292
327
|
/ myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) / 10; // Berechnung in %
|
|
293
328
|
adapter.setState('sprinkle.' + myConfig.config[mySprinkleID].objectName + '.actualSoilMoisture', {
|
|
294
329
|
val: myConfig.config[mySprinkleID].soilMoisture.pct,
|
|
295
330
|
ack: true
|
|
296
331
|
});
|
|
332
|
+
},
|
|
333
|
+
postponeByOneDay: async (mySprinkleID) => {
|
|
334
|
+
if (myConfig.config[mySprinkleID].startDay === 'threeRd' || // Next Start in 3 Tagen
|
|
335
|
+
myConfig.config[mySprinkleID].startDay === 'twoNd') { // Next Start in 2 Tagen
|
|
336
|
+
let today = await formatTime(adapter,'', 'day');
|
|
337
|
+
let id = `${adapter.namespace}.sprinkle.${myConfig.config[mySprinkleID].objectName}.actualSoilMoisture`;
|
|
338
|
+
let curDay, nextDay;
|
|
339
|
+
/**
|
|
340
|
+
* Wert von actualSoilMoisture auslesen
|
|
341
|
+
* @type {ioBroker.State | void}
|
|
342
|
+
* @private
|
|
343
|
+
*/
|
|
344
|
+
const _curDay = await adapter.getStateAsync(id).catch((e) => adapter.log.warn(`postponeByOneDay getStateAsync: ${e}`));
|
|
345
|
+
if (_curDay) {
|
|
346
|
+
curDay = ((_curDay.val >= 0) && (_curDay.val <= 6) && (typeof _curDay.val === 'number') ? _curDay.val : today);
|
|
347
|
+
myConfig.config[mySprinkleID].startFixDay[curDay] = false;
|
|
348
|
+
nextDay = (+ curDay + 1 > 6) ? (+ curDay-6) : (+ curDay+1);
|
|
349
|
+
myConfig.config[mySprinkleID].startFixDay[nextDay] = true;
|
|
350
|
+
adapter.setStateAsync(
|
|
351
|
+
`${id}`,
|
|
352
|
+
nextDay,
|
|
353
|
+
true
|
|
354
|
+
).catch((e) => adapter.log.warn(`postponeByOneDay setStateAsync: ${e}`));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
297
357
|
}
|
|
298
358
|
};
|
|
299
359
|
|
package/lib/sendMessageText.js
CHANGED
|
@@ -51,7 +51,7 @@ const sendMessageText = {
|
|
|
51
51
|
/** @type {string} */ emailReceiver: adapter.config.emailReceiver,
|
|
52
52
|
/** @type {string} */ emailSender: adapter.config.emailSender,
|
|
53
53
|
/** @type {boolean} */ onlyError: adapter.config.emailOnlyError,
|
|
54
|
-
/** @type {number} */ waiting: parseInt(adapter.config.emailWaitToSend) * 1000
|
|
54
|
+
/** @type {number} */ waiting: (parseInt(adapter.config.emailWaitToSend) * 1000) || 0
|
|
55
55
|
};
|
|
56
56
|
break;
|
|
57
57
|
|
|
@@ -172,6 +172,7 @@ const sendMessageText = {
|
|
|
172
172
|
ObjMessage.instance !== null &&
|
|
173
173
|
ObjMessage.instance !== undefined) {
|
|
174
174
|
sendMessage = '<b><u>SprinkleControl:</u></b>\n' + sendMessage;
|
|
175
|
+
sendMessage = sendMessage.replace(/\n/g,'%0A'); // Zeilenumbruch
|
|
175
176
|
sendMessage = sendMessage.replace(/<b>|<\/b>/g, '*'); // Fett Bold
|
|
176
177
|
sendMessage = sendMessage.replace(/<i>|<\/i>/g, '_'); // kursive Italic
|
|
177
178
|
sendMessage = sendMessage.replace(/<u>|<\/u>/g, ''); // unterstrichen
|
package/lib/tools.js
CHANGED
|
@@ -45,7 +45,7 @@ function addTime(time1, time2){
|
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* func Format Time
|
|
48
|
-
*
|
|
48
|
+
* → hier wird der übergebene Zeitstempel, myDate, in das angegebene Format, timeFormat, umgewandelt.
|
|
49
49
|
* Ist myDate nicht angegeben, so wird die aktuelle Zeit verwendet.
|
|
50
50
|
* @param {ioBroker.Adapter} adapter
|
|
51
51
|
* @param {date|any} myDate
|
package/lib/valveControl.js
CHANGED
|
@@ -822,6 +822,8 @@ const valveControl = {
|
|
|
822
822
|
* => Beim Beenden des adapters alles ausschalten
|
|
823
823
|
*/
|
|
824
824
|
clearEntireList () {
|
|
825
|
+
setVoltageOnOff(false);
|
|
826
|
+
setPumpOnOff(false);
|
|
825
827
|
if (boostListTimer) {
|
|
826
828
|
clearTimeout(boostListTimer);
|
|
827
829
|
}
|
|
@@ -830,6 +832,12 @@ const valveControl = {
|
|
|
830
832
|
counter >= 0;
|
|
831
833
|
counter--) {
|
|
832
834
|
const entry = threadList[counter];
|
|
835
|
+
if (entry.enabledState) {
|
|
836
|
+
adapter.setForeignState(entry.idState, {
|
|
837
|
+
val: false,
|
|
838
|
+
ack: true
|
|
839
|
+
});
|
|
840
|
+
}
|
|
833
841
|
/* Zustand des Ventils im Thread <<< 0 >>> off, < 1 > wait, < 2 > on, < 3 > break, < 4 > Boost(on), < 5 > off(Boost) */
|
|
834
842
|
adapter.setState('sprinkle.' + entry.sprinkleName + '.sprinklerState', {
|
|
835
843
|
val: 0,
|
|
@@ -860,7 +868,7 @@ const valveControl = {
|
|
|
860
868
|
clearTimeout(entry.times.boostTime2);
|
|
861
869
|
entry.times.boostTime2 = null;
|
|
862
870
|
}
|
|
863
|
-
threadList.pop();
|
|
871
|
+
threadList.pop(); // del last array
|
|
864
872
|
adapter.log.debug(`order deleted Stop all ID: ${entry.sprinkleName} ( rest orders: ${threadList.length} )`);
|
|
865
873
|
}
|
|
866
874
|
updateList();
|