- Stop Adapter
- Copy the measurement to new one. (
stateOfCapacity
->stateOfCharge
)
https://www.laub-home.de/wiki/InfluxDB_2_Measurements_umbenennen (DE)- Open InfluxDB 2 web interface (
http://<INFLUXDB2>:8086
) - On 'DataExplorer' tab click on 'Script Editor'
- Replace
old
,new
and the bucket name with your values.from(bucket: "example-bucket") |> range(start: 2021-11-21T00:00:00Z, stop: 2021-11-22T00:00:00Z) |> filter(fn: (r) => r._measurement == "old") |> set(key: "_measurement", value: "new") |> to(bucket: "example-bucket")
- Open InfluxDB 2 web interface (
- Delete the old one (
stateOfCapacity
)# InfluxDB Host INFLUXHOST=localhost # openHAB Database INFLUXDB=openhab_db # InflusDB API Key INFLUXDBAUTH="TkrV8yQ8adcwwwwedsiuhf5V1OhXasdfadfeGgtzsb_bfucYeHSeTID-JlB7AKBZjE47TCwf8w-jGCFzpChw==" # Measurement to delete MEASUREMENT="LaubIot07BME680_Temperature" curl -s --get http://$INFLUXHOST:8086/query?db=$INFLUXDB \ --header "Authorization: Token $INFLUXDBAUTH" \ --data-urlencode "q=DROP MEASUREMENT $MEASUREMENT"
- Install new adapter. Write to new state