iobroker.sprinklecontrol 0.2.7 → 0.2.10
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/.commitmessage +4 -0
- package/Lizenz +1 -1
- package/README.md +14 -7
- package/admin/index_m.html +0 -15
- package/admin/style.css +8 -0
- package/admin/words.js +0 -2
- package/docs/de/sprinklecontrol.md +17 -16
- package/io-package.json +43 -5
- package/lib/evaporation.js +28 -32
- package/lib/myConfig.js +37 -22
- package/lib/sendMessageText.js +13 -20
- package/lib/valveControl.js +48 -62
- package/main.js +698 -599
- package/package.json +64 -62
package/.commitmessage
ADDED
package/Lizenz
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2022 Dirk Peter <dirk.peter@freenet.de>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|

|
|
8
8
|
[](https://www.npmjs.com/package/iobroker.sprinklecontrol)
|
|
9
9
|
[](https://www.npmjs.com/package/iobroker.sprinklecontrol)
|
|
10
|
-
[](https://david-dm.org/Dirk-Peter-md/iobroker.sprinklecontrol)
|
|
11
10
|
[](https://snyk.io/test/github/Dirk-Peter-md/ioBroker.sprinklecontrol)
|
|
12
11
|
[](https://travis-ci.com/Dirk-Peter-md/ioBroker.sprinklecontrol)
|
|
13
12
|
|
|
@@ -30,10 +29,21 @@ Wetterabhängige automatische Steuerung der Gartenbewässerung
|
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
## Changelog
|
|
32
|
+
|
|
33
33
|
<!--
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
Placeholder for the next version (at the beginning of the line):
|
|
35
|
+
### **WORK IN PROGRESS**
|
|
36
36
|
-->
|
|
37
|
+
### 0.2.10 (2022-05-15)
|
|
38
|
+
* (Dirk-Peter-md) manual watering limited to a maximum of 100%
|
|
39
|
+
* (Dirk-Peter-md) Error whatsapp message fixed
|
|
40
|
+
|
|
41
|
+
### 0.2.9 (2022-04-10)
|
|
42
|
+
* (Dirk-Peter-md) Bug-Initialisierungsroutine
|
|
43
|
+
|
|
44
|
+
### 0.2.8 (2022-03-20)
|
|
45
|
+
* (Dirk-Peter-md) Adaptation for js controller 4
|
|
46
|
+
* (Dirk-Peter-md) switched main.js to async
|
|
37
47
|
|
|
38
48
|
### 0.2.7 (16.10.2021)
|
|
39
49
|
* (Dirk-Peter-md) zusätzliche Testnachrichten gelöscht, Readme aktualisiert
|
|
@@ -100,12 +110,10 @@ Wetterabhängige automatische Steuerung der Gartenbewässerung
|
|
|
100
110
|
|
|
101
111
|
*************************************************************************************************************************************
|
|
102
112
|
|
|
103
|
-
|
|
104
|
-
|
|
105
113
|
## License
|
|
106
114
|
MIT License
|
|
107
115
|
|
|
108
|
-
Copyright (c)
|
|
116
|
+
Copyright (c) 2022 Dirk Peter <dirk.peter@freenet.de>
|
|
109
117
|
|
|
110
118
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
111
119
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -124,4 +132,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
124
132
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
125
133
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
126
134
|
SOFTWARE.
|
|
127
|
-
|
package/admin/index_m.html
CHANGED
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
<th data-name="fri" id="events_col_26" data-type="checkbox" style="width: 0" class="translate"></th>
|
|
101
101
|
<th data-name="sat" id="events_col_27" data-type="checkbox" style="width: 0" class="translate"></th>
|
|
102
102
|
<!-- **************************************** *** ******************** *** **************************************** -->
|
|
103
|
-
|
|
104
103
|
</tr>
|
|
105
104
|
</thead>
|
|
106
105
|
</table>
|
|
@@ -279,20 +278,6 @@
|
|
|
279
278
|
</div>
|
|
280
279
|
</div>
|
|
281
280
|
</div>
|
|
282
|
-
<!-- Debug Einstellungen -->
|
|
283
|
-
<div class="col s12 m6 l4">
|
|
284
|
-
<div class="row">
|
|
285
|
-
<div class="col s12">
|
|
286
|
-
<h6 class="translate sub-title">Debug settings</h6>
|
|
287
|
-
</div>
|
|
288
|
-
</div>
|
|
289
|
-
<div class="row">
|
|
290
|
-
<div class="col s4 input-field">
|
|
291
|
-
<input type="checkbox" class="value" id="debug" />
|
|
292
|
-
<span for="debug" class="translate">debug</span>
|
|
293
|
-
</div>
|
|
294
|
-
</div>
|
|
295
|
-
</div>
|
|
296
281
|
<!-- notifications on/off -->
|
|
297
282
|
<div class="col s12 m6 l4">
|
|
298
283
|
<div class="row">
|
package/admin/style.css
CHANGED
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
.m .row .col.m1 { width: 14%;}
|
|
25
25
|
#tab-area { padding-left:0;padding-right:0; margin-top: 0; margin-bottom: 1px; background-color:#174475; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2) }
|
|
26
26
|
|
|
27
|
+
/* Tabs menu react-dark */
|
|
28
|
+
.m.react-dark .tabs .tab a.active, .m .tabs .tab a:hover { color: #2196f3; }
|
|
29
|
+
.m.react-dark .tabs { background-color: #272727 !important;}
|
|
30
|
+
|
|
31
|
+
/* Tabs menu react-blue */
|
|
32
|
+
.m.react-blue .tabs .tab a.active, .m .tabs .tab a:hover { color: #2196f3; }
|
|
33
|
+
.m.react-blue .tabs { background-color: #272727 !important;}
|
|
34
|
+
|
|
27
35
|
.m .col .select-wrapper + label {
|
|
28
36
|
top: -26px;
|
|
29
37
|
}
|
package/admin/words.js
CHANGED
|
@@ -39,8 +39,6 @@ systemDictionary = {
|
|
|
39
39
|
'Astro settings': {'en': 'Astro settings', 'de': 'Astro-Einstellungen', 'ru': 'Астро настройки', 'pt': 'Configurações do Astro', 'nl': 'Astro-instellingen', 'fr': 'Paramètres Astro', 'it': 'Impostazioni Astro', 'es': 'Configuraciones astro', 'pl': 'Ustawienia Astro', 'zh-cn': '天文设置'},
|
|
40
40
|
'latitude': {'en': 'latitude', 'de': 'Breite', 'ru': 'широта', 'pt': 'latitude', 'nl': 'breedtegraad', 'fr': 'latitude', 'it': 'latitudine', 'es': 'latitud', 'pl': 'szerokość', 'zh-cn': '纬度'},
|
|
41
41
|
'longitude': {'en': 'longitude', 'de': 'Längengrad', 'ru': 'долгота', 'pt': 'longitude', 'nl': 'Lengtegraad', 'fr': 'longitude', 'it': 'longitudine', 'es': 'longitud', 'pl': 'długość geograficzna', 'zh-cn': '经度'},
|
|
42
|
-
'Debug settings': {'en': 'Debug settings', 'de': 'Debug-Einstellungen', 'ru': 'Настройки отладки', 'pt': 'Configurações de depuração', 'nl': 'Instellingen voor foutopsporing', 'fr': 'Paramètres de débogage', 'it': 'Impostazioni di debug', 'es': 'Configuraciones de depuración', 'pl': 'Ustawienia debugowania', 'zh-cn': '调试设置'},
|
|
43
|
-
'debug': {'en': 'debug', 'de': 'debuggen', 'ru': 'отлаживать', 'pt': 'depurar', 'nl': 'debuggen', 'fr': 'déboguer', 'it': 'mettere a punto', 'es': 'depurar', 'pl': 'odpluskwić', 'zh-cn': '调试'},
|
|
44
42
|
'Additional notification setting': {'en': 'Additional notification setting', 'de': 'Zusätzliche Benachrichtigungseinstellung', 'ru': 'Дополнительная настройка уведомлений', 'pt': 'Configuração de notificação adicional', 'nl': 'Aanvullende meldingsinstelling', 'fr': 'Paramètre de notification supplémentaire', 'it': 'Impostazioni di notifica aggiuntive', 'es': 'Configuración de notificación adicional', 'pl': 'Dodatkowe ustawienie powiadomień', 'zh-cn': '附加通知设置'},
|
|
45
43
|
'Enable / Disable Notifications': {'en': 'Enable / Disable Notifications', 'de': 'Benachrichtigungen aktivieren / deaktivieren', 'ru': 'Включить / отключить уведомления', 'pt': 'Ativar / desativar notificações', 'nl': 'Meldingen inschakelen / uitschakelen', 'fr': 'Activer / désactiver les notifications', 'it': 'Abilita / Disabilita notifiche', 'es': 'Activar / desactivar notificaciones', 'pl': 'Włącz / wyłącz powiadomienia', 'zh-cn': '启用/禁用通知'},
|
|
46
44
|
'Evaporation calculation sensors': {'en': 'Sensors "(Homematic HmIP-SWO-PL)" for calculating the evaporation', 'de': 'Sensoren "(Homematic HmIP-SWO-PL)" zur Berechnung der Verdunstung', 'ru': 'Датчики «(Homematic HmIP-SWO-PL)» для расчета испарения.', 'pt': 'Sensores "(Homematic HmIP-SWO-PL)" para cálculo da evaporação', 'nl': 'Sensoren "(Homematic HmIP-SWO-PL)" voor het berekenen van de verdamping', 'fr': "Capteurs \"(Homematic HmIP-SWO-PL)\" pour le calcul de l'évaporation", 'it': "Sensori \"(Homematic HmIP-SWO-PL)\" per il calcolo dell'evaporazione", 'es': 'Sensores "(Homematic HmIP-SWO-PL)" para calcular la evaporación', 'pl': 'Czujniki „(Homematic HmIP-SWO-PL)” do obliczania parowania', 'zh-cn': '用于计算蒸发量的传感器“(Homematic HmIP-SWO-PL)”'},
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|

|
|
2
2
|
# SprinkleControl
|
|
3
|
-
### *Der Adapter zur individuellen automatischen Gartenbewässerung. <<
|
|
3
|
+
### *Der Adapter zur individuellen automatischen Gartenbewässerung. << so wie es jeder mag >> ;-)*
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
<a id="inhaltsverzeichnis"></a>
|
|
9
|
+
# Inhaltsverzeichnis
|
|
9
10
|
* [1 Grundlegendes](#1-grundlegendes)
|
|
10
11
|
* [2 Installation](#2-installation)
|
|
11
12
|
* [3 Konfiguration](#3-konfiguration)
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
* [6 Zeit-Einstellungen](#6-zeit-einstellungen)
|
|
25
26
|
* [7 Zusätzliche-Einstellungen](#7-zustzliche-einstellungen)
|
|
26
27
|
* [7.1 Astro-Einstellungen](#71-astro-einstellungen)
|
|
27
|
-
* [7.2 Debug-Einstellungen](#72-debug-einstellungen)
|
|
28
|
+
* [7.2 Debug-Einstellungen](#72-debug-einstellungen)
|
|
28
29
|
* [7.3 Zusätzliche Benachrichtigungseinstellung](#73-zustzliche-benachrichtigungseinstellungen)
|
|
29
30
|
* [7.4 Sensoren zur Berechnung der Verdunstung](#74-sensoren-zur-berechnung-der-verdunstung)
|
|
30
31
|
* [7.5 Wettervorhersage](#75-wettervorhersage)
|
|
@@ -32,12 +33,12 @@
|
|
|
32
33
|
* [8.1 Telegram](#81-telegram)
|
|
33
34
|
* [8.2 Pushover](#82-pushover)
|
|
34
35
|
* [8.3 E-Mail](#83-e-mail)
|
|
35
|
-
* [8.4 WhatsApp](#84-whatsapp)
|
|
36
|
-
* [9 Objekte](#9-objekte)
|
|
37
|
-
* [9.1 control](#91-control)
|
|
38
|
-
* [9.2 evaporation](#92-evaporation)
|
|
39
|
-
* [9.3 info](#93-info)
|
|
40
|
-
* [9.4 sprinkle](#94-sprinkle)
|
|
36
|
+
* [8.4 WhatsApp](#84-whatsapp)
|
|
37
|
+
* [9 Objekte](#9-objekte)
|
|
38
|
+
* [9.1 control](#91-control)
|
|
39
|
+
* [9.2 evaporation](#92-evaporation)
|
|
40
|
+
* [9.3 info](#93-info)
|
|
41
|
+
* [9.4 sprinkle](#94-sprinkle)
|
|
41
42
|
* [10 Was ist für die Zukunft geplant](#10-was-ist-fr-die-zukunft-geplant)
|
|
42
43
|
|
|
43
44
|
|
|
@@ -163,14 +164,14 @@ Diese Konfigurationsebene besteht aus zwei Reitern: [**Haupteinstellungen**](#42
|
|
|
163
164
|
|
|
164
165
|
|
|
165
166
|
<a id="4211-bewasserungseinstellungen"></a>
|
|
166
|
-
#### 4.2.1.1 Bewässerungseinstellungen
|
|
167
|
+
#### 4.2.1.1 Bewässerungseinstellungen
|
|
167
168
|
|
|
168
169
|
* **Bewässerungszeit in min** – Einstellung der Zeit zum Bewässern in Minuten
|
|
169
|
-
|
|
170
|
-
|
|
170
|
+
> **Information** → Unter "Berechnung der Verdunstung“ und "Bodenfeuchte-Sensor analog“ wird die Bewässerungszeit verlängert je weiter der Trigger "niedrigster Prozentsatz der Bodenfeuchte“ unterschritten wurde.
|
|
171
|
+
> Bei **Start an festen Wochentagen (ohne Sensoren)** und **Bodenfeuchte-Sensor bistabil** erfolgt die Verlängerung proportional der extraterrestrische Strahlung ihrer Region.
|
|
171
172
|
* **maximale Bewässerungsverlängerung in %** – Begrenzung der Bewässerungsdauer in Prozent (100 % = Bewässerungsdauer wird nicht verlängert)
|
|
172
|
-
|
|
173
|
-
|
|
173
|
+
> **Information** → Bei **Start an festen Wochentagen (ohne Sensoren)** und **Bodenfeuchte-Sensor bistabil** wird hier die Verlängerung der Bewässerungszeit angegeben. Wobei am 21.12.
|
|
174
|
+
die Bewässerungszeit gleich der Eingabe und am 21.6. gleich der maximalen Verlängerung entspricht. Dazwischen wird die Bewässerungszeit proportional der extraterrestrische Strahlung ihrer Region angepasst.
|
|
174
175
|
* **Bewässerungsintervall in min** – Die Bewässerungsdauer wird in einem Intervall aufgeteilt. (z. B. 5 min an, mindestens 5 min aus, 5 min an, usw.)
|
|
175
176
|
> **Tipp** –> Ich habe bei der Autoauffahrt ein Rasengitter verlegt. Hier läuft das Wasser beim Bewässern einfach nur die Schräge herunter. Durch die Bewässerung in Intervallen konnte ich dem entgegenwirken.
|
|
176
177
|
|
|
@@ -181,7 +182,7 @@ Diese Konfigurationsebene besteht aus zwei Reitern: [**Haupteinstellungen**](#42
|
|
|
181
182
|
#### 4.2.1.2 Einschaltpunkt zum Gießen
|
|
182
183
|
|
|
183
184
|
* Über **Methode zur Kontrolle der Bodenfeuchtigkeit** werden die verschiedenen Sensoren, zur Steuerung der Bewässerung und deren verhalten, festgelegt.
|
|
184
|
-
> **Information** → Über [**„Zusätzliche Einstellungen" → „Wettervorhersage"**](#75-wettervorhersage) kann der Startvorgang verschoben werden, wenn es Regen soll.
|
|
185
|
+
> **Information** → Über [**„Zusätzliche Einstellungen" → „Wettervorhersage"**](#75-wettervorhersage) kann der Startvorgang verschoben werden, wenn es Regen soll.
|
|
185
186
|
|
|
186
187
|
---
|
|
187
188
|
|
|
@@ -241,7 +242,7 @@ Diese Konfigurationsebene besteht aus zwei Reitern: [**Haupteinstellungen**](#42
|
|
|
241
242
|
+ **Drei Tage Rhythmus** → Der 1. Tag der Bewässerung ist der Folgetag, nach dem Speichern der Konfiguration, und dann jeden 3. Tag in Folge.
|
|
242
243
|
+ **Jeden zweiten Tag** → Der 1. Tag der Bewässerung ist der Folgetag, nach dem Speichern der Konfiguration, und dann jeden 2. Tag in Folge.
|
|
243
244
|
+ **An festen Tagen starten** → Die Bewässerungstage werden individuell nach Wochentagen bestimmt.
|
|
244
|
-
> **Info** → Die Bewässerungsdauer wird
|
|
245
|
+
> **Info** → Die Bewässerungsdauer wird verlängert siehe [Bewässerungseinstellungen](#4211-bewasserungseinstellungen)
|
|
245
246
|
|
|
246
247
|
---
|
|
247
248
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "sprinklecontrol",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.10",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.2.10": {
|
|
7
|
+
"en": "- manual watering limited to a maximum of 100%; - Error whatsapp message fixed",
|
|
8
|
+
"de": "- manuelle Bewässerung begrenzt auf maximal 100 %; - Fehler WhatsApp-Nachricht behoben",
|
|
9
|
+
"ru": "- ручной полив ограничен максимум 100%; - Исправлено сообщение об ошибке WhatsApp",
|
|
10
|
+
"pt": "- rega manual limitada a um máximo de 100%; - Mensagem de erro do whatsapp corrigida",
|
|
11
|
+
"nl": "- handmatige bewatering beperkt tot maximaal 100%; - Fout whatsapp-bericht opgelost",
|
|
12
|
+
"fr": "- arrosage manuel limité à 100% maximum ; - Message d'erreur WhatsApp corrigé",
|
|
13
|
+
"it": "- irrigazione manuale limitata ad un massimo del 100%; - Errore messaggio whatsapp risolto",
|
|
14
|
+
"es": "- riego manual limitado a un máximo del 100%; - Mensaje de error de whatsapp arreglado",
|
|
15
|
+
"pl": "- nawadnianie ręczne ograniczone do maksymalnie 100%; - Naprawiono błąd wiadomości WhatsApp",
|
|
16
|
+
"zh-cn": "- 手动浇水限制为最大 100%; - 错误whatsapp消息已修复"
|
|
17
|
+
},
|
|
18
|
+
"0.2.9": {
|
|
19
|
+
"en": "Bug initialization routine",
|
|
20
|
+
"de": "Bug-Initialisierungsroutine",
|
|
21
|
+
"ru": "Процедура инициализации ошибки",
|
|
22
|
+
"pt": "Rotina de inicialização de bugs",
|
|
23
|
+
"nl": "Bug initialisatie routine",
|
|
24
|
+
"fr": "Routine d'initialisation de bogue",
|
|
25
|
+
"it": "Routine di inizializzazione dei bug",
|
|
26
|
+
"es": "Rutina de inicialización de errores",
|
|
27
|
+
"pl": "Procedura inicjowania błędów",
|
|
28
|
+
"zh-cn": "错误初始化例程"
|
|
29
|
+
},
|
|
30
|
+
"0.2.8": {
|
|
31
|
+
"en": "Adaptation for js controller 4; switched main.js to async",
|
|
32
|
+
"de": "Anpassung für js-Controller 4; main.js auf async umgestellt",
|
|
33
|
+
"ru": "Адаптация для js контроллера 4; переключил main.js на асинхронный",
|
|
34
|
+
"pt": "Adaptação para controlador js 4; mudou main.js para assíncrono",
|
|
35
|
+
"nl": "Aanpassing voor js-controller 4; main.js overgeschakeld naar async",
|
|
36
|
+
"fr": "Adaptation pour le contrôleur js 4 ; a basculé main.js en asynchrone",
|
|
37
|
+
"it": "Adattamento per js controller 4; cambiato main.js in asincrono",
|
|
38
|
+
"es": "Adaptación para controlador js 4; cambió main.js a asíncrono",
|
|
39
|
+
"pl": "Adaptacja pod kontroler js 4; przełączył main.js na asynchroniczny",
|
|
40
|
+
"zh-cn": "适配js控制器4;将 main.js 切换为异步"
|
|
41
|
+
},
|
|
6
42
|
"0.2.7": {
|
|
7
43
|
"en": "additional test messages deleted, Readme updated",
|
|
8
44
|
"de": "zusätzliche Testnachrichten gelöscht, Readme aktualisiert",
|
|
@@ -289,7 +325,6 @@
|
|
|
289
325
|
"publicHolInstance": "",
|
|
290
326
|
"latitude": "",
|
|
291
327
|
"longitude": "",
|
|
292
|
-
"debug": false,
|
|
293
328
|
"sensorOutsideTemperature": "",
|
|
294
329
|
"sensorOutsideHumidity": "",
|
|
295
330
|
"sensorWindSpeed": "",
|
|
@@ -434,7 +469,10 @@
|
|
|
434
469
|
"role": "switch",
|
|
435
470
|
"name": "Auto / Manu On - Off",
|
|
436
471
|
"type": "boolean",
|
|
437
|
-
"states":
|
|
472
|
+
"states": {
|
|
473
|
+
"false": "off",
|
|
474
|
+
"true": "Auto"
|
|
475
|
+
},
|
|
438
476
|
"read": true,
|
|
439
477
|
"write": true,
|
|
440
478
|
"def": true
|
|
@@ -450,7 +488,7 @@
|
|
|
450
488
|
"type": "string",
|
|
451
489
|
"read": true,
|
|
452
490
|
"write": false,
|
|
453
|
-
"def": ""
|
|
491
|
+
"def": "-"
|
|
454
492
|
},
|
|
455
493
|
"native": {}
|
|
456
494
|
},
|
|
@@ -463,7 +501,7 @@
|
|
|
463
501
|
"type": "string",
|
|
464
502
|
"read": true,
|
|
465
503
|
"write": false,
|
|
466
|
-
"def": ""
|
|
504
|
+
"def": "-"
|
|
467
505
|
},
|
|
468
506
|
"native": {}
|
|
469
507
|
},
|
package/lib/evaporation.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
info: log aufbau evaporation.js: #3.*
|
|
4
4
|
*/
|
|
5
|
-
const myConfig = require('./myConfig.js'); // myConfig
|
|
5
|
+
const myConfig = require('./myConfig.js'); // myConfig → Speichern und abrufen von Konfigurationsdaten der Ventile
|
|
6
6
|
const formatTime = require('./tools').formatTime; // tools => laden von Hilfsfunktionen
|
|
7
7
|
const trend = require('./tools').trend; // tools => laden von Hilfsfunktionen
|
|
8
8
|
|
|
@@ -11,18 +11,18 @@ let adapter;
|
|
|
11
11
|
|
|
12
12
|
/* calcEvaporation */
|
|
13
13
|
/** akt. Temperatur °C
|
|
14
|
-
* - -20 bis 55°C
|
|
14
|
+
* - -20 bis 55 °C
|
|
15
15
|
* - ts Zeitstempel, wann der Wert aktualisiert wurde (auch ohne Wertänderung)
|
|
16
16
|
* @type {{val: number, ts: any}} */
|
|
17
17
|
let curTemperature = {},
|
|
18
18
|
/** akt. LuftFeuchtigkeit in %
|
|
19
|
-
* - 1 bis 99%
|
|
19
|
+
* - 1 bis 99 %
|
|
20
20
|
* - lc: Zeitstempel, wann der Wert geändert wurde
|
|
21
21
|
* @type {{val: number, lc: any}} */
|
|
22
22
|
curHumidity = {},
|
|
23
23
|
/** akt. Helligkeit (relativ)
|
|
24
24
|
* - 0 bis 100000
|
|
25
|
-
* - intern Begrenzung
|
|
25
|
+
* - intern Begrenzung 100...7000
|
|
26
26
|
* - lc: Zeitstempel, wann der Wert geändert wurde
|
|
27
27
|
* @type {{val: number, lc: any}} */
|
|
28
28
|
curIllumination = {},
|
|
@@ -45,11 +45,11 @@ let ETpTodayNum = 0,
|
|
|
45
45
|
* - berechneter tabellarischer Tageswert
|
|
46
46
|
* @type {number} */
|
|
47
47
|
toDayExtraTerStr,
|
|
48
|
-
/** kleinste
|
|
48
|
+
/** kleinste extraterrestrische Tagesstrahlung im Jahr in W/m²
|
|
49
49
|
* - berechneter tabellarischer Mindestwert
|
|
50
50
|
* @type {number} */
|
|
51
51
|
minExtraTerStr,
|
|
52
|
-
/** größter
|
|
52
|
+
/** größter extraterrestrische Tagesstrahlung im Jahr in W/m²
|
|
53
53
|
* - berechneter tabellarischer Maximalwert
|
|
54
54
|
* @type {number} */
|
|
55
55
|
maxExtraTerStr;
|
|
@@ -136,12 +136,12 @@ function extraTerStr () { // latitude Breitengrad
|
|
|
136
136
|
* @param {number} timeDifference
|
|
137
137
|
*/
|
|
138
138
|
function calcEvaporation (timeDifference) {
|
|
139
|
-
|
|
139
|
+
adapter.log.debug(`calcEvaporation => gestartet TimeDifferenz: ${timeDifference}`);
|
|
140
140
|
// Sonnenscheindauer in %
|
|
141
141
|
const curSunshineDuration = (curIllumination.val < 100) ? (0) : (curIllumination.val > 7000) ? (1) : ((curIllumination.val - 100) / (6900));
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Sättigungsdampfdruck Es in hPa
|
|
144
|
+
* Sättigungsdampfdruck 'Es' in hPa
|
|
145
145
|
* @type {number} m1
|
|
146
146
|
*/
|
|
147
147
|
const m1 = 6.11 * ( 10 ** (( 7.48 * curTemperature.val ) / ( 237 + curTemperature.val )));
|
|
@@ -201,7 +201,7 @@ function addEvaporation (value) {
|
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
203
|
* externe Funktionen
|
|
204
|
-
* @type {{setCurTemperature:
|
|
204
|
+
* @type {{setCurTemperature(number, (Date|number)): void, setCurIllumination(number, *): void, initEvaporation(ioBroker.Adapter): void, timeExtension(number): number, setCurAmountOfRain(number): void, setNewDay(): void, setCurHumidity(number, *): void, setCurWindSpeed(number, *): void, setETpTodayNum(number): void}}
|
|
205
205
|
*/
|
|
206
206
|
const evaporation = {
|
|
207
207
|
/**
|
|
@@ -209,7 +209,7 @@ const evaporation = {
|
|
|
209
209
|
* - Bereitstellen von Umweltdaten
|
|
210
210
|
* @param {ioBroker.Adapter} myAdapter
|
|
211
211
|
*/
|
|
212
|
-
initEvaporation
|
|
212
|
+
initEvaporation (myAdapter) {
|
|
213
213
|
adapter = myAdapter;
|
|
214
214
|
/**
|
|
215
215
|
* - Sensors to calculate the evaporation are required
|
|
@@ -230,7 +230,7 @@ const evaporation = {
|
|
|
230
230
|
curTemperature.val = (parseFloat(state.val));
|
|
231
231
|
curTemperature.ts = state.ts;
|
|
232
232
|
} else {
|
|
233
|
-
adapter.log.warn(
|
|
233
|
+
adapter.log.warn(`sensorOutsideTemperature => Wrong value: ${state.val}, Type: ${typeof state.val}`)
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
});
|
|
@@ -246,7 +246,7 @@ const evaporation = {
|
|
|
246
246
|
curHumidity.val = (parseFloat(state.val));
|
|
247
247
|
curHumidity.lc = state.lc;
|
|
248
248
|
} else {
|
|
249
|
-
adapter.log.warn(
|
|
249
|
+
adapter.log.warn(`sensorOutsideHumidity => Wrong value: ${state.val}, Type: ${typeof state.val}`)
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
});
|
|
@@ -278,7 +278,7 @@ const evaporation = {
|
|
|
278
278
|
curWindSpeed.val = (parseFloat(state.val));
|
|
279
279
|
curWindSpeed.lc = state.lc;
|
|
280
280
|
} else {
|
|
281
|
-
adapter.log.warn(
|
|
281
|
+
adapter.log.warn(`sensorWindSpeed => Wrong value: ${state.val}, Type: ${typeof state.val}`)
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
});
|
|
@@ -293,7 +293,7 @@ const evaporation = {
|
|
|
293
293
|
if (!Number.isNaN(Number.parseFloat(state.val))) {
|
|
294
294
|
lastRainCounter = (parseFloat(state.val));
|
|
295
295
|
} else {
|
|
296
|
-
adapter.log.warn(
|
|
296
|
+
adapter.log.warn(`sensorRainfall => Wrong value: ${state.val}, Type: ${typeof state.val}`)
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
})
|
|
@@ -304,7 +304,7 @@ const evaporation = {
|
|
|
304
304
|
* @param {number} value curTemperature
|
|
305
305
|
* @param {Date | number} curTime ts (akt. Zeit)
|
|
306
306
|
*/
|
|
307
|
-
setCurTemperature
|
|
307
|
+
setCurTemperature (value, curTime) {
|
|
308
308
|
curTemperature.val = value;
|
|
309
309
|
curTemperature.ts = curTime;
|
|
310
310
|
|
|
@@ -324,9 +324,7 @@ const evaporation = {
|
|
|
324
324
|
* @type {number}
|
|
325
325
|
*/
|
|
326
326
|
const timeDifference = (curTime - lastChangeEvaPor) / 86400000; // 1Tag === 24/h * 60/min * 60/s * 1000/ms === 86400000 ms
|
|
327
|
-
|
|
328
|
-
adapter.log.info('ts: ' + curTime + ' - lastChangeEvaPor: ' + lastChangeEvaPor + ' = timeDifference: ' + timeDifference);
|
|
329
|
-
}
|
|
327
|
+
adapter.log.debug(`ts: ${curTime} - lastChangeEvaPor: ${lastChangeEvaPor} = timeDifference: ${timeDifference}`);
|
|
330
328
|
|
|
331
329
|
if (timeDifference) {
|
|
332
330
|
setTimeout(() => {
|
|
@@ -340,7 +338,7 @@ const evaporation = {
|
|
|
340
338
|
* @param {number} value
|
|
341
339
|
* @param {any} lc
|
|
342
340
|
*/
|
|
343
|
-
setCurHumidity
|
|
341
|
+
setCurHumidity (value, lc) {
|
|
344
342
|
curHumidity.val = value;
|
|
345
343
|
curHumidity.lc =lc;
|
|
346
344
|
},
|
|
@@ -349,7 +347,7 @@ const evaporation = {
|
|
|
349
347
|
* @param {number} value
|
|
350
348
|
* @param {any} lc
|
|
351
349
|
*/
|
|
352
|
-
setCurIllumination
|
|
350
|
+
setCurIllumination (value, lc) {
|
|
353
351
|
curIllumination.val = value;
|
|
354
352
|
curIllumination.lc = lc;
|
|
355
353
|
},
|
|
@@ -358,38 +356,36 @@ const evaporation = {
|
|
|
358
356
|
* @param {number} value Windgeschwindigkeit in km/h
|
|
359
357
|
* @param {any} lc
|
|
360
358
|
*/
|
|
361
|
-
setCurWindSpeed
|
|
359
|
+
setCurWindSpeed (value, lc) {
|
|
362
360
|
curWindSpeed.val = value;
|
|
363
361
|
curWindSpeed.lc = lc;
|
|
364
362
|
},
|
|
365
363
|
/**
|
|
366
364
|
* akt. Regenmengenzähler
|
|
367
|
-
*
|
|
365
|
+
* → Bei einer Änderung über 10 mm wird der Wert nur intern gespeichert,
|
|
368
366
|
* es findet aber keine Anwendung statt!
|
|
369
|
-
* @param {number} value current rain counter
|
|
367
|
+
* @param {number} value current rain counter → aktueller Regencontainer in mm
|
|
370
368
|
*/
|
|
371
|
-
setCurAmountOfRain
|
|
369
|
+
setCurAmountOfRain (value) {
|
|
372
370
|
if ((value > lastRainCounter) // es regnet
|
|
373
|
-
&& ((value - lastRainCounter) < 10) // && Plausibilitätskontrolle (Regenmenge unter
|
|
371
|
+
&& ((value - lastRainCounter) < 10) // && Plausibilitätskontrolle (Regenmenge unter 10 mm)
|
|
374
372
|
) {
|
|
375
373
|
addEvaporation(lastRainCounter - value);
|
|
376
374
|
}
|
|
377
375
|
lastRainCounter = value;
|
|
378
|
-
|
|
379
|
-
adapter.log.info('lastRainCounter: ' + lastRainCounter + ' curAmountOfRain: ' + (lastRainCounter - value) + ' state.val: ' + value);
|
|
380
|
-
}
|
|
376
|
+
adapter.log.debug(`lastRainCounter: ${lastRainCounter} curAmountOfRain: ${(lastRainCounter - value)} state.val: ${value}`);
|
|
381
377
|
},
|
|
382
378
|
/**
|
|
383
379
|
* Summe der heutigen Verdunstung
|
|
384
380
|
* @param {number} value
|
|
385
381
|
*/
|
|
386
|
-
setETpTodayNum
|
|
382
|
+
setETpTodayNum (value) {
|
|
387
383
|
ETpTodayNum = value;
|
|
388
384
|
},
|
|
389
385
|
/**
|
|
390
386
|
* ETpToday und ETpYesterday in evaporation aktualisieren da ein neuer Tag beginnt
|
|
391
387
|
*/
|
|
392
|
-
setNewDay
|
|
388
|
+
setNewDay () {
|
|
393
389
|
extraTerStr();
|
|
394
390
|
setTimeout(() => {
|
|
395
391
|
adapter.setState('evaporation.ETpYesterday', { val: Math.round(ETpTodayNum * 10000) / 10000, ack: true });
|
|
@@ -399,10 +395,10 @@ const evaporation = {
|
|
|
399
395
|
},
|
|
400
396
|
/**
|
|
401
397
|
*
|
|
402
|
-
* @param {number} maxExtension - Wert aus der Konfiguration (wateringAdd 100...300%) des Bewässerungskreises
|
|
398
|
+
* @param {number} maxExtension - Wert aus der Konfiguration (wateringAdd 100...300 %) des Bewässerungskreises
|
|
403
399
|
* @return {number} - Erweiterung/Multiplikator (1...3) der Bewässerungszeit
|
|
404
400
|
*/
|
|
405
|
-
timeExtension
|
|
401
|
+
timeExtension (maxExtension) {
|
|
406
402
|
return trend(minExtraTerStr, maxExtraTerStr,1, maxExtension / 100, toDayExtraTerStr);
|
|
407
403
|
}
|
|
408
404
|
}
|