iobroker.influxdb 3.1.5 → 3.1.8
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 +11 -0
- package/admin/jsonConfig.json +1 -1
- package/io-package.json +37 -37
- package/lib/aggregate.js +15 -8
- package/main.js +34 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -67,6 +67,8 @@ InfluxDB is very strict on data types. The datatype for a measurement value is d
|
|
|
67
67
|
The adapter tries to write with the correct value, but if the datatype changes for the same state then there may be the write
|
|
68
68
|
errors in the InfluxDB. The adapter detects this and will write these potential conflicting data points always directly, but write errors mean that the value is not written into the DB at all. So make sure to check the logs for such cases.
|
|
69
69
|
|
|
70
|
+
**In Version 1.x and 2.x of the adapter it could also be that some values were converted wrong when no datatype was defined. E.g. a String like "37.5;foo bar" was converted to a number 37.5 in older versions. The version 3 odf the adapter will detect that this is not a valid number and will not convert this value. This could lead to type conflicts after the update. Please check these values and think if you need to store it and how (for the future).**
|
|
71
|
+
|
|
70
72
|
Additionally, InfluxDB do not support "null" values, so these are not written at all into the DB.
|
|
71
73
|
|
|
72
74
|
## Installation of InfluxDB
|
|
@@ -450,6 +452,15 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
450
452
|
-->
|
|
451
453
|
|
|
452
454
|
## Changelog
|
|
455
|
+
### 3.1.8 (2022-08-13)
|
|
456
|
+
* (Apollon77) Fix crash cases reported by Sentry
|
|
457
|
+
|
|
458
|
+
### 3.1.7 (2022-06-27)
|
|
459
|
+
* (Apollon77) Allow to remove a configuration value for "round" in config again
|
|
460
|
+
|
|
461
|
+
### 3.1.6 (2022-06-27)
|
|
462
|
+
* (Apollon77) When not count is provided for aggregate "none" or "onchange" then the limit (default 2000) is used as count to define the number of data to return.
|
|
463
|
+
|
|
453
464
|
### 3.1.5 (2022-06-12)
|
|
454
465
|
* (Apollon77) Make sure debug log is active according to the settings
|
|
455
466
|
|
package/admin/jsonConfig.json
CHANGED
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.1.
|
|
16
|
+
"version": "3.1.8",
|
|
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.8": {
|
|
32
|
+
"en": "Fix crash cases reported by Sentry",
|
|
33
|
+
"de": "Reparieren Crashfälle gemeldet von Sentry",
|
|
34
|
+
"ru": "Исправление случаев аварии, описанных Sentry",
|
|
35
|
+
"pt": "Corrigir casos de acidente relatados por Sentry",
|
|
36
|
+
"nl": "Vertaling:",
|
|
37
|
+
"fr": "Troubles de crash signalés par Sentry",
|
|
38
|
+
"it": "Correzione dei casi di crash segnalati da Sentry",
|
|
39
|
+
"es": "Casos de accidente fijo reportados por Sentry",
|
|
40
|
+
"pl": "Sprawy katastrofy Fix podane przez Sentry’a",
|
|
41
|
+
"zh-cn": "Sentry所报告的六例事故"
|
|
42
|
+
},
|
|
43
|
+
"3.1.7": {
|
|
44
|
+
"en": "Allow to remove a configuration value for \"round\" in config again",
|
|
45
|
+
"de": "Lassen Sie einen Konfigurationswert für Runde in config wieder entfernen",
|
|
46
|
+
"ru": "Разрешить удалить конфигурационную ценность для раунда в config снова",
|
|
47
|
+
"pt": "Permitir remover um valor de configuração para round em config novamente",
|
|
48
|
+
"nl": "Sta toe om weer een configuratiewaarde te verwijderen voor ronde in het leger",
|
|
49
|
+
"fr": "Permettre de supprimer une valeur de configuration pour round in config à nouveau",
|
|
50
|
+
"it": "Permette di rimuovere un valore di configurazione per round in config di nuovo",
|
|
51
|
+
"es": "Permitir eliminar de nuevo un valor de configuración para redondear en configuración",
|
|
52
|
+
"pl": "Allow, aby usunąć wartość konfiguracyjna w zakręcie ponownie w konfigunie",
|
|
53
|
+
"zh-cn": "允许再次取消一轮谈判的组合价值"
|
|
54
|
+
},
|
|
55
|
+
"3.1.6": {
|
|
56
|
+
"en": "When not count is provided for aggregate \"none\" or \"onchange\" then the limit (default 2000) is used as count to define the number of data to return.",
|
|
57
|
+
"de": "Wenn für die Aggregate keine oder Onchange keine Zählung vorgesehen ist, wird die Grenze (Standard 2000) als Zählung verwendet, um die Anzahl der Daten zu definieren, um zurückzukehren.",
|
|
58
|
+
"ru": "Когда не считать предоставляется для агрегата ни один или онмен, то предел (по умолчанию 2000) используется как считать, чтобы определить количество данных для возврата.",
|
|
59
|
+
"pt": "Quando não a contagem é fornecida para agregar nenhum ou onchange, então o limite (padrão 2000) é usado como contagem para definir o número de dados para retornar.",
|
|
60
|
+
"nl": "Als de tel niet wordt toegewezen voor aggregate noch onchange, dan wordt de limiet 2000 gebruikt om het aantal data te definiëren om terug te keren.",
|
|
61
|
+
"fr": "Lorsqu'il n'y a pas de comptage pour l'agrégat ou le changement, la limite (par défaut 2000) est utilisée pour définir le nombre de données à retourner.",
|
|
62
|
+
"it": "Quando il conteggio non viene fornito per aggregato nessuno o cambio, il limite (default 2000) viene utilizzato come conteggio per definire il numero di dati da restituire.",
|
|
63
|
+
"es": "Cuando no se cuenta se proporciona para agregado ninguno o cambio entonces el límite (por defecto 2000) se utiliza como cuenta para definir el número de datos para regresar.",
|
|
64
|
+
"pl": "Jeśli nieliczanie jest dostarczane dla agregacji ani zmian, to limit (default 2000) jest używany jako określenie liczby danych do powrotu.",
|
|
65
|
+
"zh-cn": "当没有计算总额时,或当时的汇率(2000年)用来确定返回的数据数量。."
|
|
66
|
+
},
|
|
31
67
|
"3.1.5": {
|
|
32
68
|
"en": "Make sure debug log is active according to the settings",
|
|
33
69
|
"de": "Stellen Sie sicher, dass das Debug-Log gemäß den Einstellungen aktiv ist",
|
|
@@ -75,42 +111,6 @@
|
|
|
75
111
|
"es": "Solución de un problema de administración al probar la conexión a InfluxDB",
|
|
76
112
|
"pl": "Obejście problemu administratora podczas testowania połączenia z InfluxDB",
|
|
77
113
|
"zh-cn": "在测试与 InfluxDB 的连接时解决管理问题"
|
|
78
|
-
},
|
|
79
|
-
"3.1.0": {
|
|
80
|
-
"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\"",
|
|
81
|
-
"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",
|
|
82
|
-
"ru": "Данные не преобразуются в числа, если они относятся к другим типам данных в getHistory, чтобы соблюдать форматы сохраненных данных, определенные в настройках точки данных для хранения.\nИсправьте изменение сохранения, чтобы опустить флажок в пользовательском интерфейсе.\nРазрешить storeState снова записывать в InfluxDB для «неизвестных идентификаторов состояния» — использование «правил» не поддерживается для этого, и в этом случае storeState будет молча отброшен!\nИсправьте несколько случаев сбоев, о которых сообщил Sentry.\nУбедитесь, что отключение «Только журнал изменений» также действительно больше не регистрирует изменения.\nРазрешить также вызывать storeState и GetHistory для «неизвестных идентификаторов».",
|
|
83
|
-
"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\"",
|
|
84
|
-
"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\"",
|
|
85
|
-
"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\"",
|
|
86
|
-
"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\"",
|
|
87
|
-
"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\"",
|
|
88
|
-
"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”",
|
|
89
|
-
"zh-cn": "如果数据是 getHistory 上的其他数据类型,则数据不会转换为数字,以尊重数据点设置中定义的已保存数据格式以进行存储。\n将保留更改修复为 UI 中的较低复选框\n再次允许 storeState 为“未知状态 id”写入 InfluxDB - 不支持使用“规则”,在这种情况下 storeState 将被静默丢弃!\n修复 Sentry 报告的几个崩溃案例\n确保禁用“仅记录更改”也确实不再记录更改\n还允许为“未知 ID”调用 storeState 和 GetHistory"
|
|
90
|
-
},
|
|
91
|
-
"3.0.2": {
|
|
92
|
-
"en": "handle an empty Path for InfluxDB 2.0 correctly in all cases",
|
|
93
|
-
"de": "Behandeln Sie einen leeren Pfad für InfluxDB 2.0 in allen Fällen korrekt",
|
|
94
|
-
"ru": "правильно обрабатывать пустой путь для InfluxDB 2.0 во всех случаях",
|
|
95
|
-
"pt": "manipular um caminho vazio para o InfluxDB 2.0 corretamente em todos os casos",
|
|
96
|
-
"nl": "behandel een leeg pad voor InfluxDB 2.0 in alle gevallen correct",
|
|
97
|
-
"fr": "gérer correctement un chemin vide pour InfluxDB 2.0 dans tous les cas",
|
|
98
|
-
"it": "gestire correttamente un percorso vuoto per InfluxDB 2.0 in tutti i casi",
|
|
99
|
-
"es": "manejar una ruta vacía para InfluxDB 2.0 correctamente en todos los casos",
|
|
100
|
-
"pl": "we wszystkich przypadkach poprawnie obsłużyć pustą ścieżkę dla InfluxDB 2.0",
|
|
101
|
-
"zh-cn": "在所有情况下正确处理 InfluxDB 2.0 的空路径"
|
|
102
|
-
},
|
|
103
|
-
"3.0.1": {
|
|
104
|
-
"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.",
|
|
105
|
-
"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.",
|
|
106
|
-
"ru": "НАРУШЕНИЕ: Конфигурация работает только в новом пользовательском интерфейсе Admin 5!\nВнесены большие коррективы в логику записи и добавлено много новых функций. Пожалуйста, обратитесь к журналу изменений и сообщению на форуме для получения подробной информации.",
|
|
107
|
-
"pt": "URGENTE: a configuração está funcionando apenas na nova interface do usuário do Admin 5!\nFez ajustes maiores na lógica de gravação e adicionou muitos novos recursos. Consulte o Changelog e a postagem do fórum para obter detalhes.",
|
|
108
|
-
"nl": "BREAKING: Configuratie werkt alleen in de nieuwe Admin 5 UI!\nHeeft grotere aanpassingen gedaan aan de opnamelogica en veel nieuwe functies toegevoegd. Raadpleeg de Changelog en Forumpost voor details.",
|
|
109
|
-
"fr": "RUPTURE : La configuration ne fonctionne que dans la nouvelle interface utilisateur d'Admin 5 !\nA apporté de plus grands ajustements à la logique d'enregistrement et ajouté de nombreuses nouvelles fonctionnalités. Veuillez vous référer au changelog et au post du forum pour plus de détails.",
|
|
110
|
-
"it": "ROTTURA: la configurazione funziona solo nella nuova interfaccia utente di Admin 5!\nHa apportato maggiori modifiche alla logica di registrazione e aggiunto molte nuove funzionalità. Si prega di fare riferimento a Changelog e post sul forum per i dettagli.",
|
|
111
|
-
"es": "ÚLTIMA HORA: ¡La configuración solo funciona en la nueva interfaz de usuario de Admin 5!\nHizo ajustes más grandes a la lógica de grabación y agregó muchas características nuevas. Consulte el registro de cambios y la publicación del foro para obtener más detalles.",
|
|
112
|
-
"pl": "ŁAMANIE: Konfiguracja działa tylko w nowym interfejsie użytkownika Admin 5!\nWprowadziłem większe poprawki w logice nagrywania i dodałem wiele nowych funkcji. Więcej informacji można znaleźć w dzienniku zmian i poście na forum.",
|
|
113
|
-
"zh-cn": "突破:配置仅在新的 Admin 5 UI 中有效!\n对录制逻辑进行了更大的调整,并添加了许多新功能。有关详细信息,请参阅变更日志和论坛帖子。"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"mode": "daemon",
|
package/lib/aggregate.js
CHANGED
|
@@ -48,7 +48,12 @@ function initAggregate(options) {
|
|
|
48
48
|
|
|
49
49
|
log(`${options.logId} Initialize: maxIndex = ${options.maxIndex}, step = ${options.step}, start = ${options.start}, end = ${options.end}`);
|
|
50
50
|
// pre-fill the result with timestamps (add one before start and one after end)
|
|
51
|
-
|
|
51
|
+
try {
|
|
52
|
+
options.result.length = options.maxIndex + 2;
|
|
53
|
+
} catch (err) {
|
|
54
|
+
err.message += `: ${options.maxIndex + 2}`;
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
52
57
|
// We define the array length but do not prefill values, we do that on runtime when needed
|
|
53
58
|
options.result[0] = {
|
|
54
59
|
val: {ts: null, val: null},
|
|
@@ -855,7 +860,7 @@ function sendResponseCounter(adapter, msg, options, data, startTime) {
|
|
|
855
860
|
data.unshift({ts: options.start, val, i: true});
|
|
856
861
|
}
|
|
857
862
|
|
|
858
|
-
if (data[data.length - 2].ts === options.end) {
|
|
863
|
+
if (data[data.length - 2] !== undefined && data[data.length - 2].ts === options.end) {
|
|
859
864
|
data.length--;
|
|
860
865
|
}
|
|
861
866
|
|
|
@@ -863,7 +868,7 @@ function sendResponseCounter(adapter, msg, options, data, startTime) {
|
|
|
863
868
|
const beforeLast = data[data.length - 2];
|
|
864
869
|
|
|
865
870
|
// interpolate from end time to last
|
|
866
|
-
if (options.end < veryLast.ts) {
|
|
871
|
+
if (veryLast !== undefined && beforeLast !== undefined && options.end < veryLast.ts) {
|
|
867
872
|
const val = beforeLast.val + (veryLast.val - beforeLast.val) * ((options.end - beforeLast.ts) / (veryLast.ts - beforeLast.ts));
|
|
868
873
|
data.length--;
|
|
869
874
|
data.push({ts: options.end, val, i: true});
|
|
@@ -871,13 +876,15 @@ function sendResponseCounter(adapter, msg, options, data, startTime) {
|
|
|
871
876
|
|
|
872
877
|
// at this point we expect [6.5, 9, 1, 4]
|
|
873
878
|
// at this point we expect [150, 200, 500, 0, 400, 0, 50]
|
|
874
|
-
let val = data[data.length - 1].val;
|
|
875
879
|
let sum = 0;
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
880
|
+
if (data.length > 1) {
|
|
881
|
+
let val = data[data.length - 1].val;
|
|
882
|
+
for (let i = data.length - 2; i >= 0; i--) {
|
|
883
|
+
if (data[i].val < val) {
|
|
884
|
+
sum += val - data[i].val;
|
|
885
|
+
}
|
|
886
|
+
val = data[i].val;
|
|
879
887
|
}
|
|
880
|
-
val = data[i].val;
|
|
881
888
|
}
|
|
882
889
|
|
|
883
890
|
adapter.sendTo(msg.from, msg.command, {
|
package/main.js
CHANGED
|
@@ -1911,6 +1911,16 @@ function getHistory(adapter, msg) {
|
|
|
1911
1911
|
logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
|
|
1912
1912
|
};
|
|
1913
1913
|
|
|
1914
|
+
adapter.log.debug(`${options.logId} getHistory message: ${JSON.stringify(msg.message)}`);
|
|
1915
|
+
|
|
1916
|
+
if (!options.count || isNaN(options.count)) {
|
|
1917
|
+
if (options.aggregate === 'none' || options.aggregate === 'onchange') {
|
|
1918
|
+
options.count = options.limit;
|
|
1919
|
+
} else {
|
|
1920
|
+
options.count = 500;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1914
1924
|
try {
|
|
1915
1925
|
if (options.start && typeof options.start !== 'number') {
|
|
1916
1926
|
options.start = new Date(options.start).getTime();
|
|
@@ -1949,8 +1959,6 @@ function getHistory(adapter, msg) {
|
|
|
1949
1959
|
adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
|
|
1950
1960
|
const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
|
|
1951
1961
|
|
|
1952
|
-
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
|
|
1953
|
-
|
|
1954
1962
|
if (options.id && adapter._aliasMap[options.id]) {
|
|
1955
1963
|
options.id = adapter._aliasMap[options.id];
|
|
1956
1964
|
}
|
|
@@ -1980,6 +1988,8 @@ function getHistory(adapter, msg) {
|
|
|
1980
1988
|
options.start = options.end - 86400000; // - 1 day
|
|
1981
1989
|
}
|
|
1982
1990
|
|
|
1991
|
+
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
|
|
1992
|
+
|
|
1983
1993
|
let resultsFromInfluxDB = options.aggregate !== 'onchange' && options.aggregate !== 'none' && options.aggregate !== 'minmax';
|
|
1984
1994
|
if (options.aggregate === 'integral' && options.integralInterpolation === 'linear') {
|
|
1985
1995
|
resultsFromInfluxDB = false;
|
|
@@ -2140,7 +2150,11 @@ function getHistory(adapter, msg) {
|
|
|
2140
2150
|
result = result.sort(sortByTs);
|
|
2141
2151
|
}
|
|
2142
2152
|
|
|
2143
|
-
|
|
2153
|
+
try {
|
|
2154
|
+
Aggregate.sendResponse(adapter, msg, options, (error ? error.toString() : null) || result, startTime);
|
|
2155
|
+
} catch (e) {
|
|
2156
|
+
Aggregate.sendResponse(adapter, msg, options, e.toString(), startTime);
|
|
2157
|
+
}
|
|
2144
2158
|
});
|
|
2145
2159
|
}, storedCount ? 50 : 0);
|
|
2146
2160
|
});
|
|
@@ -2175,6 +2189,16 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2175
2189
|
logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
|
|
2176
2190
|
};
|
|
2177
2191
|
|
|
2192
|
+
adapter.log.debug(`${options.logId} getHistory message: ${JSON.stringify(msg.message)}`);
|
|
2193
|
+
|
|
2194
|
+
if (!options.count || isNaN(options.count)) {
|
|
2195
|
+
if (options.aggregate === 'none' || options.aggregate === 'onchange') {
|
|
2196
|
+
options.count = options.limit;
|
|
2197
|
+
} else {
|
|
2198
|
+
options.count = 500;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2178
2202
|
try {
|
|
2179
2203
|
if (options.start && typeof options.start !== 'number') {
|
|
2180
2204
|
options.start = new Date(options.start).getTime();
|
|
@@ -2213,8 +2237,6 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2213
2237
|
adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
|
|
2214
2238
|
const debugLog = options.debugLog = !!((adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs) || adapter.config.enableDebugLogs);
|
|
2215
2239
|
|
|
2216
|
-
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) call: ${JSON.stringify(options)}`);
|
|
2217
|
-
|
|
2218
2240
|
if (options.id && adapter._aliasMap[options.id]) {
|
|
2219
2241
|
options.id = adapter._aliasMap[options.id];
|
|
2220
2242
|
}
|
|
@@ -2244,6 +2266,8 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2244
2266
|
options.start = options.end - 86400000; // - 1 day
|
|
2245
2267
|
}
|
|
2246
2268
|
|
|
2269
|
+
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) options final: ${JSON.stringify(options)}`);
|
|
2270
|
+
|
|
2247
2271
|
const resultsFromInfluxDB = options.aggregate !== 'onchange' && options.aggregate !== 'none' && options.aggregate !== 'minmax';
|
|
2248
2272
|
|
|
2249
2273
|
// query one timegroup-value more than requested originally at start and end
|
|
@@ -2481,7 +2505,11 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2481
2505
|
options.log = adapter.log.debug;
|
|
2482
2506
|
}
|
|
2483
2507
|
|
|
2484
|
-
|
|
2508
|
+
try {
|
|
2509
|
+
Aggregate.sendResponse(adapter, msg, options, (error ? error.toString() : null) || result, startTime);
|
|
2510
|
+
} catch (e) {
|
|
2511
|
+
Aggregate.sendResponse(adapter, msg, options, e.toString(), startTime);
|
|
2512
|
+
}
|
|
2485
2513
|
});
|
|
2486
2514
|
});
|
|
2487
2515
|
}, storedCount ? 50 : 0);
|
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.1.
|
|
4
|
+
"version": "3.1.8",
|
|
5
5
|
"author": "bluefox <dogafox@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"bluefox <dogafox@gmail.com>",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
],
|
|
21
21
|
"optionalDependencies": {},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@influxdata/influxdb-client": "^1.
|
|
24
|
-
"@influxdata/influxdb-client-apis": "^1.
|
|
23
|
+
"@influxdata/influxdb-client": "^1.28.0",
|
|
24
|
+
"@influxdata/influxdb-client-apis": "^1.28.0",
|
|
25
25
|
"@iobroker/adapter-core": "^2.6.0",
|
|
26
26
|
"influx": "^4.2.3"
|
|
27
27
|
},
|