Hi all,
I am quite new to using grafana but could already solved some issues also with this great forum. But for the current problem I cannot find a solution so far.
I am using HomeAssistant (latest version) in a synology virtual machine.
I have installed the HA-AddOns InfluxDB (version 5.0.0) and grafana (version 9.2.2).
In grafana I already created a complete dashboard for my photovoltaic system showing the data on a daily data base. I made this using influxql.
Because influxql does not support gouping by month, I change over to using flux.
My InfluxDB saves data in UTC, so I have to use timezone to get correct data.
But when I try to use timezone in grafana I get the following error:
500 Internal Server Error: type error 1:1-1:18: unknown import path: “timezone”
My flux query:
import "timezone"
option location = timezone.location(name: "Europe/Berlin")
from(bucket: "hoas_ifxdb/RETPOL_FIVEMIN_INFINITE")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "W"
and r.entity_id == "inverter_eingangsleistung")
|> filter(fn: (r) => r["_field"] == "mean_value")
|> yield(name: "PV-Ausgang")
If I remove the first two lines (import … + option …) the query works and returns data (but for the wrong time range - offset of UTC to local time).
I’m grateful for any help.