iobroker.influxdb 3.1.4 → 3.1.5
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 +3 -0
- package/io-package.json +13 -13
- package/main.js +14 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -450,6 +450,9 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
450
450
|
-->
|
|
451
451
|
|
|
452
452
|
## Changelog
|
|
453
|
+
### 3.1.5 (2022-06-12)
|
|
454
|
+
* (Apollon77) Make sure debug log is active according to the settings
|
|
455
|
+
|
|
453
456
|
### 3.1.4 (2022-06-08)
|
|
454
457
|
* (Apollon77) Performance optimizations for GetHistory calls, especially for "minmax" aggregate method
|
|
455
458
|
* (Apollon77) Prevent crash case reported by Sentry
|
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.5",
|
|
17
17
|
"title": "Logging data with InfluxDB",
|
|
18
18
|
"titleLang": {
|
|
19
19
|
"en": "Logging data with InfluxDB",
|
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
"zh-cn": "使用InfluxDB记录数据"
|
|
29
29
|
},
|
|
30
30
|
"news": {
|
|
31
|
+
"3.1.5": {
|
|
32
|
+
"en": "Make sure debug log is active according to the settings",
|
|
33
|
+
"de": "Stellen Sie sicher, dass das Debug-Log gemäß den Einstellungen aktiv ist",
|
|
34
|
+
"ru": "Убедитесь, что журнал debug активен в соответствии с настройками",
|
|
35
|
+
"pt": "Certifique-se de que o log de depuração está ativo de acordo com as configurações",
|
|
36
|
+
"nl": "Zorg ervoor dat het logboek actief is volgens de instellingen",
|
|
37
|
+
"fr": "Assurez-vous que le journal debug est actif selon les paramètres",
|
|
38
|
+
"it": "Assicurarsi che il registro di debug sia attivo in base alle impostazioni",
|
|
39
|
+
"es": "Asegúrese de que el registro de depuración está activo según la configuración",
|
|
40
|
+
"pl": "Umożliwia to, że log debug jest aktywny zgodnie z ustawieniami",
|
|
41
|
+
"zh-cn": "B. 根据环境,确保有色色逻辑积极。"
|
|
42
|
+
},
|
|
31
43
|
"3.1.4": {
|
|
32
44
|
"en": "Performance optimizations for GetHistory calls, especially for \"minmax\" aggregate method\nPrevent crash case reported by Sentry",
|
|
33
45
|
"de": "Leistungsoptimierungen für GetHistory-Anrufe, insbesondere für minmax-Aggregatmethode\nVerhindern Crashfall berichtet von Sentry",
|
|
@@ -99,18 +111,6 @@
|
|
|
99
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.",
|
|
100
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.",
|
|
101
113
|
"zh-cn": "突破:配置仅在新的 Admin 5 UI 中有效!\n对录制逻辑进行了更大的调整,并添加了许多新功能。有关详细信息,请参阅变更日志和论坛帖子。"
|
|
102
|
-
},
|
|
103
|
-
"2.6.3": {
|
|
104
|
-
"en": "Fix potential crash cases (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
105
|
-
"de": "Mögliche Absturzfälle beheben (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
106
|
-
"ru": "Исправление возможных случаев сбоя (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
107
|
-
"pt": "Corrigir possíveis casos de travamento (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
108
|
-
"nl": "Mogelijke crashgevallen oplossen (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
109
|
-
"fr": "Correction des cas de plantage potentiels (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
110
|
-
"it": "Risolvi potenziali casi di crash (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
111
|
-
"es": "Solucionar posibles casos de bloqueo (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
112
|
-
"pl": "Napraw potencjalne przypadki awarii (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
113
|
-
"zh-cn": "修复潜在的崩溃案例 (Sentry IOBROKER-INFLUXDB-4Q)"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"mode": "daemon",
|
package/main.js
CHANGED
|
@@ -2211,7 +2211,7 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
|
|
2213
2213
|
adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
|
|
2214
|
-
const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
|
|
2214
|
+
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
2215
|
|
|
2216
2216
|
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) call: ${JSON.stringify(options)}`);
|
|
2217
2217
|
|
|
@@ -2321,10 +2321,9 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2321
2321
|
fluxQuery += ` |> range(${(options.start) ? `start: ${new Date(options.start).toISOString()}, ` : `start: ${new Date(options.end - (adapter.config.retention || 31536000) * 1000).toISOString()}, `}stop: ${new Date(options.end).toISOString()})`;
|
|
2322
2322
|
fluxQuery += ` |> filter(fn: (r) => r["_measurement"] == "${options.id}")`;
|
|
2323
2323
|
|
|
2324
|
-
if (adapter.config.usetags)
|
|
2325
|
-
fluxQuery += ' |> duplicate(column: "_value", as: "value")';
|
|
2326
|
-
else
|
|
2324
|
+
if (!adapter.config.usetags) {
|
|
2327
2325
|
fluxQuery += ' |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")';
|
|
2326
|
+
}
|
|
2328
2327
|
|
|
2329
2328
|
if (resultsFromInfluxDB && supportsAggregates) {
|
|
2330
2329
|
if ((options.step !== null) && (options.step > 0))
|
|
@@ -2386,6 +2385,10 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2386
2385
|
}
|
|
2387
2386
|
}
|
|
2388
2387
|
|
|
2388
|
+
if (adapter.config.usetags) {
|
|
2389
|
+
fluxQuery += ' |> duplicate(column: "_value", as: "value")';
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2389
2392
|
fluxQueries.push(fluxQuery);
|
|
2390
2393
|
|
|
2391
2394
|
// select one datapoint more than wanted
|
|
@@ -2438,6 +2441,12 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2438
2441
|
rows[qr][rr].val = rows[qr][rr].value;
|
|
2439
2442
|
delete rows[qr][rr].value;
|
|
2440
2443
|
}
|
|
2444
|
+
if (rows[qr][rr]._value !== undefined) {
|
|
2445
|
+
delete rows[qr][rr]._value;
|
|
2446
|
+
}
|
|
2447
|
+
if (rows[qr][rr]._field !== undefined) {
|
|
2448
|
+
delete rows[qr][rr]._field;
|
|
2449
|
+
}
|
|
2441
2450
|
|
|
2442
2451
|
if (typeof rows[qr][rr].val === 'number' && options.round) {
|
|
2443
2452
|
rows[qr][rr].val = Math.round(rows[qr][rr].val * options.round) / options.round;
|
|
@@ -2449,7 +2458,7 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2449
2458
|
} else if (rows[qr][rr]._start && rows[qr][rr]._stop) {
|
|
2450
2459
|
const startTime = new Date(rows[qr][rr]._start).getTime();
|
|
2451
2460
|
const stopTime = new Date(rows[qr][rr]._stop).getTime();
|
|
2452
|
-
rows[qr][rr].ts = startTime + (stopTime - startTime) / 2;
|
|
2461
|
+
rows[qr][rr].ts = Math.round(startTime + (stopTime - startTime) / 2);
|
|
2453
2462
|
delete rows[qr][rr]._start;
|
|
2454
2463
|
delete rows[qr][rr]._stop;
|
|
2455
2464
|
}
|