I have a problem that I can’t explain for myself:
The following query gives me two results, although the tags “meter” and “tarif” have the exact same values:
from(bucket: "sensors") |> range(start: -15y) |> filter(fn: (r) => r["_measurement"] == "zählerstand" and r._field == "pv_produktion_west") |> count()
Can someone explain this to me and how I could fix this?
The story behind this is:
I had my historic values in another bucket, but had some bad design decisions regarding tags.
I then updated my Home Assistant to send the new sensor values to the new bucket “sensors”.
After that, I wrote a migration query that creates the right records and writes to “sensors”. Before you ask: yes, I specified tagColumns:
... |> to(bucket: "sensors", tagColumns: ["meter", "tarif"])