iobroker.influxdb 3.0.2 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md 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,17 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
445
450
  -->
446
451
 
447
452
  ## Changelog
453
+ ### 3.1.2 (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
+
448
464
  ### 3.0.2 (2022-05-12)
449
465
  * (Apollon77) handle an empty Path for InfluxDB 2.0 correctly in all cases
450
466
 
@@ -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.2",
16
+ "version": "3.1.2",
17
17
  "title": "Logging data with InfluxDB",
18
18
  "titleLang": {
19
19
  "en": "Logging data with InfluxDB",
@@ -28,6 +28,30 @@
28
28
  "zh-cn": "使用InfluxDB记录数据"
29
29
  },
30
30
  "news": {
31
+ "3.1.2": {
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
+ },
31
55
  "3.0.2": {
32
56
  "en": "handle an empty Path for InfluxDB 2.0 correctly in all cases",
33
57
  "de": "Behandeln Sie einen leeren Pfad für InfluxDB 2.0 in allen Fällen korrekt",
@@ -87,30 +111,6 @@
87
111
  "es": "Solucionar el problema con la actualización de la política de retención para influxDB 1",
88
112
  "pl": "Rozwiąż problem z aktualizacją zasad przechowywania dla influxDB 1",
89
113
  "zh-cn": "解决更新 influxDB 1 保留策略的问题"
90
- },
91
- "2.6.0": {
92
- "en": "Make request timeout configurable - defaults to 30s\nAdd option to also accept self signed ssl certificates for InfluxDB 2.x",
93
- "de": "Anforderungs-Timeout konfigurierbar machen – standardmäßig 30 Sekunden\nOption hinzugefügt, um auch selbstsignierte SSL-Zertifikate für InfluxDB 2.x zu akzeptieren",
94
- "ru": "Сделать время ожидания запроса настраиваемым — по умолчанию 30 с.\nДобавить возможность также принимать самозаверяющие ssl-сертификаты для InfluxDB 2.x.",
95
- "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",
96
- "nl": "Verzoek time-out configureerbaar maken - standaard ingesteld op 30s\nOptie toevoegen om ook zelfondertekende SSL-certificaten te accepteren voor InfluxDB 2.x",
97
- "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",
98
- "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",
99
- "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",
100
- "pl": "Ustaw limit czasu żądania konfigurowalny - domyślnie 30s\nDodaj opcję akceptowania również samopodpisanych certyfikatów ssl dla InfluxDB 2.x",
101
- "zh-cn": "使请求超时可配置 - 默认为 30 秒\n添加选项以接受 InfluxDB 2.x 的自签名 ssl 证书"
102
- },
103
- "2.5.2": {
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
@@ -14,6 +14,14 @@ 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
16
 
17
+ function isObject(it) {
18
+ // This is necessary because:
19
+ // typeof null === 'object'
20
+ // typeof [] === 'object'
21
+ // [] instanceof Object === true
22
+ return Object.prototype.toString.call(it) === '[object Object]';
23
+ }
24
+
17
25
  let adapter;
18
26
 
19
27
  function isEqual(a, b) {
@@ -444,6 +452,9 @@ function getRetention(adapter, msg) {
444
452
 
445
453
  function testConnection(adapter, msg) {
446
454
  adapter.log.debug(`testConnection msg-object: ${JSON.stringify(msg)}`);
455
+ if (!msg || !msg.message || !isObject(msg.message.config)) {
456
+ return adapter.sendTo(msg.from, msg.command, {error: 'Invalid test configuration.'}, msg.callback);
457
+ }
447
458
  msg.message.config.port = parseInt(msg.message.config.port, 10) || 0;
448
459
  msg.message.config.requestTimeout = parseInt(msg.message.config.requestTimeout) || 30000;
449
460
 
@@ -984,7 +995,7 @@ function pushHistory(adapter, id, state, timerRelog) {
984
995
  adapter._influxDPs[id].lastLogTime = state.ts;
985
996
  settings.enableDebugLogs && adapter.log.debug(`Value logged ${id}, value=${adapter._influxDPs[id].state.val}, ts=${adapter._influxDPs[id].state.ts}`);
986
997
  pushHelper(adapter, id);
987
- if (settings.changesRelogInterval > 0) {
998
+ if (settings.changesOnly && settings.changesRelogInterval > 0) {
988
999
  adapter._influxDPs[id].relogTimeout = setTimeout(reLogHelper, settings.changesRelogInterval * 1000, adapter, id);
989
1000
  }
990
1001
  }, settings.debounceTime, id, state);
@@ -996,7 +1007,7 @@ function pushHistory(adapter, id, state, timerRelog) {
996
1007
 
997
1008
  settings.enableDebugLogs && adapter.log.debug(`Value logged ${id}, value=${adapter._influxDPs[id].state.val}, ts=${adapter._influxDPs[id].state.ts}`);
998
1009
  pushHelper(adapter, id, state);
999
- if (settings.changesRelogInterval > 0) {
1010
+ if (settings.changesOnly && settings.changesRelogInterval > 0) {
1000
1011
  adapter._influxDPs[id].relogTimeout = setTimeout(reLogHelper, settings.changesRelogInterval * 1000, adapter, id);
1001
1012
  }
1002
1013
  }
@@ -1009,12 +1020,12 @@ function reLogHelper(adapter, _id) {
1009
1020
  return;
1010
1021
  }
1011
1022
  adapter._influxDPs[_id].relogTimeout = null;
1012
- adapter._influxDPs[_id].relogTimeout = null;
1013
1023
  if (adapter._influxDPs[_id].skipped) {
1014
1024
  pushHistory(adapter, _id, adapter._influxDPs[_id].skipped, true);
1015
1025
  } else if (adapter._influxDPs[_id].state) {
1016
1026
  pushHistory(adapter, _id, adapter._influxDPs[_id].state, true);
1017
- } else { adapter.getForeignState(adapter._influxDPs[_id].realId, (err, state) => {
1027
+ } else {
1028
+ adapter.getForeignState(adapter._influxDPs[_id].realId, (err, state) => {
1018
1029
  if (err) {
1019
1030
  adapter.log.info(`init timed Relog: can not get State for ${_id}: ${err}`);
1020
1031
  } else if (!state) {
@@ -1029,14 +1040,15 @@ function reLogHelper(adapter, _id) {
1029
1040
  }
1030
1041
 
1031
1042
  function pushHelper(adapter, _id, state, cb) {
1032
- if (!adapter._influxDPs[_id] || !adapter._influxDPs[_id][adapter.namespace] || (!adapter._influxDPs[_id].state && !state)) {
1033
- return cb && setImmediate(cb, `ID ${_id} not activated for logging`);
1043
+ if (!state && (!adapter._influxDPs[_id] && !adapter._influxDPs[_id].state)) {
1044
+ return cb && setImmediate(cb, `No state to log for ID ${_id}`);
1034
1045
  }
1035
1046
  if (!state) {
1036
1047
  state = adapter._influxDPs[_id].state;
1037
1048
  }
1038
1049
 
1039
- const _settings = adapter._influxDPs[_id][adapter.namespace];
1050
+ // Important: We allow also to store "unknown" states, so use fallback here
1051
+ const _settings = adapter._influxDPs[_id] && adapter._influxDPs[_id][adapter.namespace] || {};
1040
1052
 
1041
1053
  if (state.val === null) { // InfluxDB can not handle null values
1042
1054
  return cb && setImmediate(cb, `null value for ${_id} can not be handled`);
@@ -1091,23 +1103,14 @@ function pushValueIntoDB(adapter, id, state, directWrite, cb) {
1091
1103
  return cb && cb(`InfluxDB can not handle non finite values like ${state.val}`);
1092
1104
  }
1093
1105
 
1094
- state.ts = parseInt(state.ts, 10);
1106
+ if (isFinite(state.ts)) {
1107
+ state.ts = parseInt(state.ts, 10) || 0;
1108
+ }
1095
1109
 
1096
1110
  if (typeof state.val === 'object') {
1097
1111
  state.val = JSON.stringify(state.val);
1098
1112
  }
1099
1113
 
1100
- /*
1101
- if (state.val === 'true') {
1102
- state.val = true;
1103
- } else if (state.val === 'false') {
1104
- state.val = false;
1105
- } else {
1106
- // try to convert to float
1107
- const f = parseFloat(state.val);
1108
- if (f == state.val) state.val = f;
1109
- }*/
1110
-
1111
1114
  //adapter.log.debug('write value ' + state.val + ' for ' + id);
1112
1115
  const influxFields = {
1113
1116
  value: state.val,
@@ -1703,7 +1706,30 @@ function updateState(adapter, msg) {
1703
1706
  }
1704
1707
  }
1705
1708
 
1706
- function storeState(adapter, msg) {
1709
+ function storeStatePushData(adapter, id, state, applyRules) {
1710
+ if (!state || typeof state !== 'object') {
1711
+ throw new Error(`State ${JSON.stringify(state)} for ${id} is not valid`);
1712
+ }
1713
+
1714
+ let pushFunc = applyRules ? pushHistory : pushHelper;
1715
+ if (!adapter._influxDPs[id] || !adapter._influxDPs[id][adapter.namespace]) {
1716
+ if (applyRules) {
1717
+ throw new Error(`history not enabled for ${id}, so can not apply the rules as requested`);
1718
+ }
1719
+ adapter._influxDPs[id] = adapter._influxDPs[id] || {};
1720
+ }
1721
+ return new Promise((resolve, reject) => {
1722
+ pushFunc(adapter, id, state , err => {
1723
+ if (err) {
1724
+ reject(new Error(`Error writing state for ${id}: ${err.message}, Data: ${JSON.stringify(state)}`));
1725
+ } else {
1726
+ resolve(true);
1727
+ }
1728
+ });
1729
+ });
1730
+ }
1731
+
1732
+ async function storeState(adapter, msg) {
1707
1733
  if (!msg.message) {
1708
1734
  adapter.log.error('storeState called with invalid data');
1709
1735
  return adapter.sendTo(msg.from, msg.command, {
@@ -1711,45 +1737,58 @@ function storeState(adapter, msg) {
1711
1737
  }, msg.callback);
1712
1738
  }
1713
1739
 
1714
- let pushFunc = pushHelper;
1715
- if (msg.message.rules) {
1716
- pushFunc = pushHistory;
1717
- }
1718
-
1719
- let id;
1740
+ let errors = [];
1741
+ let successCount = 0;
1720
1742
  if (Array.isArray(msg.message)) {
1721
1743
  adapter.log.debug(`storeState ${msg.message.length} items`);
1722
1744
  for (let i = 0; i < msg.message.length; i++) {
1723
- id = adapter._aliasMap[msg.message[i].id] ? adapter._aliasMap[msg.message[i].id] : msg.message[i].id;
1724
- if (msg.message[i].state && typeof msg.message[i].state === 'object') {
1725
- pushFunc(adapter, id, msg.message[i].state);
1726
- } else {
1727
- adapter.log.warn(`Invalid state for ${JSON.stringify(msg.message[i])}`);
1745
+ const id = adapter._aliasMap[msg.message[i].id] ? adapter._aliasMap[msg.message[i].id] : msg.message[i].id;
1746
+ try {
1747
+ await storeStatePushData(adapter, id, msg.message[i].state, msg.message.rules);
1748
+ successCount++;
1749
+ } catch (err) {
1750
+ errors.push(err.message);
1728
1751
  }
1729
1752
  }
1730
- } else if (msg.message.state && Array.isArray(msg.message.state)) {
1753
+ } else if (msg.message.id && Array.isArray(msg.message.state)) {
1731
1754
  adapter.log.debug(`storeState ${msg.message.state.length} items`);
1732
- id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1755
+ const id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1733
1756
  for (let j = 0; j < msg.message.state.length; j++) {
1734
- if (msg.message.state[j] && typeof msg.message.state[j] === 'object') {
1735
- pushFunc(adapter, id, msg.message.state[j]);
1736
- } else {
1737
- adapter.log.warn(`Invalid state for ${JSON.stringify(msg.message.state[j])}`);
1757
+ try {
1758
+ await storeStatePushData(adapter, id, msg.message.state[j], msg.message.rules);
1759
+ successCount++;
1760
+ } catch (err) {
1761
+ errors.push(err.message);
1738
1762
  }
1739
1763
  }
1740
- } else if (msg.message.id && msg.message.state && typeof msg.message.state === 'object') {
1764
+ } else if (msg.message.id && msg.message.state) {
1741
1765
  adapter.log.debug('storeState 1 item');
1742
- id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1743
- pushFunc(adapter, id, msg.message.state);
1766
+ const id = adapter._aliasMap[msg.message.id] ? adapter._aliasMap[msg.message.id] : msg.message.id;
1767
+ try {
1768
+ await storeStatePushData(adapter, id, msg.message.state, msg.message.rules);
1769
+ successCount++;
1770
+ } catch (err) {
1771
+ errors.push(err.message);
1772
+ }
1744
1773
  } else {
1745
1774
  adapter.log.error('storeState called with invalid data');
1746
1775
  return adapter.sendTo(msg.from, msg.command, {
1747
1776
  error: `Invalid call: ${JSON.stringify(msg)}`
1748
1777
  }, msg.callback);
1749
1778
  }
1779
+ if (errors.length) {
1780
+ adapter.log.warn(`storeState executed with ${errors.length} errors: ${errors.join(', ')}`);
1781
+ return adapter.sendTo(msg.from, msg.command, {
1782
+ error: `${errors.length} errors happened while storing data`,
1783
+ errors: errors,
1784
+ successCount
1785
+ }, msg.callback);
1786
+ }
1750
1787
 
1788
+ adapter.log.debug(`storeState executed with ${successCount} states successfully`);
1751
1789
  adapter.sendTo(msg.from, msg.command, {
1752
1790
  success: true,
1791
+ successCount,
1753
1792
  connected: !!adapter._connected,
1754
1793
  seriesBufferCounter: adapter._seriesBufferCounter,
1755
1794
  seriesBufferFlushPlanned: adapter._seriesBufferFlushPlanned
@@ -1872,6 +1911,26 @@ function getHistory(adapter, msg) {
1872
1911
  logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
1873
1912
  };
1874
1913
 
1914
+ try {
1915
+ if (options.start && typeof options.start !== 'number') {
1916
+ options.start = new Date(options.start).getTime();
1917
+ }
1918
+ } catch (err) {
1919
+ return adapter.sendTo(msg.from, msg.command, {
1920
+ error: 'Invalid call. Start date ' + JSON.stringify(options.start) + ' is not a valid date'
1921
+ }, msg.callback);
1922
+ }
1923
+
1924
+ try {
1925
+ if (options.end && typeof options.end !== 'number') {
1926
+ options.end = new Date(options.end).getTime();
1927
+ }
1928
+ } catch (err) {
1929
+ return adapter.sendTo(msg.from, msg.command, {
1930
+ error: 'Invalid call. End date ' + JSON.stringify(options.end) + ' is not a valid date'
1931
+ }, msg.callback);
1932
+ }
1933
+
1875
1934
  if (!options.start && options.count) {
1876
1935
  options.returnNewestEntries = true;
1877
1936
  }
@@ -1887,6 +1946,7 @@ function getHistory(adapter, msg) {
1887
1946
  options.round = adapter.config.round;
1888
1947
  }
1889
1948
 
1949
+ adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
1890
1950
  const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
1891
1951
 
1892
1952
  debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
@@ -1910,15 +1970,6 @@ function getHistory(adapter, msg) {
1910
1970
  options.integralUnit = 60;
1911
1971
  }
1912
1972
 
1913
- if (!adapter._influxDPs[options.id]) {
1914
- adapter.sendTo(msg.from, msg.command, {
1915
- result: [],
1916
- step: 0,
1917
- error: `Logging not activated for ${options.id}`
1918
- }, msg.callback);
1919
- return;
1920
- }
1921
-
1922
1973
  if (options.start > options.end) {
1923
1974
  const _end = options.end;
1924
1975
  options.end = options.start;
@@ -2049,6 +2100,9 @@ function getHistory(adapter, msg) {
2049
2100
  adapter.log.info(`Error storing buffered series for ${options.id} before GetHistory: ${err}`);
2050
2101
  }
2051
2102
  setTimeout(() => {
2103
+ if (!adapter._client) {
2104
+ return Aggregate.sendResponse(adapter, msg, options, 'Database no longer connected', startTime);
2105
+ }
2052
2106
  adapter._client.query(query, (error, rows) => {
2053
2107
  if (error) {
2054
2108
  if (adapter._client.request.getHostsAvailable().length === 0) {
@@ -2073,13 +2127,8 @@ function getHistory(adapter, msg) {
2073
2127
  rows[qr][rr].ts = new Date(rows[qr][rr].time).getTime();
2074
2128
  delete rows[qr][rr].time;
2075
2129
 
2076
- if (rows[qr][rr].val !== null) {
2077
- if (isFinite(rows[qr][rr].val)) {
2078
- rows[qr][rr].val = parseFloat(rows[qr][rr].val);
2079
- if (options.round) {
2080
- rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2081
- }
2082
- }
2130
+ if (typeof rows[qr][rr].val === 'number' && options.round) {
2131
+ rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2083
2132
  }
2084
2133
 
2085
2134
  if (options.addId) {
@@ -2126,6 +2175,26 @@ function getHistoryIflx2(adapter, msg) {
2126
2175
  logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
2127
2176
  };
2128
2177
 
2178
+ try {
2179
+ if (options.start && typeof options.start !== 'number') {
2180
+ options.start = new Date(options.start).getTime();
2181
+ }
2182
+ } catch (err) {
2183
+ return adapter.sendTo(msg.from, msg.command, {
2184
+ error: 'Invalid call. Start date ' + JSON.stringify(options.start) + ' is not a valid date'
2185
+ }, msg.callback);
2186
+ }
2187
+
2188
+ try {
2189
+ if (options.end && typeof options.end !== 'number') {
2190
+ options.end = new Date(options.end).getTime();
2191
+ }
2192
+ } catch (err) {
2193
+ return adapter.sendTo(msg.from, msg.command, {
2194
+ error: 'Invalid call. End date ' + JSON.stringify(options.end) + ' is not a valid date'
2195
+ }, msg.callback);
2196
+ }
2197
+
2129
2198
  if (!options.start && options.count) {
2130
2199
  options.returnNewestEntries = true;
2131
2200
  }
@@ -2141,6 +2210,7 @@ function getHistoryIflx2(adapter, msg) {
2141
2210
  options.round = adapter.config.round;
2142
2211
  }
2143
2212
 
2213
+ adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
2144
2214
  const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
2145
2215
 
2146
2216
  debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) call: ${JSON.stringify(options)}`);
@@ -2164,14 +2234,6 @@ function getHistoryIflx2(adapter, msg) {
2164
2234
  options.integralUnit = 60;
2165
2235
  }
2166
2236
 
2167
- if (!adapter._influxDPs[options.id] || !adapter._influxDPs[options.id][adapter.namespace]) {
2168
- return adapter.sendTo(msg.from, msg.command, {
2169
- result: [],
2170
- step: 0,
2171
- error: `Logging not activated for ${options.id}`
2172
- }, msg.callback);
2173
- }
2174
-
2175
2237
  if (options.start > options.end) {
2176
2238
  const _end = options.end;
2177
2239
  options.end = options.start;
@@ -2216,8 +2278,11 @@ function getHistoryIflx2(adapter, msg) {
2216
2278
  }
2217
2279
  setTimeout(() => {
2218
2280
  adapter._client.query(booleanTypeCheckQuery, (error, rslt) => {
2281
+ if (!adapter._influxDPs[options.id]) {
2282
+ return;
2283
+ }
2219
2284
  let supportsAggregates;
2220
- if (adapter._influxDPs[options.id][adapter.namespace].storageType && adapter._influxDPs[options.id][adapter.namespace].storageType !== 'Number') {
2285
+ 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') {
2221
2286
  supportsAggregates = false;
2222
2287
  } else if (error) {
2223
2288
  if (error.message.includes('type conflict: bool')) {
@@ -2240,9 +2305,9 @@ function getHistoryIflx2(adapter, msg) {
2240
2305
  }
2241
2306
  }
2242
2307
  if (supportsAggregates) {
2243
- if (adapter._influxDPs[options.id][adapter.namespace].state && typeof adapter._influxDPs[options.id][adapter.namespace].state.val !== 'number') {
2308
+ 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') {
2244
2309
  supportsAggregates = false;
2245
- } else if (adapter._influxDPs[options.id][adapter.namespace].skipped && typeof adapter._influxDPs[options.id][adapter.namespace].skipped.val !== 'number') {
2310
+ } 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') {
2246
2311
  supportsAggregates = false;
2247
2312
  }
2248
2313
  }
@@ -2374,13 +2439,8 @@ function getHistoryIflx2(adapter, msg) {
2374
2439
  delete rows[qr][rr].value;
2375
2440
  }
2376
2441
 
2377
- if (rows[qr][rr].val !== null) {
2378
- if (isFinite(rows[qr][rr].val)) {
2379
- rows[qr][rr].val = parseFloat(rows[qr][rr].val);
2380
- if (options.round) {
2381
- rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2382
- }
2383
- }
2442
+ if (typeof rows[qr][rr].val === 'number' && options.round) {
2443
+ rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
2384
2444
  }
2385
2445
 
2386
2446
  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.2",
4
+ "version": "3.1.2",
5
5
  "author": "bluefox <dogafox@gmail.com>",
6
6
  "contributors": [
7
7
  "bluefox <dogafox@gmail.com>",
@@ -29,8 +29,7 @@
29
29
  "@alcalzone/release-script": "^3.5.9",
30
30
  "@alcalzone/release-script-plugin-iobroker": "^3.5.9",
31
31
  "@alcalzone/release-script-plugin-license": "^3.5.9",
32
- "axios": "^0.27.2",
33
- "gulp": "^4.0.2",
32
+ "@iobroker/adapter-dev": "^1.0.0",
34
33
  "mocha": "^9.2.2",
35
34
  "chai": "^4.3.6"
36
35
  },
@@ -53,7 +52,8 @@
53
52
  "release": "release-script",
54
53
  "release-patch": "release-script patch --yes",
55
54
  "release-minor": "release-script minor --yes",
56
- "release-major": "release-script major --yes"
55
+ "release-major": "release-script major --yes",
56
+ "translate": "translate-adapter"
57
57
  },
58
58
  "license": "MIT"
59
59
  }
package/lib/tools.js DELETED
@@ -1,99 +0,0 @@
1
- const axios = require('axios').default;
2
-
3
- /**
4
- * Tests whether the given variable is a real object and not an Array
5
- * @param {any} it The variable to test
6
- * @returns {it is Record<string, any>}
7
- */
8
- function isObject(it) {
9
- // This is necessary because:
10
- // typeof null === 'object'
11
- // typeof [] === 'object'
12
- // [] instanceof Object === true
13
- return Object.prototype.toString.call(it) === '[object Object]';
14
- }
15
-
16
- /**
17
- * Tests whether the given variable is really an Array
18
- * @param {any} it The variable to test
19
- * @returns {it is any[]}
20
- */
21
- function isArray(it) {
22
- if (typeof Array.isArray === 'function') return Array.isArray(it);
23
- return Object.prototype.toString.call(it) === '[object Array]';
24
- }
25
-
26
- /**
27
- * Translates text to the target language. Automatically chooses the right translation API.
28
- * @param {string} text The text to translate
29
- * @param {string} targetLang The target languate
30
- * @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers
31
- * @returns {Promise<string>}
32
- */
33
- async function translateText(text, targetLang, yandexApiKey) {
34
- if (targetLang === 'en') {
35
- return text;
36
- } else if (!text) {
37
- return '';
38
- }
39
- if (yandexApiKey) {
40
- return translateYandex(text, targetLang, yandexApiKey);
41
- } else {
42
- return translateGoogle(text, targetLang);
43
- }
44
- }
45
-
46
- /**
47
- * Translates text with Yandex API
48
- * @param {string} text The text to translate
49
- * @param {string} targetLang The target languate
50
- * @param {string} apiKey The yandex API key. You can create one for free at https://translate.yandex.com/developers
51
- * @returns {Promise<string>}
52
- */
53
- async function translateYandex(text, targetLang, apiKey) {
54
- if (targetLang === 'zh-cn') {
55
- targetLang = 'zh';
56
- }
57
- try {
58
- const url = `https://translate.yandex.net/api/v1.5/tr.json/translate?key=${apiKey}&text=${encodeURIComponent(text)}&lang=en-${targetLang}`;
59
- const response = await axios({url, timeout: 15000});
60
- if (response.data && response.data.text && isArray(response.data.text)) {
61
- return response.data.text[0];
62
- }
63
- throw new Error('Invalid response for translate request');
64
- } catch (e) {
65
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
66
- }
67
- }
68
-
69
- /**
70
- * Translates text with Google API
71
- * @param {string} text The text to translate
72
- * @param {string} targetLang The target languate
73
- * @returns {Promise<string>}
74
- */
75
- async function translateGoogle(text, targetLang) {
76
- try {
77
- const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
78
- const response = await axios({url, timeout: 15000});
79
- if (isArray(response.data)) {
80
- // we got a valid response
81
- return response.data[0][0][0];
82
- }
83
- throw new Error('Invalid response for translate request');
84
- } catch (e) {
85
- if (e.response && e.response.status === 429) {
86
- throw new Error(
87
- `Could not translate to "${targetLang}": Rate-limited by Google Translate`
88
- );
89
- } else {
90
- throw new Error(`Could not translate to "${targetLang}": ${e}`);
91
- }
92
- }
93
- }
94
-
95
- module.exports = {
96
- isArray,
97
- isObject,
98
- translateText
99
- };