iobroker.sprinklecontrol 0.2.10 → 0.2.11
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 -0
- package/admin/index_m.html +4 -4
- package/admin/index_m.js +4 -4
- package/admin/words.js +1 -1
- package/io-package.json +14 -14
- package/lib/evaporation.js +2 -2
- package/lib/myConfig.js +51 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,10 @@ Wetterabhängige automatische Steuerung der Gartenbewässerung
|
|
|
34
34
|
Placeholder for the next version (at the beginning of the line):
|
|
35
35
|
### **WORK IN PROGRESS**
|
|
36
36
|
-->
|
|
37
|
+
### 0.2.11 (2022-05-22)
|
|
38
|
+
* (Dirk-Peter-md) Bug fixed => analog soil moisture sensor with negative characteristic
|
|
39
|
+
* (Dirk-Peter-md) Attention => maximum soil moisture in rain now in %
|
|
40
|
+
|
|
37
41
|
### 0.2.10 (2022-05-15)
|
|
38
42
|
* (Dirk-Peter-md) manual watering limited to a maximum of 100%
|
|
39
43
|
* (Dirk-Peter-md) Error whatsapp message fixed
|
package/admin/index_m.html
CHANGED
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
<th data-name="wateringAdd" id="events_col_7" data-type="number" style="width: 0" class="translate"></th>
|
|
82
82
|
<th data-name="wateringInterval" id="events_col_8" data-type="number" style="width: 0" class="translate"></th>
|
|
83
83
|
<th data-name="maxSoilMoistureIrrigation" id="events_col_9" data-type="number" style="width: 0" class="translate"></th>
|
|
84
|
-
<th data-name="
|
|
84
|
+
<th data-name="maxSoilMoistureRainPct" id="events_col_10" data-type="number" style="width: 0" class="translate"></th>
|
|
85
85
|
<th data-name="triggersIrrigation" id="events_col_11" data-type="number" style="width: 0" class="translate"></th>
|
|
86
86
|
<th data-name="pipeFlow" id="events_col_12" data-type="number" style="width: 0" class="translate"></th>
|
|
87
87
|
<th data-name="booster" id="events_col_13" data-type="checkbox" style="width: 0" class="translate"></th>
|
|
@@ -733,9 +733,9 @@
|
|
|
733
733
|
<span class="translate">maximum soil moisture after the irrigation in (mm)</span>
|
|
734
734
|
</div>
|
|
735
735
|
<div class="col s12 l4 input-field">
|
|
736
|
-
<input type="number" class="form-control" id="
|
|
737
|
-
<label for="
|
|
738
|
-
<span class="translate">maximum soil moisture after the rain in (
|
|
736
|
+
<input type="number" class="form-control" id="maxSoilMoistureRainPct" min="100" max="200" placeholder="100-200" step="1" />
|
|
737
|
+
<label for="maxSoilMoistureRainPct" class="translate"></label>
|
|
738
|
+
<span class="translate">maximum soil moisture after the rain in (%)</span>
|
|
739
739
|
</div>
|
|
740
740
|
</div>
|
|
741
741
|
</div>
|
package/admin/index_m.js
CHANGED
|
@@ -59,7 +59,7 @@ function load(settings, onChange) {
|
|
|
59
59
|
$('#events .values-input[data-name="wateringAdd"][data-index="' + id + '"]').val('200').trigger('change');
|
|
60
60
|
$('#events .values-input[data-name="wateringInterval"][data-index="' + id + '"]').val('0').trigger('change');
|
|
61
61
|
$('#events .values-input[data-name="maxSoilMoistureIrrigation"][data-index="' + id + '"]').val('8').trigger('change');
|
|
62
|
-
$('#events .values-input[data-name="
|
|
62
|
+
$('#events .values-input[data-name="maxSoilMoistureRainPct"][data-index="' + id + '"]').val('120').trigger('change');
|
|
63
63
|
$('#events .values-input[data-name="triggersIrrigation"][data-index="' + id + '"]').val('50').trigger('change');
|
|
64
64
|
$('#events .values-input[data-name="pipeFlow"][data-index="' + id + '"]').val('700').trigger('change');
|
|
65
65
|
$('#events .values-input[data-name="methodControlSM"][data-index="' + id + '"]').val('calculation').trigger('change');
|
|
@@ -331,7 +331,7 @@ function tableOnReady() {
|
|
|
331
331
|
$('#wateringAdd').val($('#events .values-input[data-name="wateringAdd"][data-index="' + id + '"]').val());
|
|
332
332
|
$('#wateringInterval').val($('#events .values-input[data-name="wateringInterval"][data-index="' + id + '"]').val());
|
|
333
333
|
$('#maxSoilMoistureIrrigation').val($('#events .values-input[data-name="maxSoilMoistureIrrigation"][data-index="' + id + '"]').val());
|
|
334
|
-
$('#
|
|
334
|
+
$('#maxSoilMoistureRainPct').val($('#events .values-input[data-name="maxSoilMoistureRainPct"][data-index="' + id + '"]').val());
|
|
335
335
|
$('#triggersIrrigation').val($('#events .values-input[data-name="triggersIrrigation"][data-index="' + id + '"]').val());
|
|
336
336
|
$('#pipeFlow').val($('#events .values-input[data-name="pipeFlow"][data-index="' + id + '"]').val());
|
|
337
337
|
$('#methodControlSM').val($('#events .values-input[data-name="methodControlSM"][data-index="' + id + '"]').val());
|
|
@@ -362,7 +362,7 @@ function tableOnReady() {
|
|
|
362
362
|
let newWateringAdd = $('#wateringAdd').val();
|
|
363
363
|
let newWateringInterval = $('#wateringInterval').val();
|
|
364
364
|
let newMaxSoilMoistureIrrigation = $('#maxSoilMoistureIrrigation').val();
|
|
365
|
-
let
|
|
365
|
+
let newMaxSoilMoistureRainPct = $('#maxSoilMoistureRainPct').val();
|
|
366
366
|
let newTriggersIrrigation = $('#triggersIrrigation').val();
|
|
367
367
|
let newPipeFlow = $('#pipeFlow').val();
|
|
368
368
|
let newMethodControlSM = $('#methodControlSM').val();
|
|
@@ -387,7 +387,7 @@ function tableOnReady() {
|
|
|
387
387
|
$('#events .values-input[data-name="wateringAdd"][data-index="' + id + '"]').val(newWateringAdd).trigger('change');
|
|
388
388
|
$('#events .values-input[data-name="wateringInterval"][data-index="' + id + '"]').val(newWateringInterval).trigger('change');
|
|
389
389
|
$('#events .values-input[data-name="maxSoilMoistureIrrigation"][data-index="' + id + '"]').val(newMaxSoilMoistureIrrigation).trigger('change');
|
|
390
|
-
$('#events .values-input[data-name="
|
|
390
|
+
$('#events .values-input[data-name="maxSoilMoistureRainPct"][data-index="' + id + '"]').val(newMaxSoilMoistureRainPct).trigger('change');
|
|
391
391
|
$('#events .values-input[data-name="triggersIrrigation"][data-index="' + id + '"]').val(newTriggersIrrigation).trigger('change');
|
|
392
392
|
$('#events .values-input[data-name="pipeFlow"][data-index="' + id + '"]').val(newPipeFlow).trigger('change');
|
|
393
393
|
$('#events .values-input[data-name="methodControlSM"][data-index="' + id + '"]').val(newMethodControlSM).trigger('change');
|
package/admin/words.js
CHANGED
|
@@ -77,7 +77,7 @@ systemDictionary = {
|
|
|
77
77
|
'after irrigation = 100': {'en': 'Soil moisture = 100% after irrigation', 'de': 'Bodenfeuchtigkeit = 100% nach Bewässerung', 'ru': 'Влажность почвы = 100% после полива', 'pt': 'Umidade do solo = 100% após a irrigação', 'nl': 'Bodemvocht = 100% na irrigatie', 'fr': 'Humidité du sol = 100% après irrigation', 'it': "Umidità del suolo = 100% dopo l'irrigazione", 'es': 'Humedad del suelo = 100% después del riego.', 'pl': 'Wilgotność gleby = 100% po nawadnianiu', 'zh-cn': '灌溉后土壤水分= 100%'},
|
|
78
78
|
'maximum soil moisture': {'en': 'maximum soil moisture', 'de': 'maximale Bodenfeuchtigkeit', 'ru': 'максимальная влажность почвы', 'pt': 'umidade máxima do solo', 'nl': 'maximale bodemvochtigheid', 'fr': 'humidité maximale du sol', 'it': 'umidità massima del suolo', 'es': 'humedad máxima del suelo', 'pl': 'maksymalna wilgotność gleby', 'zh-cn': '最大土壤水分'},
|
|
79
79
|
'maximum soil moisture after the irrigation in (mm)': {'en': 'maximum soil moisture after the irrigation in (mm)', 'de': 'maximale Bodenfeuchtigkeit nach der Bewässerung in (mm)', 'ru': 'максимальная влажность почвы после полива в (мм)', 'pt': 'umidade máxima do solo após a irrigação em (mm)', 'nl': 'maximale bodemvochtigheid na de beregening in (mm)', 'fr': "humidité maximale du sol après l'irrigation en (mm)", 'it': "umidità massima del suolo dopo l'irrigazione in (mm)", 'es': 'humedad máxima del suelo después del riego en (mm)', 'pl': 'maksymalna wilgotność gleby po nawadnianiu w (mm)', 'zh-cn': '灌溉后的最大土壤湿度(毫米)'},
|
|
80
|
-
'maximum soil moisture after the rain in (
|
|
80
|
+
'maximum soil moisture after the rain in (%)': {'en': 'maximum soil moisture after the rain in (%)', 'de': 'maximale Bodenfeuchtigkeit nach dem Regen in (%)', 'ru': 'максимальная влажность почвы после дождя в (%)', 'pt': 'umidade máxima do solo após a chuva em (%)', 'nl': 'maximale bodemvochtigheid na regen in (%)', 'fr': 'humidité maximale du sol après la pluie en (%)', 'it': 'umidità massima del suolo dopo la pioggia in (%)', 'es': 'humedad máxima del suelo después de la lluvia en (%)', 'pl': 'maksymalna wilgotność gleby po deszczu w (%)', 'zh-cn': '雨后的最大土壤水分(%)'},
|
|
81
81
|
'Configuration of the analog soil moisture sensor': {'en': 'Configuration of the analog soil moisture sensor', 'de': 'Konfiguration des analogen Bodenfeuchtesensors', 'ru': 'Конфигурация аналогового датчика влажности почвы', 'pt': 'Configuração do sensor analógico de umidade do solo', 'nl': 'Configuratie van de analoge bodemvochtsensor', 'fr': "Configuration du capteur analogique d'humidité du sol", 'it': 'Configurazione del sensore di umidità del suolo analogico', 'es': 'Configuración del sensor de humedad del suelo analógico', 'pl': 'Konfiguracja analogowego czujnika wilgotności gleby', 'zh-cn': '模拟土壤湿度传感器的配置'},
|
|
82
82
|
'analog soil moisture sensor at 0 percent (sensor in the air)': {'en': 'analog soil moisture sensor at 0 percent (sensor in the air)', 'de': 'analoger Bodenfeuchtesensor bei 0 Prozent (Sensor in der Luft)', 'ru': 'аналоговый датчик влажности почвы на 0 процентов (датчик в воздухе)', 'pt': 'sensor analógico de umidade do solo a 0 por cento (sensor no ar)', 'nl': 'analoge bodemvochtsensor op 0 procent (sensor in de lucht)', 'fr': "capteur analogique d'humidité du sol à 0 pour cent (capteur dans l'air)", 'it': "sensore di umidità del suolo analogico a 0 percento (sensore nell'aria)", 'es': 'sensor de humedad del suelo analógico al 0 por ciento (sensor en el aire)', 'pl': 'analogowy czujnik wilgotności gleby na 0 procent (czujnik w powietrzu)', 'zh-cn': '0% 时的模拟土壤湿度传感器(空气中的传感器)'},
|
|
83
83
|
'analog soil moisture sensor at 100 percent (sensor in the water)': {'en': 'analog soil moisture sensor at 100 percent (sensor in the water)', 'de': 'analoger Bodenfeuchtesensor bei 100 Prozent (Sensor im Wasser)', 'ru': 'аналоговый датчик влажности почвы на 100 процентов (датчик в воде)', 'pt': 'sensor analógico de umidade do solo a 100 por cento (sensor na água)', 'nl': 'analoge bodemvochtsensor op 100 procent (sensor in het water)', 'fr': "capteur analogique d'humidité du sol à 100 pour cent (capteur dans l'eau)", 'it': "sensore di umidità del suolo analogico al 100% (sensore nell'acqua)", 'es': 'sensor de humedad del suelo analógico al 100 por ciento (sensor en el agua)','pl': 'analogowy czujnik wilgotności gleby na 100 procent (czujnik w wodzie)', 'zh-cn': '100% 模拟土壤湿度传感器(传感器在水中)'},
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sprinklecontrol",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.2.11": {
|
|
7
|
+
"en": "Bug fixed => analogue soil moisture sensor with negative characteristic; Attention => maximum soil moisture in rain now in %",
|
|
8
|
+
"de": "Fehler behoben => analoger Bodenfeuchtesensor mit negativer Kennlinie; Achtung => maximale Bodenfeuchte bei Regen jetzt in %",
|
|
9
|
+
"ru": "Исправлена ошибка => аналоговый датчик влажности почвы с отрицательной характеристикой; Внимание => максимальная влажность почвы в дождь теперь в %",
|
|
10
|
+
"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 %",
|
|
11
|
+
"nl": "Bug opgelost => analoge bodemvochtsensor met negatieve karakteristiek; Let op => maximale bodemvochtigheid bij regen nu in %",
|
|
12
|
+
"fr": "Bug corrigé => capteur d'humidité du sol analogique avec caractéristique négative ; Attention => humidité maximale du sol sous la pluie maintenant en %",
|
|
13
|
+
"it": "Bug risolto => sensore di umidità del suolo analogico con caratteristica negativa; Attenzione => umidità massima del suolo sotto la pioggia ora in %",
|
|
14
|
+
"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 %",
|
|
15
|
+
"pl": "Poprawiony błąd => analogowy czujnik wilgotności gleby o charakterystyce ujemnej; Uwaga => maksymalna wilgotność gleby w deszczu teraz w %",
|
|
16
|
+
"zh-cn": "错误修复 => 具有负特性的模拟土壤湿度传感器;注意 => 现在雨中的最大土壤水分百分比"
|
|
17
|
+
},
|
|
6
18
|
"0.2.10": {
|
|
7
19
|
"en": "- manual watering limited to a maximum of 100%; - Error whatsapp message fixed",
|
|
8
20
|
"de": "- manuelle Bewässerung begrenzt auf maximal 100 %; - Fehler WhatsApp-Nachricht behoben",
|
|
@@ -230,18 +242,6 @@
|
|
|
230
242
|
"es": "Riego mediante segunda bomba (cisterna con control prioritario) en función del nivel.",
|
|
231
243
|
"pl": "Nawadnianie przez drugą pompę (cysterna z priorytetem sterowania) w zależności od poziomu.",
|
|
232
244
|
"zh-cn": "根据液位,通过第二个泵(带优先控制的水箱)进行灌溉。"
|
|
233
|
-
},
|
|
234
|
-
"0.0.11": {
|
|
235
|
-
"en": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
236
|
-
"de": "Fehler bei der Lösung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
237
|
-
"ru": "Fehler bei der Verarbeitung der Regenvorhersage vom Адаптер \"Das Wetter\"",
|
|
238
|
-
"pt": "Fehler bei der Verarbeitung der Regenvorhersage vom Adaptador \"Das Wetter\"",
|
|
239
|
-
"nl": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
240
|
-
"fr": "Adaptateur pour Fehler bei der Verarbeitung der Regenvorhersage vom \"Das Wetter\"",
|
|
241
|
-
"it": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter \"Das Wetter\"",
|
|
242
|
-
"es": "Adaptador \"Das Wetter\" Fehler bei der Verarbeitung der Regenvorhersage vom",
|
|
243
|
-
"pl": "Fehler bei der Verarbeitung der Regenvorhersage vom Adapter „Das Wetter”",
|
|
244
|
-
"zh-cn": "Fehler bei der Verarbeitung der Regenvorhersage vom适配器“ Das Wetter”"
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
247
|
"title": "Sprinkle Control",
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
"wateringAdd": "200",
|
|
369
369
|
"wateringInterval": "0",
|
|
370
370
|
"maxSoilMoistureIrrigation": "8",
|
|
371
|
-
"
|
|
371
|
+
"maxSoilMoistureRainPct": "120",
|
|
372
372
|
"triggersIrrigation": "50",
|
|
373
373
|
"pipeFlow": "1100",
|
|
374
374
|
"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
|
}
|
package/lib/myConfig.js
CHANGED
|
@@ -162,30 +162,30 @@ const myConfig = {
|
|
|
162
162
|
/** @type {boolean} */ booster: res.booster,
|
|
163
163
|
/** @type {number} */ endIrrigation: res.endIrrigation,
|
|
164
164
|
/** @type {boolean} */ autoOn: true,
|
|
165
|
-
/** @type {string} */ autoOnID: adapter.namespace + '.sprinkle.' + objectName + '.autoOn',
|
|
166
|
-
/** @type {string} */ objectName: objectName,
|
|
167
|
-
/** @type {string} */ objectID: adapter.namespace + '.sprinkle.' + objectName + '.runningTime',
|
|
168
|
-
/** @type {string} */ idState: res.name,
|
|
169
|
-
/** @type {any} */ updateStateTimerID: null,
|
|
170
|
-
/** @type {number} */ sprinkleID: myConfig.config.length,
|
|
171
|
-
/** @type {number} */ wateringTime: parseInt(res.wateringTime),
|
|
172
|
-
/** @type {number} */ wateringAdd: parseInt(res.wateringAdd),
|
|
173
|
-
/** @type {number} */ wateringInterval: ((60 * parseInt(res.wateringInterval)) || 0),
|
|
174
|
-
/** @type {number} */ pipeFlow: parseInt(res.pipeFlow),
|
|
175
|
-
/** @type {string} */ methodControlSM: metConSM.setMetConSM,
|
|
176
|
-
/** @type {string} */ triggerSM: metConSM.setTrigSM,
|
|
177
|
-
/** @type {boolean} */ inGreenhouse: res.inGreenhouse || false,
|
|
178
|
-
/** @type {number} */ analogZPct: metConSM.setAnalogZPct,
|
|
179
|
-
/** @type {number} */ analogOHPct: metConSM.setAnalogOHPct,
|
|
165
|
+
/** @type {string} */ autoOnID: adapter.namespace + '.sprinkle.' + objectName + '.autoOn', // sprinklecontrol.0.sprinkle.Rasenumrandung.autoOnID
|
|
166
|
+
/** @type {string} */ objectName: objectName, // z.B. Rasenumrandung
|
|
167
|
+
/** @type {string} */ objectID: adapter.namespace + '.sprinkle.' + objectName + '.runningTime', // sprinklecontrol.0.sprinkle.Rasenumrandung.runningTime
|
|
168
|
+
/** @type {string} */ idState: res.name, // "hm-rpc.0.MEQ1234567.3.STATE"
|
|
169
|
+
/** @type {any} */ updateStateTimerID: null, // Timer wird gelöscht wenn Rückmeldung erfolgte
|
|
170
|
+
/** @type {number} */ sprinkleID: myConfig.config.length, // Array[0...]
|
|
171
|
+
/** @type {number} */ wateringTime: parseInt(res.wateringTime), // ...min
|
|
172
|
+
/** @type {number} */ wateringAdd: parseInt(res.wateringAdd), // 0 ... 200%
|
|
173
|
+
/** @type {number} */ wateringInterval: ((60 * parseInt(res.wateringInterval)) || 0), // 5,10,15min
|
|
174
|
+
/** @type {number} */ pipeFlow: parseInt(res.pipeFlow), // Wasserverbrauch des sprinkler-Kreises
|
|
175
|
+
/** @type {string} */ methodControlSM: metConSM.setMetConSM, // Art der Kontrolle der Bodenfeuchte ('calculation'; 'bistable'; 'analog'; fixDay)
|
|
176
|
+
/** @type {string} */ triggerSM: metConSM.setTrigSM, // Sensor für die Bodenfeuchte
|
|
177
|
+
/** @type {boolean} */ inGreenhouse: res.inGreenhouse || false, // keine Wettervorhersage verwenden (Gewächshaus)
|
|
178
|
+
/** @type {number} */ analogZPct: metConSM.setAnalogZPct, // analoger Sensor Wert bei 0% (analog zero percent)
|
|
179
|
+
/** @type {number} */ analogOHPct: metConSM.setAnalogOHPct, // analoger Sensor Wert bei 100% (analog one hundert percent)
|
|
180
180
|
'soilMoisture': {
|
|
181
|
-
/** @type {number} */ val: metConSM.setVal,
|
|
182
|
-
/** @type {number} */ pct: metConSM.setPct,
|
|
183
|
-
/** @type {boolean} */ bool: metConSM.setBool,
|
|
184
|
-
/** @type {number} */ min: parseFloat(res.maxSoilMoistureIrrigation) / 100,
|
|
185
|
-
/** @type {number} */ maxIrrigation: parseFloat(res.maxSoilMoistureIrrigation),
|
|
186
|
-
/** @type {number} */ maxRain: parseFloat(res.
|
|
187
|
-
/** @type {number} */ triggersIrrigation: parseFloat(res.maxSoilMoistureIrrigation) * parseInt(res.triggersIrrigation) / 100,
|
|
188
|
-
/** @type {number} */ pctTriggerIrrigation: parseFloat(res.triggersIrrigation),
|
|
181
|
+
/** @type {number} */ val: metConSM.setVal, // Bodenfeuchte / Wassergehalt der oberen Bodenschicht (zB. 5 mm == 50%)
|
|
182
|
+
/** @type {number} */ pct: metConSM.setPct, // Bodenfeuchte in % zB. 50% = maxSoilMoistureIrrigation) / 2
|
|
183
|
+
/** @type {boolean} */ bool: metConSM.setBool, // Bodenfeuchtezustand trocken/feucht === true/false
|
|
184
|
+
/** @type {number} */ min: parseFloat(res.maxSoilMoistureIrrigation) / 100, // (zB. 0,02 mm)
|
|
185
|
+
/** @type {number} */ maxIrrigation: parseFloat(res.maxSoilMoistureIrrigation), // (zB. 10 mm)
|
|
186
|
+
/** @type {number} */ maxRain: parseFloat(res.maxSoilMoistureIrrigation) /100 * (parseFloat(res.maxSoilMoistureRainPct) || 120), // (zB. 12 mm)
|
|
187
|
+
/** @type {number} */ triggersIrrigation: parseFloat(res.maxSoilMoistureIrrigation) * parseInt(res.triggersIrrigation) / 100, // (zB. 50 % ==> 5 mm)
|
|
188
|
+
/** @type {number} */ pctTriggerIrrigation: parseFloat(res.triggersIrrigation), // Auslöser der Bewässerung in % (zB. 50%)
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
myConfig.config.push(newEntry);
|
|
@@ -269,20 +269,35 @@ const myConfig = {
|
|
|
269
269
|
setSoilMoistPct: (mySprinkleID, newVal) => {
|
|
270
270
|
if (myConfig.config[mySprinkleID].methodControlSM === 'analog') {
|
|
271
271
|
if (typeof parseFloat(newVal) === 'number') {
|
|
272
|
+
/**aktueller Wert des Bodenfeuchte-Sensor
|
|
273
|
+
* @type {number} myVal
|
|
274
|
+
*/
|
|
272
275
|
let myVal;
|
|
276
|
+
/**Reversible Eingang des Bodenfeuchte sensors
|
|
277
|
+
* @type {boolean} reverse -Eingang analogOHPct < analogZPct
|
|
278
|
+
*
|
|
279
|
+
*/
|
|
280
|
+
const reverse = (myConfig.config[mySprinkleID].analogOHPct < myConfig.config[mySprinkleID].analogZPct);
|
|
281
|
+
if (myConfig.config[mySprinkleID].analogOHPct === myConfig.config[mySprinkleID].analogZPct) {
|
|
282
|
+
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 0% and at 100% => the values are the same`);
|
|
283
|
+
}
|
|
273
284
|
newVal = parseFloat(newVal);
|
|
274
|
-
|
|
285
|
+
|
|
286
|
+
if ((!reverse && newVal < myConfig.config[mySprinkleID].analogZPct)
|
|
287
|
+
|| (reverse && myConfig.config[mySprinkleID].analogZPct < newVal)) {
|
|
275
288
|
myVal = myConfig.config[mySprinkleID].analogZPct;
|
|
276
|
-
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 0 % => The value range was undercut`);
|
|
277
|
-
} else if (newVal > myConfig.config[mySprinkleID].analogOHPct)
|
|
289
|
+
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"}`);
|
|
290
|
+
} else if ((!reverse && newVal > myConfig.config[mySprinkleID].analogOHPct)
|
|
291
|
+
|| (reverse && myConfig.config[mySprinkleID].analogOHPct > newVal)) {
|
|
278
292
|
myVal = myConfig.config[mySprinkleID].analogOHPct;
|
|
279
|
-
adapter.log.warn(`${myConfig.config[mySprinkleID].objectName}: analog soil moisture sensor at 100 % => The range of values has been exceeded`);
|
|
293
|
+
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"}`);
|
|
280
294
|
} else {
|
|
281
295
|
myVal = newVal;
|
|
282
296
|
}
|
|
283
|
-
|
|
297
|
+
|
|
298
|
+
myConfig.config[mySprinkleID].soilMoisture.pct = Math.round(10 * trend(myConfig.config[mySprinkleID].analogZPct, myConfig.config[mySprinkleID].analogOHPct, 0, 100, myVal)) / 10;
|
|
284
299
|
adapter.setState('sprinkle.' + [myConfig.config[mySprinkleID].objectName] + '.actualSoilMoisture', {
|
|
285
|
-
val:
|
|
300
|
+
val: myConfig.config[mySprinkleID].soilMoisture.pct,
|
|
286
301
|
ack: true
|
|
287
302
|
});
|
|
288
303
|
} else {
|
|
@@ -298,8 +313,13 @@ const myConfig = {
|
|
|
298
313
|
* @param {number} addVal - soilMoisture.val wird um den Wert addVal erhöht
|
|
299
314
|
*/
|
|
300
315
|
addSoilMoistVal: (mySprinkleID, addVal) => {
|
|
301
|
-
myConfig.config[mySprinkleID].soilMoisture.val
|
|
302
|
-
|
|
316
|
+
if (myConfig.config[mySprinkleID].soilMoisture.val < myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) {
|
|
317
|
+
myConfig.config[mySprinkleID].soilMoisture.val += addVal;
|
|
318
|
+
if (myConfig.config[mySprinkleID].soilMoisture.val > myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) {
|
|
319
|
+
myConfig.config[mySprinkleID].soilMoisture.val = myConfig.config[mySprinkleID].soilMoisture.maxIrrigation;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
303
323
|
myConfig.config[mySprinkleID].soilMoisture.pct = Math.round(1000 * myConfig.config[mySprinkleID].soilMoisture.val
|
|
304
324
|
/ myConfig.config[mySprinkleID].soilMoisture.maxIrrigation) / 10; // Berechnung in %
|
|
305
325
|
adapter.setState('sprinkle.' + myConfig.config[mySprinkleID].objectName + '.actualSoilMoisture', {
|