Hi together,
I´m already searched a lot in this and other communities but i did not get any hint.
I´m using an InfluxDB in which data is stored. I´m able to query it with the web GUI. I want to create an sensor, which reads a couple of data, but the sensor data is empty. My config:
# InfluxDB2
influxdb:
api_version: 2
ssl: false
host: <host>
port: <ip>
token: <token>
organization: <org>
bucket: <bucket>
tags:
source: HomeAssistant
tags_attributes:
- friendly_name
default_measurement: units
ignore_attributes:
- icon
exclude:
entities:
- zone.home
domains:
- persistent_notification
- person
include:
domains:
- sensor
- binary_sensor
- sun
- light
- cover
My sensor config is:
# InfluxDB-Sensors
- platform: influxdb
api_version: 2
ssl: false
host: <host>
port: <ip>
token: <token>
organization: <org>
bucket: <bucket>
queries_flux:
- name: "influx_strom_test"
unique_id: "influx_strom_test"
range_start: "-1w"
unit_of_measurement: kWh
query: >
filter(fn: (r) => r["entity_id"] == "stromzahler_z1_netzbezug")
|> filter(fn: (r) => r["_field"] == "value")
|> aggregateWindow(every: 1d, fn: mean, createEmpty: true)
I´m able to run this query in the web GUI an gets a lilst of 10+ records. Does anybody has an hint for me?
Best regards,
chrclaus