From e185e8f813e32c53d6486553a1f1020e374d4fd6 Mon Sep 17 00:00:00 2001 From: "Jan N. Klug" Date: Sun, 5 Mar 2023 14:24:49 +0100 Subject: [PATCH] [influxdb] Fix query for InfluxDB2 Signed-off-by: Jan N. Klug --- .../influxdb/internal/influx2/InfluxDB2RepositoryImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/influx2/InfluxDB2RepositoryImpl.java b/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/influx2/InfluxDB2RepositoryImpl.java index 045bc7577c81b..43d578d727ded 100644 --- a/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/influx2/InfluxDB2RepositoryImpl.java +++ b/bundles/org.openhab.persistence.influxdb/src/main/java/org/openhab/persistence/influxdb/internal/influx2/InfluxDB2RepositoryImpl.java @@ -165,6 +165,9 @@ public List query(String query) { private Stream mapRawResultToHistoric(FluxTable rawRow) { return rawRow.getRecords().stream().map(r -> { String itemName = (String) r.getValueByKey(InfluxDBConstants.TAG_ITEM_NAME); + if (itemName == null) { + itemName = r.getMeasurement(); + } Object value = r.getValueByKey(COLUMN_VALUE_NAME_V2); Instant time = (Instant) r.getValueByKey(COLUMN_TIME_NAME_V2); return new InfluxRow(time, itemName, value);