iobroker.influxdb 3.0.1 → 3.1.1

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 CHANGED
@@ -21,7 +21,7 @@ This adapter saves state history into InfluxDB.
21
21
  If you have an InfluxDB 1.x installation (preferably 1.8.x or 1.9.x) then you choose " 1.x" in the adapter configuration and enter the Host-IP and Port together with Username and Password for the Access.
22
22
  You can also define a database name. The default is "iobroker". On first adapter start this database is created.
23
23
 
24
- When doing custom queries via the "query" message you can use InfluxQL to select the data you want.
24
+ When doing custom queries via the "query" message you can use InfluxQL to select the data you want. FluxQL with InfluxDB 1.x is not supported (and will also not be added).
25
25
 
26
26
  ### InfluxDB 2.x
27
27
  Since 2.0 of the adapter also InfluxDB 2.x is supported which works a bit different.
@@ -183,7 +183,7 @@ Possible options:
183
183
  - **ignoreNull** - if null values should be included (false), replaced by last not null value (true) or replaced with 0 (0)
184
184
  - **removeBorderValues** - By default additional border values are returned to optimize charting. Set this option to true if this is not wanted (e.g. for script data processing)
185
185
  - **returnNewestEntries** - The returned data are always sorted by timestamp ascending. When using aggregate "none" and also providing "count" or "limit" this means that normally the oldest entries are returned (unless no start data is provided). Set this option to true to get the newest entries instead.
186
- - **aggregate** - aggregate method:
186
+ - **aggregate** - aggregate method (Default: 'average'):
187
187
  - *minmax* - used special algorithm. Splice the whole time range in small intervals and find for every interval max, min, start and end values.
188
188
  - *max* - Splice the whole time range in small intervals and find for every interval max value and use it for this interval (nulls will be ignored).
189
189
  - *min* - Same as max, but take minimal value.
@@ -287,7 +287,9 @@ sendTo('influxdb.0', 'query', 'from(bucket: "iobroker") |> range(start: -3h); fr
287
287
  If you want to write other data into the InfluxDB you can use the build in system function **storeState**.
288
288
  This function can also be used to convert data from other History adapters like History or SQL.
289
289
 
290
- The given ids are not checked against the ioBroker database and do not need to be set up there, but can only be accessed directly.
290
+ A successful response do not mean that the data are really written out to the disk. It just means that they were processed.
291
+
292
+ The given ids are not checked against the ioBroker database and do not need to be set up or enabled there. If own IDs are used without settings then the "rules" parameter is not supported and will result in an error. The default "Maximal number of stored in RAM values" is used for such IDs.
291
293
 
292
294
  The Message can have one of the following three formats:
293
295
  * one ID and one state object
@@ -321,6 +323,9 @@ sendTo('history.0', 'storeState', [
321
323
  ```
322
324
 
323
325
  Additionally, you can add attribute `rules: true` in message to activate all rules, like `counter`, `changesOnly`, `de-bounce` and so on
326
+
327
+ In case of errors an array with all single error messages is returned and also a successCount to see how many entries were stored successfully.
328
+
324
329
  ## delete state
325
330
  If you want to delete entry from the Database you can use the build in system function **delete**:
326
331
 
@@ -445,6 +450,20 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
445
450
  -->
446
451
 
447
452
  ## Changelog
453
+ ### 3.1.1 (2022-05-31)
454
+ * (Apollon77) Workaround an admin issue when testing connection to InfluxDB
455
+
456
+ ### 3.1.0 (2022-05-27)
457
+ * (Apollon77) Data are not converted to numbers if they are other datatypes on getHistory to respect the saved data formats as defined in the datapoint settings for storage.
458
+ * (Apollon77) Fix retention change to lower checkbox in UI
459
+ * (Apollon77) Allow storeState again to write to InfluxDB for "unknown state ids" - "rules" usage is not supported in for this and storeState would be silently discarded in this case!
460
+ * (Apollon77) Fix several crash cases reported by Sentry
461
+ * (Apollon77) Make sure disabling "Log changes only" also really do not log the changes anymore
462
+ * (Apollon77) Allow storeState and GetHistory also to be called for "unknown ids"
463
+
464
+ ### 3.0.2 (2022-05-12)
465
+ * (Apollon77) handle an empty Path for InfluxDB 2.0 correctly in all cases
466
+
448
467
  ### 3.0.1 (2022-05-11)
449
468
  * (Apollon77) BREAKING: Configuration is only working in the new Admin 5 UI!
450
469
  * (Apollon77) Did bigger adjustments to the recording logic and added a lot of new Features. Please refer to Changelog and Forum post for details.
@@ -21,7 +21,7 @@
21
21
  "Buffer Datapoints": "Schreibaktionen zusammenfassen",
22
22
  "Buffer Flush Interval": "Schreibintervall",
23
23
  "Confirmation required.": "Bestätigung erforderlich.",
24
- "Counter": "Schalter",
24
+ "Counter": "Zähler",
25
25
  "Custom retention duration (days)": "Benutzerdefinierte Aufbewahrungsdauer (Tage)",
26
26
  "Custom timeframe": "Benutzerdefinierter Zeitrahmen",
27
27
  "DB Name": "DB Name",
@@ -59,7 +59,7 @@
59
59
  "Seconds": "Sekunden",
60
60
  "Send health-check pings to database": "Pings zur Verfügbarkeitsprüfung an die Datenbank senden",
61
61
  "Start or enable adapter first": "Adapter muss zuerst aktiviert werden",
62
- "Storage retention": "Speicheraufbewahrung",
62
+ "Storage retention": "Aufbewahrungsdauer",
63
63
  "Store as": "Speichern als",
64
64
  "String": "Zeichenfolge",
65
65
  "Test connection": "Verbindung testen",
@@ -72,12 +72,12 @@
72
72
  "blockTime": "Alle neuen Werte für X ms nach dem letzten protokollierten Wert ignorieren",
73
73
  "debounce": "Änderungen ignorieren, bis der Wert für X Millisekunden unverändert bleibt",
74
74
  "health-check help": "Regelmäßige Verfügbarkeits-Anfragen werden an den DB-Server gesendet, um zu überprüfen, ob er noch aktiv ist.",
75
- "ignore values above x": "Ignorieren Sie die obigen Werte",
76
- "ignore values below x": "Ignorieren Sie die folgenden Werte",
77
- "ignore values below zero": "Ignoriere Werte unter Null (<0)",
75
+ "ignore values above x": "Ignoriere Werte größer als",
76
+ "ignore values below x": "Ignoriere Werte kleiner als",
77
+ "ignore values below zero": "Werte unter 0 ignorieren (<0)",
78
78
  "ignore zero or null values": "Ignoriere 0 oder Nullwerte (==0)",
79
79
  "keep forever": "keine automatische Löschung",
80
- "log changes interval(s)": "Gleiche Werte aufzeichnen (Sekunden)",
80
+ "log changes interval(s)": "trotzdem gleiche Werte aufzeichnen (Sekunden)",
81
81
  "log changes minimal delta": "Minimale Differenz zum letzten Wert",
82
82
  "log changes only": "Nur Änderungen aufzeichnen",
83
83
  "note": "History Einstellungen müssen für jeden State einzeln gemacht werden, im Tab \"States\" und nur wenn die Adapter Instanz aktiv ist",
@@ -86,4 +86,4 @@
86
86
  "retention": "Storage retention",
87
87
  "use 0 to not buffer at all": "Use 0 to not buffer at all",
88
88
  "usetags help": "For more information, please refer to the documentation: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields"
89
- }
89
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "0 = disable": "0 =禁用",
2
+ "0 = disable": "0 = 禁用",
3
3
  "0 = disable delta check": "0 =禁用增量检查",
4
4
  "0 = disabled": "0 = 禁用",
5
5
  "1 day": "1天",
@@ -49,7 +49,7 @@
49
49
  "Password": "密码",
50
50
  "Password confirm": "确认密码",
51
51
  "Please confirm!": "请确认",
52
- "Port": "港口",
52
+ "Port": "端口",
53
53
  "Reject on SSL errors": "拒绝 SSL 错误",
54
54
  "Request timeout": "请求超时",
55
55
  "Reset DB": "重置数据库",
@@ -288,8 +288,8 @@
288
288
  "newLine": true,
289
289
  "type": "checkbox",
290
290
  "label": "Apply lower retention",
291
- "hidden": "(data.retention >= originalData.retention && originalData.retention != 0) || data.retention == 0",
292
- "disabled": "(data.retention >= originalData.retention && originalData.retention != 0) || data.retention == 0",
291
+ "hidden": "((originalData.retention >= 0 && data.retention >= 0 && ((data.retention >= originalData.retention && originalData.retention != 0) || data.retention == 0)) || (originalData.retention === -1 && data.retention >= 0 && ((data.retention >= parseInt(originalData.customRetentionDuration, 10) * 24 * 60) || data.retention == 0)) || (originalData.retention > 0 && data.retention === -1 && (parseInt(data.customRetentionDuration, 10) * 24 * 60 >= originalData.retention)) || (originalData.retention === -1 && data.retention === -1 && data.customRetentionDuration >= originalData.customRetentionDuration))",
292
+ "disabled": "((originalData.retention >= 0 && data.retention >= 0 && ((data.retention >= originalData.retention && originalData.retention != 0) || data.retention == 0)) || (originalData.retention === -1 && data.retention >= 0 && ((data.retention >= parseInt(originalData.customRetentionDuration, 10) * 24 * 60) || data.retention == 0)) || (originalData.retention > 0 && data.retention === -1 && (parseInt(data.customRetentionDuration, 10) * 24 * 60 >= originalData.retention)) || (originalData.retention === -1 && data.retention === -1 && data.customRetentionDuration >= originalData.customRetentionDuration))",
293
293
  "confirm": {
294
294
  "text": "Lowering the retention period should be considered with caution: Past data exceeding the retention period will be lost.",
295
295
  "condition": "data.retentionConfirm && data.retentionConfirm != originalData.retentionConfirm",
package/admin/words.js CHANGED
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  systemDictionary = {
5
- "0 = disable": { "en": "0 = disable", "de": "0 = Deaktivieren", "ru": "0 = не активно", "pt": "0 = desativar", "nl": "0 = uitschakelen", "fr": "0 = disable", "it": "0 = disabilita", "es": "0 = desactivar", "pl": "0 = wyłącz", "zh-cn": "0 =禁用"},
5
+ "0 = disable": { "en": "0 = disable", "de": "0 = Deaktivieren", "ru": "0 = не активно", "pt": "0 = desativar", "nl": "0 = uitschakelen", "fr": "0 = disable", "it": "0 = disabilita", "es": "0 = desactivar", "pl": "0 = wyłącz", "zh-cn": "0 = 禁用"},
6
6
  "0 = disable delta check": { "en": "0 = disable delta check", "de": "0 = Abweichungsprüfung deaktivieren", "ru": "0 = не проверять минимальное изменение", "pt": "0 = desativar o cheque delta", "nl": "0 = delta-controle uitschakelen", "fr": "0 = disable delta check", "it": "0 = disabilita il controllo delta", "es": "0 = deshabilitar la verificación delta", "pl": "0 = wyłącz kontrolę delta", "zh-cn": "0 =禁用增量检查"},
7
7
  "0 = disabled": { "en": "0 = disabled", "de": "0 = deaktiviert", "ru": "0 = отключено", "pt": "0 = desativado", "nl": "0 = uitgeschakeld", "fr": "0 = désactivé", "it": "0 = disabilitato", "es": "0 = deshabilitado", "pl": "0 = wyłączone", "zh-cn": "0 = 禁用"},
8
8
  "1 day": { "en": "1 day", "de": "1 Tag", "ru": "1 день", "pt": "1 dia", "nl": "1 dag", "fr": "1 day", "it": "1 giorno", "es": "1 día", "pl": "1 dzień", "zh-cn": "1天"},
@@ -20,11 +20,11 @@ systemDictionary = {
20
20
  "Are you sure? All data will be dropped.": { "en": "All data will be dropped. Are you sure? ", "de": "Sollen wirklich alle Daten gelöscht werden? ", "ru": "Вы уверены? Все данные в базе будут удалены. ", "pt": "Você tem certeza? Todos os dados serão descartados.", "nl": "Weet je het zeker? Alle gegevens worden verwijderd.", "fr": "Are you sure? All data will be dropped.", "it": "Sei sicuro? Tutti i dati verranno eliminati.", "es": "¿Estás seguro? Todos los datos serán eliminados.", "pl": "Jesteś pewny? Wszystkie dane zostaną usunięte.", "zh-cn": "你确定吗?"},
21
21
  "Automatic": { "en": "Automatic", "de": "Automatisch", "ru": "автоматический", "pt": "Automático", "nl": "automatisch", "fr": "Automatique", "it": "Automatico", "es": "Automático", "pl": "Automatyczny", "zh-cn": "自动的"},
22
22
  "Block time": { "en": "Blocktime", "de": "Blockzeit", "ru": "Блокировка", "pt": "Blocktime", "nl": "Bloktijd", "fr": "Temps de blocage", "it": "Blocktime", "es": "hora de bloque", "pl": "Czas blokady", "zh-cn": "出块时间"},
23
- "Boolean": { "en": "Boolean", "de": "Boolesch", "ru": "логический", "pt": "boleano", "nl": "Booleaans", "fr": "booléen", "it": "booleano", "es": "booleano", "pl": "Boole'a", "zh-cn": "布尔值"},
23
+ "Boolean": { "en": "Boolean", "de": "Boolean", "ru": "логический", "pt": "boleano", "nl": "Booleaans", "fr": "booléen", "it": "booleano", "es": "booleano", "pl": "Boole'a", "zh-cn": "布尔值"},
24
24
  "Buffer Datapoints": { "en": "Buffer Datapoints", "de": "Schreibaktionen zusammenfassen", "ru": "Собирать значения для записи", "pt": "Datapoints do buffer", "nl": "Buffer-datapunten", "fr": "Buffer Datapoints", "it": "Buffer puntiforme", "es": "Puntos de datos del búfer", "pl": "Bufory Datapoints", "zh-cn": "缓冲区数据点"},
25
25
  "Buffer Flush Interval": { "en": "Buffer Flush Interval", "de": "Schreibintervall", "ru": "Интервал записи значений в базу из RAM", "pt": "Intervalo de descarga do buffer", "nl": "Buffer Flush Interval", "fr": "Buffer Flush Interval", "it": "Intervallo di flussaggio del tampone", "es": "Intervalo de lavado del tampón", "pl": "Przerwa między buforami", "zh-cn": "缓冲冲洗间隔"},
26
26
  "Confirmation required.": { "en": "Confirmation required.", "de": "Bestätigung erforderlich.", "ru": "Требуется подтверждение.", "pt": "Necessária confirmação.", "nl": "Bevestiging vereist.", "fr": "Confirmation requise.", "it": "Conferma richiesta.", "es": "Confirmación requerida.", "pl": "Wymagane Potwierdzenie.", "zh-cn": "需要确认。"},
27
- "Counter": { "en": "Counter", "de": "Schalter", "ru": "Прилавок", "pt": "Contador", "nl": "Balie", "fr": "Compteur", "it": "Contatore", "es": "Mostrador", "pl": "Lada", "zh-cn": "柜台"},
27
+ "Counter": { "en": "Counter", "de": "Zähler", "ru": "Прилавок", "pt": "Contador", "nl": "Balie", "fr": "Compteur", "it": "Contatore", "es": "Mostrador", "pl": "Lada", "zh-cn": "柜台"},
28
28
  "Custom retention duration (days)": { "en": "Custom retention duration (days)", "de": "Benutzerdefinierte Aufbewahrungsdauer (Tage)", "ru": "Пользовательский срок хранения (дни)", "pt": "Duração da retenção personalizada (dias)", "nl": "Aangepaste bewaarduur (dagen)", "fr": "Durée de conservation personnalisée (jours)", "it": "Durata di conservazione personalizzata (giorni)", "es": "Duración de la retención personalizada (días)", "pl": "Niestandardowy czas przechowywania (dni)", "zh-cn": "自定义保留期限(天)"},
29
29
  "Custom timeframe": { "en": "Custom timeframe", "de": "Benutzerdefinierter Zeitrahmen", "ru": "Пользовательский таймфрейм", "pt": "Período personalizado", "nl": "Aangepast tijdsbestek", "fr": "Délai personnalisé", "it": "Tempi personalizzati", "es": "Marco de tiempo personalizado", "pl": "Niestandardowe ramy czasowe", "zh-cn": "自定义时间范围"},
30
30
  "DB Name": { "en": "DB Name", "de": "DB Name", "ru": "Имя базы", "pt": "Nome do banco de dados", "nl": "DB-naam", "fr": "DB Name", "it": "Nome DB", "es": "Nombre de DB", "pl": "Nazwa DB", "zh-cn": "数据库名称"},
@@ -42,16 +42,17 @@ systemDictionary = {
42
42
  "Expert Settings": { "en": "Expert Settings", "de": "Experteneinstellungen", "ru": "Экспертные настройки", "pt": "Configurações para especialistas", "nl": "Expertinstellingen", "fr": "Paramètres experts", "it": "Impostazioni avanzate", "es": "Configuración experta", "pl": "Ustawienia eksperckie", "zh-cn": "专家设置"},
43
43
  "History adapter settings": { "en": "History adapter settings", "de": "History-Adapter Einstellungen", "ru": "Настройки драйвера history", "pt": "Configurações do adaptador de histórico", "nl": "Geschiedenis adapter instellingen", "fr": "History adapter settings", "it": "Impostazioni della scheda Cronologia", "es": "Configuración del adaptador de historial", "pl": "Ustawienia adaptera historii", "zh-cn": "历史记录适配器设置"},
44
44
  "Host": { "en": "Host", "de": "Server", "ru": "Хост", "pt": "Hospedeiro", "nl": "gastheer", "fr": "Host", "it": "Ospite", "es": "Anfitrión", "pl": "Gospodarz", "zh-cn": "主持人"},
45
+ "Log the last value again on startup": { "en": "Log the last value again on startup", "de": "Protokollieren Sie den letzten Wert erneut beim Start", "ru": "Снова запишите последнее значение при запуске", "pt": "Registre o último valor novamente na inicialização", "nl": "Log de laatste waarde opnieuw bij het opstarten", "fr": "Enregistrez à nouveau la dernière valeur au démarrage", "it": "Registra di nuovo l'ultimo valore all'avvio", "es": "Registre el último valor nuevamente al inicio", "pl": "Zarejestruj ostatnią wartość ponownie podczas uruchamiania", "zh-cn": "在启动时再次记录最后一个值"},
45
46
  "Lowering the retention period should be considered with caution: Past data exceeding the retention period will be lost.": {"en": "Lowering the retention period should be considered with caution: Past data exceeding the retention period will be lost.", "de": "Eine Verkürzung der Vorhaltezeit ist mit Vorsicht zu genießen: Vergangene Daten, die die Vorhaltezeit überschreiten, gehen verloren.", "ru": "К уменьшению срока хранения следует подходить с осторожностью: прошлые данные, превышающие срок хранения, будут потеряны.", "pt": "A redução do período de retenção deve ser considerada com cautela: os dados anteriores que excederem o período de retenção serão perdidos.", "nl": "Het verlagen van de bewaarperiode moet met de nodige voorzichtigheid worden overwogen: gegevens uit het verleden die de bewaarperiode overschrijden, gaan verloren.", "fr": "La réduction de la période de conservation doit être envisagée avec prudence : les données antérieures dépassant la période de conservation seront perdues.", "it": "La riduzione del periodo di conservazione deve essere considerata con cautela: i dati passati che superano il periodo di conservazione andranno persi.", "es": "Reducir el período de retención debe considerarse con precaución: los datos anteriores que excedan el período de retención se perderán.", "pl": "Obniżenie okresu przechowywania należy rozważać z ostrożnością: Przeszłe dane przekraczające okres przechowywania zostaną utracone.", "zh-cn": "应谨慎考虑降低保留期限:超过保留期限的过去数据将丢失。"},
46
47
  "Milliseconds": { "en": "Milliseconds", "de": "Millisekunden", "ru": "Миллисекунды", "pt": "Milissegundos", "nl": "milliseconden", "fr": "Millisecondes", "it": "Millisecondi", "es": "milisegundos", "pl": "Milisekundy", "zh-cn": "毫秒"},
47
- "Number": { "en": "Number", "de": "Anzahl", "ru": "Количество", "pt": "Número", "nl": "Nummer", "fr": "Numéro", "it": "Numero", "es": "Número", "pl": "Numer", "zh-cn": "数字"},
48
+ "Number": { "en": "Number", "de": "Zahl", "ru": "Количество", "pt": "Número", "nl": "Nummer", "fr": "Numéro", "it": "Numero", "es": "Número", "pl": "Numer", "zh-cn": "数字"},
48
49
  "Number of days to keep the data.": { "en": "Number of days to keep the data.", "de": "Anzahl der Tage, um die Daten aufzubewahren.", "ru": "Количество дней хранения данных.", "pt": "Número de dias para manter os dados.", "nl": "Aantal dagen om de gegevens te bewaren.", "fr": "Nombre de jours de conservation des données.", "it": "Numero di giorni di conservazione dei dati.", "es": "Número de días para conservar los datos.", "pl": "Liczba dni przechowywania danych.", "zh-cn": "保留数据的天数。"},
49
50
  "Ok": { "en": "Ok", "de": "Ok", "ru": "Ok", "pt": "Ok", "nl": "OK", "fr": "Ok", "it": "Ok", "es": "De acuerdo", "pl": "Ok", "zh-cn": "好的"},
50
51
  "Organization": { "en": "Organization", "de": "Organisation", "ru": "Организация", "pt": "Organização", "nl": "Organisatie", "fr": "Organisation", "it": "Organizzazione", "es": "Organización", "pl": "Organizacja", "zh-cn": "组织"},
51
52
  "Password": { "en": "Password", "de": "Passwort", "ru": "Пароль", "pt": "Senha", "nl": "Wachtwoord", "fr": "Password", "it": "Parola d'ordine", "es": "Contraseña", "pl": "Hasło", "zh-cn": "密码"},
52
53
  "Password confirm": { "en": "Password confirm", "de": "Passwort-Wiederholung", "ru": "Подтверждение пароля", "pt": "Confirmação de senha", "nl": "Wachtwoord bevestigen", "fr": "Password confirm", "it": "Conferma la password", "es": "Contraseña confirmada", "pl": "Potwierdź hasło", "zh-cn": "确认密码"},
53
54
  "Please confirm!": { "en": "Please confirm!", "de": "Bitte bestätigen!", "ru": "Пожалуйста подтвердите", "pt": "Por favor confirme", "nl": "Bevestig alstublieft", "fr": "Veuillez confirmer", "it": "Si prega di confermare", "es": "Por favor confirmar", "pl": "Proszę potwierdzić", "zh-cn": "请确认"},
54
- "Port": { "en": "Port", "de": "Port", "ru": "Порт", "pt": "Porta", "nl": "Haven", "fr": "Port", "it": "Porta", "es": "Puerto", "pl": "Port", "zh-cn": "港口"},
55
+ "Port": { "en": "Port", "de": "Port", "ru": "Порт", "pt": "Porta", "nl": "Haven", "fr": "Port", "it": "Porta", "es": "Puerto", "pl": "Port", "zh-cn": "端口"},
55
56
  "Reject on SSL errors": { "en": "Reject on SSL errors", "de": "Ablehnen bei SSL-Fehlern", "ru": "Отклонить при ошибках SSL", "pt": "Rejeitar em erros de SSL", "nl": "Weigeren bij SSL-fouten", "fr": "Rejeter sur les erreurs SSL", "it": "Rifiuta errori SSL", "es": "Rechazar en errores de SSL", "pl": "Odrzuć błędy SSL", "zh-cn": "拒绝 SSL 错误"},
56
57
  "Request timeout": { "en": "Request timeout", "de": "Request Timeout", "ru": "Время ожидания запроса", "pt": "Solicitar tempo limite", "nl": "Verzoek time-out", "fr": "Délai d'expiration de la demande", "it": "Richiedi timeout", "es": "Pide tiempo fuera", "pl": "Limit czasu żądania", "zh-cn": "请求超时"},
57
58
  "Reset DB": { "en": "Reset DB", "de": "Alle Daten in Datenbank löschen", "ru": "Очистить базу", "pt": "Redefinir DB", "nl": "Stel DB opnieuw in", "fr": "Reset DB", "it": "Ripristina DB", "es": "Restablecer DB", "pl": "Zresetuj DB", "zh-cn": "重置数据库"},
@@ -61,9 +62,9 @@ systemDictionary = {
61
62
  "Seconds": { "en": "Seconds", "de": "Sekunden", "ru": "секунд", "pt": "Segundos", "nl": "seconden", "fr": "Seconds", "it": "secondi", "es": "Segundos", "pl": "sekundy", "zh-cn": "秒"},
62
63
  "Send health-check pings to database": { "en": "Send health-check pings to database", "de": "Pings zur Verfügbarkeitsprüfung an die Datenbank senden", "ru": "Отправлять эхо-запросы проверки работоспособности в базу данных", "pt": "Envie pings de verificação de integridade para o banco de dados", "nl": "Stuur gezondheidscheck pings naar database", "fr": "Envoyer des pings de vérification d'état à la base de données", "it": "Invia ping di controllo dello stato al database", "es": "Enviar pings de verificación de estado a la base de datos", "pl": "Wysyłaj pingi sprawdzające kondycję do bazy danych", "zh-cn": "将健康检查 ping 发送到数据库"},
63
64
  "Start or enable adapter first": { "en": "Start or enable adapter first", "de": "Adapter muss zuerst aktiviert werden", "ru": "Сначала надо запустить или активировать драйвер", "pt": "Inicie ou ative o adaptador primeiro", "nl": "Start of schakel eerst de adapter in", "fr": "Start or enable adapter first", "it": "Inizia o abilita prima l'adattatore", "es": "Comience o habilite el adaptador primero", "pl": "Najpierw włącz lub włącz adapter", "zh-cn": "首先启动或启用适配器"},
64
- "Storage retention": { "en": "Storage retention", "de": "Speicheraufbewahrung", "ru": "Сохранение хранения", "pt": "Retenção de armazenamento", "nl": "Opslagbehoud", "fr": "Rétention de stockage", "it": "Conservazione della memoria", "es": "retención de almacenamiento", "pl": "Przechowywanie pamięci", "zh-cn": "存储保留"},
65
+ "Storage retention": { "en": "Storage retention", "de": "Aufbewahrungsdauer", "ru": "Сохранение хранения", "pt": "Retenção de armazenamento", "nl": "Opslagbehoud", "fr": "Rétention de stockage", "it": "Conservazione della memoria", "es": "retención de almacenamiento", "pl": "Przechowywanie pamięci", "zh-cn": "存储保留"},
65
66
  "Store as": { "en": "Store as", "de": "Speichern als", "ru": "Сохранить как", "pt": "Armazenar como", "nl": "Opslaan als", "fr": "Stocker comme", "it": "Conserva come", "es": "Guardar como", "pl": "Przechowuj jako", "zh-cn": "存储为"},
66
- "String": { "en": "String", "de": "Schnur", "ru": "Нить", "pt": "Fragmento", "nl": "Draad", "fr": "Corde", "it": "Corda", "es": "Cuerda", "pl": "Strunowy", "zh-cn": "细绳"},
67
+ "String": { "en": "String", "de": "Zeichenfolge", "ru": "Нить", "pt": "Fragmento", "nl": "Draad", "fr": "Corde", "it": "Corda", "es": "Cuerda", "pl": "Strunowy", "zh-cn": "细绳"},
67
68
  "Test connection": { "en": "Test connection", "de": "Verbindung testen", "ru": "Проверить соединение", "pt": "Conexão de teste", "nl": "Test verbinding", "fr": "Test connection", "it": "Connessione di prova", "es": "Conexión de prueba", "pl": "Testuj połączenie", "zh-cn": "测试连接"},
68
69
  "This feature can only be used on databases that are empty, or already were setup with this feature enabled. Otherwise it will cause errors (see logs).": {"en": "This feature can only be used on databases that are empty, or already were setup with this feature enabled. Otherwise it will cause errors (see logs).", "de": "Diese Funktion kann nur für Datenbanken verwendet werden, die leer sind oder bereits mit aktivierter Funktion eingerichtet wurden. Andernfalls kommt es zu Fehlern (siehe Protokolle).", "ru": "Эту функцию можно использовать только с пустыми базами данных, которые уже были настроены с включенной этой функцией. В противном случае это вызовет ошибки (см. Логи).", "pt": "Este recurso só pode ser usado em bancos de dados que estão vazios ou já foram configurados com este recurso habilitado. Caso contrário, causará erros (consulte os logs).", "nl": "Deze functie kan alleen worden gebruikt op databases die leeg zijn of al zijn ingesteld met deze functie ingeschakeld. Anders veroorzaakt het fouten (zie logs).", "fr": "Cette fonctionnalité ne peut être utilisée que sur des bases de données vides ou déjà configurées avec cette fonctionnalité activée. Sinon, cela provoquera des erreurs (voir les journaux).", "it": "Questa funzione può essere utilizzata solo su database vuoti o già configurati con questa funzione abilitata. Altrimenti causerà errori (vedi log).", "es": "Esta función solo se puede utilizar en bases de datos que estén vacías o que ya se hayan configurado con esta función habilitada. De lo contrario, provocará errores (consulte los registros).", "pl": "Ta funkcja może być używana tylko w przypadku baz danych, które są puste lub zostały już skonfigurowane z włączoną tą funkcją. W przeciwnym razie spowoduje to błędy (patrz logi).", "zh-cn": "此功能只能用于空数据库或已启用此功能设置的数据库。否则会导致错误(见日志)。"},
69
70
  "Token": { "en": "Token", "de": "Token", "ru": "Токен", "pt": "Símbolo", "nl": "Teken", "fr": "Jeton", "it": "Gettone", "es": "Simbólico", "pl": "Znak", "zh-cn": "代币"},
@@ -74,12 +75,12 @@ systemDictionary = {
74
75
  "blockTime": { "en": "Ignore all new values for X ms after last logged value", "de": "Alle neuen Werte für X ms nach dem letzten protokollierten Wert ignorieren", "ru": "Игнорировать все новые значения для X мс после последнего зарегистрированного значения", "pt": "Ignore todos os novos valores por X ms após o último valor registrado", "nl": "Negeer alle nieuwe waarden voor X ms na de laatste gelogde waarde", "fr": "Ignorer toutes les nouvelles valeurs pendant X ms après la dernière valeur enregistrée", "it": "Ignora tutti i nuovi valori per X ms dopo l'ultimo valore registrato", "es": "Ignorar todos los valores nuevos para X ms después del último valor registrado", "pl": "Ignoruj ​​wszystkie nowe wartości przez X ms po ostatniej zarejestrowanej wartości", "zh-cn": "在上次记录值之后忽略 X 毫秒的所有新值"},
75
76
  "debounce": { "en": "Ignore changes till value stays unchanged for X Milliseconds", "de": "Änderungen ignorieren, bis der Wert für X Millisekunden unverändert bleibt", "ru": "Игнорировать изменения до тех пор, пока не будет постоянного значения в течение X миллисекунд", "pt": "Ignorar alterações até que o valor permaneça inalterado por X Milissegundos", "nl": "Wijzigingen negeren totdat waarde ongewijzigd blijft voor X Milliseconds", "fr": "Ignorer les modifications jusqu'à ce que la valeur reste inchangée pour X millisecondes", "it": "Ignora le modifiche fino a quando il valore rimane invariato per X Milliseconds", "es": "Ignorar cambios hasta que el valor permanezca sin cambios durante X milisegundos", "pl": "Zignoruj ​​zmiany, aż wartość pozostanie niezmieniona przez X Milliseconds", "zh-cn": "忽略更改,直到值保持不变为X毫秒"},
76
77
  "health-check help": { "en": "Regular health checks probes are sent to the DB server to check if it is still alive.", "de": "Regelmäßige Verfügbarkeits-Anfragen werden an den DB-Server gesendet, um zu überprüfen, ob er noch aktiv ist.", "ru": "На сервер БД отправляются регулярные зонды проверки работоспособности, чтобы проверить, жив ли он.", "pt": "Sondagens de verificações regulares de integridade são enviadas ao servidor de banco de dados para verificar se ele ainda está ativo.", "nl": "Regelmatige gezondheidscontroles worden naar de DB-server gestuurd om te controleren of deze nog in leven is.", "fr": "Des vérifications de santé régulières sont envoyées au serveur de base de données pour vérifier s'il est toujours actif.", "it": "Controlli di integrità regolari vengono inviati al server DB per verificare se è ancora attivo.", "es": "Se envían sondas de verificación de estado regulares al servidor de base de datos para verificar si todavía está vivo.", "pl": "Regularne sondy sprawdzające kondycję są wysyłane do serwera bazy danych w celu sprawdzenia, czy nadal działa.", "zh-cn": "定期健康检查探针会发送到数据库服务器以检查它是否还活着。"},
77
- "ignore values above x": { "en": "Ignore values above", "de": "Ignorieren Sie die obigen Werte", "ru": "Игнорировать значения выше", "pt": "Ignorar valores acima", "nl": "Bovenstaande waarden negeren", "fr": "Ignorer les valeurs ci-dessus", "it": "Ignora i valori sopra", "es": "Ignorar los valores anteriores", "pl": "Zignoruj ​​wartości powyżej", "zh-cn": "忽略上面的值"},
78
- "ignore values below x": { "en": "Ignore values below", "de": "Ignorieren Sie die folgenden Werte", "ru": "Игнорировать значения ниже", "pt": "Ignorar valores abaixo", "nl": "Negeer onderstaande waarden", "fr": "Ignorer les valeurs ci-dessous", "it": "Ignora i valori sottostanti", "es": "Ignorar valores a continuación", "pl": "Zignoruj ​​wartości poniżej", "zh-cn": "忽略下面的值"},
79
- "ignore values below zero": { "en": "ignore values below zero (<0)", "de": "Ignoriere Werte unter Null (<0)", "ru": "игнорировать значения ниже нуля (<0)", "pt": "ignorar valores abaixo de zero (<0)", "nl": "negeer waarden onder nul (<0)", "fr": "ignorer les valeurs inférieures à zéro (<0)", "it": "ignora i valori inferiori a zero (<0)", "es": "ignorar valores por debajo de cero (<0)", "pl": "zignoruj ​​wartości poniżej zera (<0)", "zh-cn": "忽略零以下的值 (<0)"},
78
+ "ignore values above x": { "en": "Ignore values above", "de": "Ignoriere Werte größer als", "ru": "Игнорировать значения выше", "pt": "Ignorar valores acima", "nl": "Bovenstaande waarden negeren", "fr": "Ignorer les valeurs ci-dessus", "it": "Ignora i valori sopra", "es": "Ignorar los valores anteriores", "pl": "Zignoruj ​​wartości powyżej", "zh-cn": "忽略上面的值"},
79
+ "ignore values below x": { "en": "Ignore values below", "de": "Ignoriere Werte kleiner als", "ru": "Игнорировать значения ниже", "pt": "Ignorar valores abaixo", "nl": "Negeer onderstaande waarden", "fr": "Ignorer les valeurs ci-dessous", "it": "Ignora i valori sottostanti", "es": "Ignorar valores a continuación", "pl": "Zignoruj ​​wartości poniżej", "zh-cn": "忽略下面的值"},
80
+ "ignore values below zero": { "en": "ignore values below zero (<0)", "de": "Werte unter 0 ignorieren (<0)", "ru": "игнорировать значения ниже нуля (<0)", "pt": "ignorar valores abaixo de zero (<0)", "nl": "negeer waarden onder nul (<0)", "fr": "ignorer les valeurs inférieures à zéro (<0)", "it": "ignora i valori inferiori a zero (<0)", "es": "ignorar valores por debajo de cero (<0)", "pl": "zignoruj ​​wartości poniżej zera (<0)", "zh-cn": "忽略零以下的值 (<0)"},
80
81
  "ignore zero or null values": { "en": "ignore 0 or null values (==0)", "de": "Ignoriere 0 oder Nullwerte (==0)", "ru": "игнорировать 0 или нулевые значения (==0)", "pt": "ignore 0 ou valores nulos (==0)", "nl": "negeer 0 of null-waarden (==0)", "fr": "ignorer les valeurs 0 ou nulles (==0)", "it": "ignora 0 o valori nulli (==0)", "es": "ignorar 0 o valores nulos (==0)", "pl": "zignoruj ​​wartości 0 lub null (==0)", "zh-cn": "忽略 0 或空值 (==0)"},
81
82
  "keep forever": { "en": "keep forever", "de": "keine automatische Löschung", "ru": "хранить вечно", "pt": "mantenha para sempre", "nl": "blijf voor altijd", "fr": "keep forever", "it": "tienilo per sempre", "es": "mantener para siempre", "pl": "zachowaj na zawsze", "zh-cn": "永远保持"},
82
- "log changes interval(s)": { "en": "Record the same values (seconds)", "de": "Gleiche Werte aufzeichnen (Sekunden)", "ru": "Запишите те же значения (секунды)", "pt": "Grave os mesmos valores (segundos)", "nl": "Noteer dezelfde waarden (seconden)", "fr": "Enregistrer les mêmes valeurs (secondes)", "it": "Registra gli stessi valori (secondi)", "es": "Registrar los mismos valores (segundos)", "pl": "Zapisz te same wartości (sekundy)", "zh-cn": "记录相同的值(秒)"},
83
+ "log changes interval(s)": { "en": "Record the same values (seconds)", "de": "trotzdem gleiche Werte aufzeichnen (Sekunden)", "ru": "Запишите те же значения (секунды)", "pt": "Grave os mesmos valores (segundos)", "nl": "Noteer dezelfde waarden (seconden)", "fr": "Enregistrer les mêmes valeurs (secondes)", "it": "Registra gli stessi valori (secondi)", "es": "Registrar los mismos valores (segundos)", "pl": "Zapisz te same wartości (sekundy)", "zh-cn": "记录相同的值(秒)"},
83
84
  "log changes minimal delta": { "en": "Minimum difference from last value", "de": "Minimale Differenz zum letzten Wert", "ru": "Минимальная разница от последнего значения", "pt": "Diferença mínima do último valor", "nl": "Minimaal verschil met laatste waarde", "fr": "Différence minimale par rapport à la dernière valeur", "it": "Differenza minima dall'ultimo valore", "es": "Diferencia mínima del último valor", "pl": "Minimalna różnica od ostatniej wartości", "zh-cn": "与上一个值的最小差异"},
84
85
  "log changes only": { "en": "Record changes only", "de": "Nur Änderungen aufzeichnen", "ru": "Записывать только изменения", "pt": "Registrar apenas alterações", "nl": "Alleen wijzigingen opnemen", "fr": "Enregistrer uniquement les modifications", "it": "Registra solo le modifiche", "es": "Registrar solo cambios", "pl": "Nagrywaj tylko zmiany", "zh-cn": "仅记录更改"},
85
86
  "note": { "en": "History settings must be done for every state individually on the tab \"States\" and only if adapter is active", "de": "History Einstellungen müssen für jeden State einzeln gemacht werden, im Tab \"States\" und nur wenn die Adapter Instanz aktiv ist", "ru": "Настройки history делаются для каждого состояния отдельно в закладке \"Состояния\" и только, когда инстанция активирована", "pt": "As configurações de histórico devem ser feitas para cada estado individual na guia \"Estados\" e somente se o adaptador estiver ativo", "nl": "Geschiedenisinstellingen moeten voor elke afzonderlijke status worden uitgevoerd op het tabblad \"Staten\" en alleen als de adapter actief is", "fr": "History settings must be done for every state individually on the tab \"States\" and only if adapter is active", "it": "Le impostazioni della cronologia devono essere eseguite singolarmente per ogni stato nella scheda \"Stati\" e solo se l'adattatore è attivo", "es": "La configuración del historial se debe realizar para cada estado individualmente en la pestaña \"Estados\" y solo si el adaptador está activo", "pl": "Ustawienia historii muszą być wykonane dla każdego stanu indywidualnie na karcie \"Stany\" i tylko wtedy, gdy adapter jest aktywny", "zh-cn": "仅在适配器处于活动状态时,才必须在“状态”选项卡上分别为每个状态进行历史记录设置"},
@@ -88,5 +89,4 @@ systemDictionary = {
88
89
  "retention": { "en": "Storage retention", "de": "Storage Vorhaltezeit", "ru": "Время хранения в базе", "pt": "Retenção de armazenamento", "nl": "Opslag retentie", "fr": "Storage retention", "it": "Conservazione di memoria", "es": "Retención de almacenamiento", "pl": "Przechowywanie danych", "zh-cn": "储存保留"},
89
90
  "use 0 to not buffer at all": { "en": "Use 0 to not buffer at all", "de": "Wert 0 schreibt Werte direkt", "ru": "Для деактвации буферизации введите 0", "pt": "Use 0 para não buffer no total", "nl": "Gebruik 0 om helemaal niet te bufferen", "fr": "Use 0 to not buffer at all", "it": "Utilizzare 0 per non bufferizzare affatto", "es": "Use 0 para no almacenar el búfer en absoluto", "pl": "Użyj 0, aby w ogóle nie buforować", "zh-cn": "使用0根本不缓冲"},
90
91
  "usetags help": { "en": "For more information, please refer to the documentation: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "de": "Weitere Informationen sind in der Dokumentation: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields zu finden.", "ru": "Для получения дополнительной информации обратитесь к документации: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "pt": "Para obter mais informações, consulte a documentação: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "nl": "Raadpleeg de documentatie voor meer informatie: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "fr": "Pour plus d'informations, veuillez vous référer à la documentation : https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "it": "Per ulteriori informazioni, fare riferimento alla documentazione: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "es": "Para obtener más información, consulte la documentación: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "pl": "Więcej informacji można znaleźć w dokumentacji: https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#Store-metadata-information-as-tags-instead-of-fields", "zh-cn": "有关更多信息,请参阅文档:"},
91
- "Log the last value again on startup": { "en": "Log the last value again on startup", "de": "Protokollieren Sie den letzten Wert erneut beim Start", "ru": "Снова запишите последнее значение при запуске", "pt": "Registre o último valor novamente na inicialização", "nl": "Log de laatste waarde opnieuw bij het opstarten", "fr": "Enregistrez à nouveau la dernière valeur au démarrage", "it": "Registra di nuovo l'ultimo valore all'avvio", "es": "Registre el último valor nuevamente al inicio", "pl": "Zarejestruj ostatnią wartość ponownie podczas uruchamiania", "zh-cn": "在启动时再次记录最后一个值"},
92
92
  };
package/io-package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "pl": "Logowanie stanów do InfluxDB",
14
14
  "zh-cn": "将状态记录到InfluxDB中"
15
15
  },
16
- "version": "3.0.1",
16
+ "version": "3.1.1",
17
17
  "title": "Logging data with InfluxDB",
18
18
  "titleLang": {
19
19
  "en": "Logging data with InfluxDB",
@@ -28,6 +28,42 @@
28
28
  "zh-cn": "使用InfluxDB记录数据"
29
29
  },
30
30
  "news": {
31
+ "3.1.1": {
32
+ "en": "Workaround an admin issue when testing connection to InfluxDB",
33
+ "de": "Umgehung eines Administratorproblems beim Testen der Verbindung zu InfluxDB",
34
+ "ru": "Обход проблемы администратора при тестировании подключения к InfluxDB",
35
+ "pt": "Solução alternativa de um problema de administrador ao testar a conexão com o InfluxDB",
36
+ "nl": "Tijdelijke oplossing voor een beheerdersprobleem bij het testen van de verbinding met InfluxDB",
37
+ "fr": "Contournement d'un problème d'administration lors du test de connexion à InfluxDB",
38
+ "it": "Soluzione alternativa a un problema di amministrazione durante il test della connessione a InfluxDB",
39
+ "es": "Solución de un problema de administración al probar la conexión a InfluxDB",
40
+ "pl": "Obejście problemu administratora podczas testowania połączenia z InfluxDB",
41
+ "zh-cn": "在测试与 InfluxDB 的连接时解决管理问题"
42
+ },
43
+ "3.1.0": {
44
+ "en": "Data are not converted to numbers if they are other datatypes on getHistory to respect the saved data formats as defined in the datapoint settings for storage.\nFix retention change to lower checkbox in UI\nAllow storeState again to write to InfluxDB for \"unknown state ids\" - \"rules\" usage is not supported in for this and storeState would be silently discarded in this case!\nFix several crash cases reported by Sentry\nMake sure disabling \"Log changes only\" also really do not log the changes anymore\nAllow storeState and GetHistory also to be called for \"unknown ids\"",
45
+ "de": "Daten werden nicht in Zahlen konvertiert, wenn es sich um andere Datentypen auf getHistory handelt, um die gespeicherten Datenformate zu respektieren, wie sie in den Datenpunkteinstellungen für die Speicherung definiert sind.\nKorrektur der Aufbewahrungsänderung am unteren Kontrollkästchen in der Benutzeroberfläche\nStoreState erneut erlauben, in InfluxDB für \"unbekannte Zustands-IDs\" zu schreiben - die Verwendung von \"Regeln\" wird dafür nicht unterstützt und storeState würde in diesem Fall stillschweigend verworfen!\nMehrere von Sentry gemeldete Absturzfälle behoben\nStellen Sie sicher, dass durch Deaktivieren von \"Nur Änderungen protokollieren\" die Änderungen auch wirklich nicht mehr protokolliert werden\nAufruf von storeState und GetHistory auch für \"unbekannte IDs\" zulassen",
46
+ "ru": "Данные не преобразуются в числа, если они относятся к другим типам данных в getHistory, чтобы соблюдать форматы сохраненных данных, определенные в настройках точки данных для хранения.\nИсправьте изменение сохранения, чтобы опустить флажок в пользовательском интерфейсе.\nРазрешить storeState снова записывать в InfluxDB для «неизвестных идентификаторов состояния» — использование «правил» не поддерживается для этого, и в этом случае storeState будет молча отброшен!\nИсправьте несколько случаев сбоев, о которых сообщил Sentry.\nУбедитесь, что отключение «Только журнал изменений» также действительно больше не регистрирует изменения.\nРазрешить также вызывать storeState и GetHistory для «неизвестных идентификаторов».",
47
+ "pt": "Os dados não são convertidos em números se forem outros tipos de dados em getHistory para respeitar os formatos de dados salvos conforme definido nas configurações do ponto de dados para armazenamento.\nCorrigir a alteração de retenção na caixa de seleção inferior na interface do usuário\nPermitir que storeState grave novamente no InfluxDB para \"ids de estado desconhecidos\" - o uso de \"regras\" não é suportado para isso e storeState seria descartado silenciosamente neste caso!\nCorrija vários casos de travamento relatados pelo Sentinela\nCertifique-se de desativar \"Somente alterações de log\" também não registra mais as alterações\nPermitir que storeState e GetHistory também sejam chamados para \"ids desconhecidos\"",
48
+ "nl": "Gegevens worden niet geconverteerd naar getallen als het andere gegevenstypen op getHistory zijn om de opgeslagen gegevensindelingen te respecteren zoals gedefinieerd in de gegevenspuntinstellingen voor opslag.\nRetentiewijziging repareren om het selectievakje in de gebruikersinterface te verlagen\nSta storeState opnieuw toe om naar InfluxDB te schrijven voor \"onbekende status-ID's\" - het gebruik van \"regels\" wordt hiervoor niet ondersteund en storeState zou in dit geval stil worden weggegooid!\nHerstel verschillende crashgevallen gemeld door Sentry\nZorg ervoor dat het uitschakelen van \"Alleen wijzigingen loggen\" ook echt de wijzigingen niet meer logt\nToestaan dat storeState en GetHistory ook worden aangeroepen voor \"onbekende id's\"",
49
+ "fr": "Les données ne sont pas converties en nombres s'il s'agit d'autres types de données sur getHistory afin de respecter les formats de données enregistrés tels que définis dans les paramètres de point de données pour le stockage.\nCorrection du changement de rétention pour abaisser la case à cocher dans l'interface utilisateur\nAutoriser à nouveau storeState à écrire dans InfluxDB pour les \"identifiants d'état inconnus\" - l'utilisation des \"règles\" n'est pas prise en charge dans ce cas et storeState serait supprimé en silence dans ce cas !\nCorrection de plusieurs cas de crash signalés par Sentry\nAssurez-vous que la désactivation de \"Log changes only\" n'enregistre plus vraiment les modifications\nAutoriser storeState et GetHistory à être également appelés pour les \"identifiants inconnus\"",
50
+ "it": "I dati non vengono convertiti in numeri se sono altri tipi di dati su getHistory per rispettare i formati dei dati salvati come definito nelle impostazioni del punto dati per l'archiviazione.\nCorreggi la modifica della conservazione nella casella di controllo inferiore nell'interfaccia utente\nConsenti a storeState di scrivere nuovamente su InfluxDB per \"ID stato sconosciuto\" - l'utilizzo di \"regole\" non è supportato in questo caso e storeState verrebbe automaticamente eliminato in questo caso!\nRisolvi diversi casi di crash segnalati da Sentry\nAssicurati che la disabilitazione di \"Registra solo modifiche\" non registri più le modifiche\nConsenti anche a storeState e GetHistory di essere chiamati per \"ID sconosciuti\"",
51
+ "es": "Los datos no se convierten en números si son otros tipos de datos en getHistory para respetar los formatos de datos guardados como se define en la configuración del punto de datos para el almacenamiento.\nArreglar el cambio de retención para bajar la casilla de verificación en la interfaz de usuario\nPermita que storeState vuelva a escribir en InfluxDB para \"identificadores de estado desconocidos\": el uso de \"reglas\" no es compatible con esto y storeState se descartaría silenciosamente en este caso.\nSolucione varios casos de bloqueo informados por Sentry\nAsegúrese de deshabilitar \"Registrar solo cambios\" y realmente no registre más los cambios\nPermitir que storeState y GetHistory también se llamen para \"identificadores desconocidos\"",
52
+ "pl": "Dane nie są konwertowane na liczby, jeśli są to inne typy danych w getHistory, aby przestrzegać zapisanych formatów danych zdefiniowanych w ustawieniach punktu danych dla przechowywania.\nNapraw zmianę przechowywania w dolnym polu wyboru w interfejsie użytkownika\nZezwól storeState ponownie na zapis do InfluxDB dla \"nieznanych identyfikatorów stanu\" - użycie \"reguł\" nie jest w tym przypadku obsługiwane, a storeState zostanie w tym przypadku po cichu odrzucone!\nNapraw kilka przypadków awarii zgłoszonych przez Sentry\nUpewnij się, że wyłączenie opcji „Zapisuj tylko zmiany” również naprawdę nie powoduje już rejestrowania zmian\nZezwalaj na wywoływanie storeState i GetHistory również dla „nieznanych identyfikatorów”",
53
+ "zh-cn": "如果数据是 getHistory 上的其他数据类型,则数据不会转换为数字,以尊重数据点设置中定义的已保存数据格式以进行存储。\n将保留更改修复为 UI 中的较低复选框\n再次允许 storeState 为“未知状态 id”写入 InfluxDB - 不支持使用“规则”,在这种情况下 storeState 将被静默丢弃!\n修复 Sentry 报告的几个崩溃案例\n确保禁用“仅记录更改”也确实不再记录更改\n还允许为“未知 ID”调用 storeState 和 GetHistory"
54
+ },
55
+ "3.0.2": {
56
+ "en": "handle an empty Path for InfluxDB 2.0 correctly in all cases",
57
+ "de": "Behandeln Sie einen leeren Pfad für InfluxDB 2.0 in allen Fällen korrekt",
58
+ "ru": "правильно обрабатывать пустой путь для InfluxDB 2.0 во всех случаях",
59
+ "pt": "manipular um caminho vazio para o InfluxDB 2.0 corretamente em todos os casos",
60
+ "nl": "behandel een leeg pad voor InfluxDB 2.0 in alle gevallen correct",
61
+ "fr": "gérer correctement un chemin vide pour InfluxDB 2.0 dans tous les cas",
62
+ "it": "gestire correttamente un percorso vuoto per InfluxDB 2.0 in tutti i casi",
63
+ "es": "manejar una ruta vacía para InfluxDB 2.0 correctamente en todos los casos",
64
+ "pl": "we wszystkich przypadkach poprawnie obsłużyć pustą ścieżkę dla InfluxDB 2.0",
65
+ "zh-cn": "在所有情况下正确处理 InfluxDB 2.0 的空路径"
66
+ },
31
67
  "3.0.1": {
32
68
  "en": "BREAKING: Configuration is only working in the new Admin 5 UI!\nDid bigger adjustments to the recording logic and added a lot of new Features. Please refer to Changelog and Forum post for details.",
33
69
  "de": "BREAKING: Die Konfiguration funktioniert nur in der neuen Admin 5-Benutzeroberfläche!\nGrößere Anpassungen an der Aufnahmelogik vorgenommen und viele neue Features hinzugefügt. Einzelheiten finden Sie im Änderungsprotokoll und im Forumsbeitrag.",
@@ -75,42 +111,6 @@
75
111
  "es": "Solucionar el problema con la actualización de la política de retención para influxDB 1",
76
112
  "pl": "Rozwiąż problem z aktualizacją zasad przechowywania dla influxDB 1",
77
113
  "zh-cn": "解决更新 influxDB 1 保留策略的问题"
78
- },
79
- "2.6.0": {
80
- "en": "Make request timeout configurable - defaults to 30s\nAdd option to also accept self signed ssl certificates for InfluxDB 2.x",
81
- "de": "Anforderungs-Timeout konfigurierbar machen – standardmäßig 30 Sekunden\nOption hinzugefügt, um auch selbstsignierte SSL-Zertifikate für InfluxDB 2.x zu akzeptieren",
82
- "ru": "Сделать время ожидания запроса настраиваемым — по умолчанию 30 с.\nДобавить возможность также принимать самозаверяющие ssl-сертификаты для InfluxDB 2.x.",
83
- "pt": "Tornar o tempo limite de solicitação configurável - o padrão é 30s\nAdicionar opção para também aceitar certificados SSL autoassinados para InfluxDB 2.x",
84
- "nl": "Verzoek time-out configureerbaar maken - standaard ingesteld op 30s\nOptie toevoegen om ook zelfondertekende SSL-certificaten te accepteren voor InfluxDB 2.x",
85
- "fr": "Faire en sorte que le délai d'attente de la demande soit configurable - par défaut à 30 s\nAjouter une option pour accepter également les certificats SSL auto-signés pour InfluxDB 2.x",
86
- "it": "Rendi configurabile il timeout della richiesta: il valore predefinito è 30 secondi\nAggiungi l'opzione per accettare anche certificati SSL autofirmati per InfluxDB 2.x",
87
- "es": "Hacer que el tiempo de espera de la solicitud sea configurable: el valor predeterminado es 30 s\nAgregue la opción para aceptar también certificados SSL autofirmados para InfluxDB 2.x",
88
- "pl": "Ustaw limit czasu żądania konfigurowalny - domyślnie 30s\nDodaj opcję akceptowania również samopodpisanych certyfikatów ssl dla InfluxDB 2.x",
89
- "zh-cn": "使请求超时可配置 - 默认为 30 秒\n添加选项以接受 InfluxDB 2.x 的自签名 ssl 证书"
90
- },
91
- "2.5.2": {
92
- "en": "Marked interpolated data with `i=true`",
93
- "de": "Markierte interpolierte Daten mit `i=true`",
94
- "ru": "Помеченные интерполированные данные с `i=true`",
95
- "pt": "Dados interpolados marcados com `i=true`",
96
- "nl": "Gemarkeerde geïnterpoleerde gegevens met `i=true`",
97
- "fr": "Données interpolées marquées avec `i=true`",
98
- "it": "Dati interpolati contrassegnati con `i=true`",
99
- "es": "Datos interpolados marcados con `i=true`",
100
- "pl": "Oznaczono dane interpolowane za pomocą `i=true`",
101
- "zh-cn": "用 `i=true` 标记插值数据"
102
- },
103
- "2.5.1": {
104
- "en": "Marked interpolated data with `i=true`",
105
- "de": "Markierte interpolierte Daten mit `i=true`",
106
- "ru": "Помеченные интерполированные данные с `i=true`",
107
- "pt": "Dados interpolados marcados com `i=true`",
108
- "nl": "Gemarkeerde geïnterpoleerde gegevens met `i=true`",
109
- "fr": "Données interpolées marquées avec `i=true`",
110
- "it": "Dati interpolati contrassegnati con `i=true`",
111
- "es": "Datos interpolados marcados con `i=true`",
112
- "pl": "Oznaczono dane interpolowane za pomocą `i=true`",
113
- "zh-cn": "用 `i=true` 标记插值数据"
114
114
  }
115
115
  },
116
116
  "mode": "daemon",
@@ -238,7 +238,7 @@
238
238
  "pl": "Ta nowa wersja wprowadza kilka zmian w sposobie rejestrowania wartości, ponieważ naprawiliśmy kilka problemów i dodaliśmy nowe funkcje. W szczególności sprawdź zdefiniowane ustawienia „odbicia” i „czasu blokowania” w punktach danych, jeśli wartości nie są rejestrowane zgodnie z oczekiwaniami i upewnij się, że ustawienia mają sens. Aby uzyskać więcej informacji, zapoznaj się z dziennikiem zmian i Readme.",
239
239
  "zh-cn": "这个新版本引入了一些更改值的记录方式,因为我们修复了几个问题并添加了新功能。如果未按预期记录值,请特别检查数据点中定义的“去抖动”和“阻塞时间”设置,并确保设置有意义。有关更多详细信息,请参阅更改日志和自述文件。"
240
240
  },
241
- "link": "https://github.com/ioBroker/ioBroker.sql/blob/master/docs/en/README.md#settings",
241
+ "link": "https://github.com/ioBroker/ioBroker.influxdb/blob/master/README.md#default-settings",
242
242
  "level": "warn",
243
243
  "linkText": {
244
244
  "en": "Readme",
package/lib/aggregate.js CHANGED
@@ -142,6 +142,11 @@ function aggregationLogic(data, index, options) {
142
142
  log = options.log || console.log;
143
143
  }
144
144
 
145
+ if (!options.result[index]) {
146
+ log(`${options.logId} Data index ${index} not initialized, ignore!`);
147
+ return;
148
+ }
149
+
145
150
  if (options.aggregate !== 'minmax' && !options.result[index].val.ts) {
146
151
  options.result[index].val.ts = Math.round(options.start + (((index - 1) + 0.5) * options.step));
147
152
  }
package/main.js CHANGED
@@ -13,6 +13,7 @@ const [appName, adapterName] = require('./package.json').name.split('.');
13
13
  const Aggregate = require('./lib/aggregate.js');
14
14
  const dataDir = path.normalize(`${utils.controllerDir}/${require(`${utils.controllerDir}/lib/tools`).getDefaultDataDir()}`);
15
15
  const cacheFile = `${dataDir}influxdata.json`;
16
+ const { isObject } = require('./lib/tools.js');
16
17
 
17
18
  let adapter;
18
19
 
@@ -295,7 +296,9 @@ function ping(adapter) {
295
296
  }
296
297
 
297
298
  function connect(adapter) {
298
- if (adapter.config.path.startsWith('/')) {
299
+ if (!adapter.config.path) {
300
+ adapter.config.path = '';
301
+ } else if (adapter.config.path.startsWith('/')) {
299
302
  adapter.config.path = adapter.config.path.substring(1);
300
303
  }
301
304
 
@@ -442,6 +445,9 @@ function getRetention(adapter, msg) {
442
445
 
443
446
  function testConnection(adapter, msg) {
444
447
  adapter.log.debug(`testConnection msg-object: ${JSON.stringify(msg)}`);
448
+ if (!msg || !msg.message || !isObject(msg.message.config)) {
449
+ return adapter.sendTo(msg.from, msg.command, {error: 'Invalid test configuration.'}, msg.callback);
450
+ }
445
451
  msg.message.config.port = parseInt(msg.message.config.port, 10) || 0;
446
452
  msg.message.config.requestTimeout = parseInt(msg.message.config.requestTimeout) || 30000;
447
453
 
@@ -982,7 +988,7 @@ function pushHistory(adapter, id, state, timerRelog) {
982
988
  adapter._influxDPs[id].lastLogTime = state.ts;
983
989
  settings.enableDebugLogs && adapter.log.debug(`Value logged ${id}, value=${adapter._influxDPs[id].state.val}, ts=${adapter._influxDPs[id].state.ts}`);
984
990
  pushHelper(adapter, id);
985
- if (settings.changesRelogInterval > 0) {
991
+ if (settings.changesOnly && settings.changesRelogInterval > 0) {
986
992
  adapter._influxDPs[id].relogTimeout = setTimeout(reLogHelper, settings.changesRelogInterval * 1000, adapter, id);
987
993
  }
988
994
  }, settings.debounceTime, id, state);
@@ -994,7 +1000,7 @@ function pushHistory(adapter, id, state, timerRelog) {
994
1000
 
995
1001
  settings.enableDebugLogs && adapter.log.debug(`Value logged ${id}, value=${adapter._influxDPs[id].state.val}, ts=${adapter._influxDPs[id].state.ts}`);
996
1002
  pushHelper(adapter, id, state);
997
- if (settings.changesRelogInterval > 0) {
1003
+ if (settings.changesOnly && settings.changesRelogInterval > 0) {
998
1004
  adapter._influxDPs[id].relogTimeout = setTimeout(reLogHelper, settings.changesRelogInterval * 1000, adapter, id);
999
1005
  }
1000
1006
  }
@@ -1007,12 +1013,12 @@ function reLogHelper(adapter, _id) {
1007
1013
  return;
1008
1014
  }
1009
1015
  adapter._influxDPs[_id].relogTimeout = null;
1010
- adapter._influxDPs[_id].relogTimeout = null;
1011
1016
  if (adapter._influxDPs[_id].skipped) {
1012
1017
  pushHistory(adapter, _id, adapter._influxDPs[_id].skipped, true);
1013
1018
  } else if (adapter._influxDPs[_id].state) {
1014
1019
  pushHistory(adapter, _id, adapter._influxDPs[_id].state, true);
1015
- } else { adapter.getForeignState(adapter._influxDPs[_id].realId, (err, state) => {
1020
+ } else {
1021
+ adapter.getForeignState(adapter._influxDPs[_id].realId, (err, state) => {
1016
1022
  if (err) {
1017
1023
  adapter.log.info(`init timed Relog: can not get State for ${_id}: ${err}`);
1018
1024
  } else if (!state) {
@@ -1027,14 +1033,15 @@ function reLogHelper(adapter, _id) {
1027
1033
  }
1028
1034
 
1029
1035
  function pushHelper(adapter, _id, state, cb) {
1030
- if (!adapter._influxDPs[_id] || !adapter._influxDPs[_id][adapter.namespace] || (!adapter._influxDPs[_id].state && !state)) {
1031
- return cb && setImmediate(cb, `ID ${_id} not activated for logging`);
1036
+ if (!state && (!adapter._influxDPs[_id] && !adapter._influxDPs[_id].state)) {
1037
+ return cb && setImmediate(cb, `No state to log for ID ${_id}`);
1032
1038
  }
1033
1039
  if (!state) {
1034
1040
  state = adapter._influxDPs[_id].state;
1035
1041
  }
1036
1042
 
1037
- const _settings = adapter._influxDPs[_id][adapter.namespace];
1043
+ // Important: We allow also to store "unknown" states, so use fallback here
1044
+ const _settings = adapter._influxDPs[_id] && adapter._influxDPs[_id][adapter.namespace] || {};
1038
1045
 
1039
1046
  if (state.val === null) { // InfluxDB can not handle null values
1040
1047
  return cb && setImmediate(cb, `null value for ${_id} can not be handled`);
@@ -1089,23 +1096,14 @@ function pushValueIntoDB(adapter, id, state, directWrite, cb) {
1089
1096
  return cb && cb(`InfluxDB can not handle non finite values like ${state.val}`);
1090
1097
  }
1091
1098
 
1092
- state.ts = parseInt(state.ts, 10);
1099
+ if (isFinite(state.ts)) {
1100
+ state.ts = parseInt(state.ts, 10) || 0;
1101
+ }
1093
1102
 
1094
1103
  if (typeof state.val === 'object') {
1095
1104
  state.val = JSON.stringify(state.val);
1096
1105
  }
1097
1106
 
1098
- /*
1099
- if (state.val === 'true') {
1100
- state.val = true;
1101
- } else if (state.val === 'false') {
1102
- state.val = false;
1103
- } else {
1104
- // try to convert to float
1105
- const f = parseFloat(state.val);
1106
- if (f == state.val) state.val = f;
1107
- }*/
1108
-
1109
1107
  //adapter.log.debug('write value ' + state.val + ' for ' + id);
1110
1108
  const influxFields = {
1111
1109
  value: state.val,
@@ -1701,7 +1699,30 @@ function updateState(adapter, msg) {
1701
1699
  }
1702
1700
  }
1703
1701
 
1704
- function storeState(adapter, msg) {
1702
+ function storeStatePushData(adapter, id, state, applyRules) {
1703
+ if (!state || typeof state !== 'object') {
1704
+ throw new Error(`State ${JSON.stringify(state)} for ${id} is not valid`);
1705
+ }
1706
+
1707
+ let pushFunc = applyRules ? pushHistory : pushHelper;
1708
+ if (!adapter._influxDPs[id] || !adapter._influxDPs[id][adapter.namespace]) {
1709
+ if (applyRules) {
1710
+ throw new Error(`history not enabled for ${id}, so can not apply the rules as requested`);
1711
+ }
1712
+ adapter._influxDPs[id] = adapter._influxDPs[id] || {};
1713
+ }
1714
+ return new Promise((resolve, reject) => {
1715
+ pushFunc(adapter, id, state , err => {
1716
+ if (err) {
1717
+ reject(new Error(`Error writing state for ${id}: ${err.message}, Data: ${JSON.stringify(state)}`));
1718
+ } else {
1719
+ resolve(true);
1720
+ }
1721
+ });
1722
+ });
1723
+ }
1724
+
1725
+ async function storeState(adapter, msg) {
1705
1726
  if (!msg.message) {
1706
1727
  adapter.log.error('storeState called with invalid data');
1707
1728
  return adapter.sendTo(msg.from, msg.command, {
@@ -1709,45 +1730,58 @@ function storeState(adapter, msg) {
1709
1730
  }, msg.callback);
1710
1731
  }
1711
1732
 
1712
- let pushFunc = pushHelper;
1713
- if (msg.message.rules) {
1714
- pushFunc = pushHistory;
1715
- }
1716
-
1717
- let id;
1733
+ let errors = [];
1734
+ let successCount = 0;
1718
1735
  if (Array.isArray(msg.message)) {
1719
1736
  adapter.log.debug(`storeState ${msg.message.length} items`);
1720
1737
  for (let i = 0; i < msg.message.length; i++) {
1721
- id = adapter._aliasMap[msg.message[i].id] ? adapter._aliasMap[msg.message[i].id] : msg.message[i].id;
1722
- if (msg.message[i].state && typeof msg.message[i].state === 'object') {
1723
- pushFunc(adapter, id, msg.message[i].state);
1724
- } else {
1725
- adapter.log.warn(`Invalid state for ${JSON.stringify(msg.message[i])}`);
1738
+ const id = adapter._aliasMap[msg.message[i].id] ? adapter._aliasMap[msg.message[i].id] : msg.message[i].id;
1739
+ try {
1740
+ await storeStatePushData(adapter, id, msg.message[i].state, msg.message.rules);
1741
+ successCount++;
1742
+ } catch (err) {
1743
+ errors.push(err.message);
1726
1744
  }
1727
1745
  }
1728
- } else if (msg.message.state && Array.isArray(msg.message.state)) {
1746
+ } else if (msg.message.id && Array.isArray(msg.message.state)) {
1729
1747
  adapter.log.debug(`storeState ${msg.message.state.length} items`);
1730
- id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1748
+ const id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1731
1749
  for (let j = 0; j < msg.message.state.length; j++) {
1732
- if (msg.message.state[j] && typeof msg.message.state[j] === 'object') {
1733
- pushFunc(adapter, id, msg.message.state[j]);
1734
- } else {
1735
- adapter.log.warn(`Invalid state for ${JSON.stringify(msg.message.state[j])}`);
1750
+ try {
1751
+ await storeStatePushData(adapter, id, msg.message.state[j], msg.message.rules);
1752
+ successCount++;
1753
+ } catch (err) {
1754
+ errors.push(err.message);
1736
1755
  }
1737
1756
  }
1738
- } else if (msg.message.id && msg.message.state && typeof msg.message.state === 'object') {
1757
+ } else if (msg.message.id && msg.message.state) {
1739
1758
  adapter.log.debug('storeState 1 item');
1740
- id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1741
- pushFunc(adapter, id, msg.message.state);
1759
+ const id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1760
+ try {
1761
+ await storeStatePushData(adapter, id, msg.message.state, msg.message.rules);
1762
+ successCount++;
1763
+ } catch (err) {
1764
+ errors.push(err.message);
1765
+ }
1742
1766
  } else {
1743
1767
  adapter.log.error('storeState called with invalid data');
1744
1768
  return adapter.sendTo(msg.from, msg.command, {
1745
1769
  error: `Invalid call: ${JSON.stringify(msg)}`
1746
1770
  }, msg.callback);
1747
1771
  }
1772
+ if (errors.length) {
1773
+ adapter.log.warn(`storeState executed with ${errors.length} errors: ${errors.join(', ')}`);
1774
+ return adapter.sendTo(msg.from, msg.command, {
1775
+ error: `${errors.length} errors happened while storing data`,
1776
+ errors: errors,
1777
+ successCount
1778
+ }, msg.callback);
1779
+ }
1748
1780
 
1781
+ adapter.log.debug(`storeState executed with ${successCount} states successfully`);
1749
1782
  adapter.sendTo(msg.from, msg.command, {
1750
1783
  success: true,
1784
+ successCount,
1751
1785
  connected: !!adapter._connected,
1752
1786
  seriesBufferCounter: adapter._seriesBufferCounter,
1753
1787
  seriesBufferFlushPlanned: adapter._seriesBufferFlushPlanned
@@ -1870,6 +1904,26 @@ function getHistory(adapter, msg) {
1870
1904
  logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
1871
1905
  };
1872
1906
 
1907
+ try {
1908
+ if (options.start && typeof options.start !== 'number') {
1909
+ options.start = new Date(options.start).getTime();
1910
+ }
1911
+ } catch (err) {
1912
+ return adapter.sendTo(msg.from, msg.command, {
1913
+ error: 'Invalid call. Start date ' + JSON.stringify(options.start) + ' is not a valid date'
1914
+ }, msg.callback);
1915
+ }
1916
+
1917
+ try {
1918
+ if (options.end && typeof options.end !== 'number') {
1919
+ options.end = new Date(options.end).getTime();
1920
+ }
1921
+ } catch (err) {
1922
+ return adapter.sendTo(msg.from, msg.command, {
1923
+ error: 'Invalid call. End date ' + JSON.stringify(options.end) + ' is not a valid date'
1924
+ }, msg.callback);
1925
+ }
1926
+
1873
1927
  if (!options.start && options.count) {
1874
1928
  options.returnNewestEntries = true;
1875
1929
  }
@@ -1885,6 +1939,7 @@ function getHistory(adapter, msg) {
1885
1939
  options.round = adapter.config.round;
1886
1940
  }
1887
1941
 
1942
+ adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
1888
1943
  const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
1889
1944
 
1890
1945
  debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
@@ -1908,15 +1963,6 @@ function getHistory(adapter, msg) {
1908
1963
  options.integralUnit = 60;
1909
1964
  }
1910
1965
 
1911
- if (!adapter._influxDPs[options.id]) {
1912
- adapter.sendTo(msg.from, msg.command, {
1913
- result: [],
1914
- step: 0,
1915
- error: `Logging not activated for ${options.id}`
1916
- }, msg.callback);
1917
- return;
1918
- }
1919
-
1920
1966
  if (options.start > options.end) {
1921
1967
  const _end = options.end;
1922
1968
  options.end = options.start;
@@ -2047,6 +2093,9 @@ function getHistory(adapter, msg) {
2047
2093
  adapter.log.info(`Error storing buffered series for ${options.id} before GetHistory: ${err}`);
2048
2094
  }
2049
2095
  setTimeout(() => {
2096
+ if (!adapter._client) {
2097
+ return Aggregate.sendResponse(adapter, msg, options, 'Database no longer connected', startTime);
2098
+ }
2050
2099
  adapter._client.query(query, (error, rows) => {
2051
2100
  if (error) {
2052
2101
  if (adapter._client.request.getHostsAvailable().length === 0) {
@@ -2071,13 +2120,8 @@ function getHistory(adapter, msg) {
2071
2120
  rows[qr][rr].ts = new Date(rows[qr][rr].time).getTime();
2072
2121
  delete rows[qr][rr].time;
2073
2122
 
2074
- if (rows[qr][rr].val !== null) {
2075
- if (isFinite(rows[qr][rr].val)) {
2076
- rows[qr][rr].val = parseFloat(rows[qr][rr].val);
2077
- if (options.round) {
2078
- rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2079
- }
2080
- }
2123
+ if (typeof rows[qr][rr].val === 'number' && options.round) {
2124
+ rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2081
2125
  }
2082
2126
 
2083
2127
  if (options.addId) {
@@ -2124,6 +2168,26 @@ function getHistoryIflx2(adapter, msg) {
2124
2168
  logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
2125
2169
  };
2126
2170
 
2171
+ try {
2172
+ if (options.start && typeof options.start !== 'number') {
2173
+ options.start = new Date(options.start).getTime();
2174
+ }
2175
+ } catch (err) {
2176
+ return adapter.sendTo(msg.from, msg.command, {
2177
+ error: 'Invalid call. Start date ' + JSON.stringify(options.start) + ' is not a valid date'
2178
+ }, msg.callback);
2179
+ }
2180
+
2181
+ try {
2182
+ if (options.end && typeof options.end !== 'number') {
2183
+ options.end = new Date(options.end).getTime();
2184
+ }
2185
+ } catch (err) {
2186
+ return adapter.sendTo(msg.from, msg.command, {
2187
+ error: 'Invalid call. End date ' + JSON.stringify(options.end) + ' is not a valid date'
2188
+ }, msg.callback);
2189
+ }
2190
+
2127
2191
  if (!options.start && options.count) {
2128
2192
  options.returnNewestEntries = true;
2129
2193
  }
@@ -2139,6 +2203,7 @@ function getHistoryIflx2(adapter, msg) {
2139
2203
  options.round = adapter.config.round;
2140
2204
  }
2141
2205
 
2206
+ adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
2142
2207
  const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
2143
2208
 
2144
2209
  debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) call: ${JSON.stringify(options)}`);
@@ -2162,14 +2227,6 @@ function getHistoryIflx2(adapter, msg) {
2162
2227
  options.integralUnit = 60;
2163
2228
  }
2164
2229
 
2165
- if (!adapter._influxDPs[options.id] || !adapter._influxDPs[options.id][adapter.namespace]) {
2166
- return adapter.sendTo(msg.from, msg.command, {
2167
- result: [],
2168
- step: 0,
2169
- error: `Logging not activated for ${options.id}`
2170
- }, msg.callback);
2171
- }
2172
-
2173
2230
  if (options.start > options.end) {
2174
2231
  const _end = options.end;
2175
2232
  options.end = options.start;
@@ -2214,8 +2271,11 @@ function getHistoryIflx2(adapter, msg) {
2214
2271
  }
2215
2272
  setTimeout(() => {
2216
2273
  adapter._client.query(booleanTypeCheckQuery, (error, rslt) => {
2274
+ if (!adapter._influxDPs[options.id]) {
2275
+ return;
2276
+ }
2217
2277
  let supportsAggregates;
2218
- if (adapter._influxDPs[options.id][adapter.namespace].storageType && adapter._influxDPs[options.id][adapter.namespace].storageType !== 'Number') {
2278
+ if (adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].storageType && adapter._influxDPs[options.id][adapter.namespace].storageType !== 'Number') {
2219
2279
  supportsAggregates = false;
2220
2280
  } else if (error) {
2221
2281
  if (error.message.includes('type conflict: bool')) {
@@ -2238,9 +2298,9 @@ function getHistoryIflx2(adapter, msg) {
2238
2298
  }
2239
2299
  }
2240
2300
  if (supportsAggregates) {
2241
- if (adapter._influxDPs[options.id][adapter.namespace].state && typeof adapter._influxDPs[options.id][adapter.namespace].state.val !== 'number') {
2301
+ if (adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].state && typeof adapter._influxDPs[options.id][adapter.namespace].state.val !== 'number') {
2242
2302
  supportsAggregates = false;
2243
- } else if (adapter._influxDPs[options.id][adapter.namespace].skipped && typeof adapter._influxDPs[options.id][adapter.namespace].skipped.val !== 'number') {
2303
+ } else if (adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].skipped && typeof adapter._influxDPs[options.id][adapter.namespace].skipped.val !== 'number') {
2244
2304
  supportsAggregates = false;
2245
2305
  }
2246
2306
  }
@@ -2372,13 +2432,8 @@ function getHistoryIflx2(adapter, msg) {
2372
2432
  delete rows[qr][rr].value;
2373
2433
  }
2374
2434
 
2375
- if (rows[qr][rr].val !== null) {
2376
- if (isFinite(rows[qr][rr].val)) {
2377
- rows[qr][rr].val = parseFloat(rows[qr][rr].val);
2378
- if (options.round) {
2379
- rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2380
- }
2381
- }
2435
+ if (typeof rows[qr][rr].val === 'number' && options.round) {
2436
+ rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2382
2437
  }
2383
2438
 
2384
2439
  if (rows[qr][rr].time) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "iobroker.influxdb",
3
3
  "description": "Log states in InfluxDB",
4
- "version": "3.0.1",
4
+ "version": "3.1.1",
5
5
  "author": "bluefox <dogafox@gmail.com>",
6
6
  "contributors": [
7
7
  "bluefox <dogafox@gmail.com>",