Trouble with the WHERE field in Dashboard Query

Defo a noob here but with a decent IT background. Any help gratefully received !

Having real trouble with my first Grafana Dashboard. Just can’t get it working at all !

My setup is within Home Assistant so I’m using the InfluxDB and Grafana (v 10.0.2) Add-ons within HA.

Config and setup of both Add-ons seems to have completed successfully and I can see data within Influx and to a lesser extent in Grafana.

My issue occurs when setting up my first Grafana Dashboard Query:
Using InfluxDB as my data source…
FROM field set to Autogen
(All good at this point with data displayed in the main dashboard panel)
As soon as I choose anything from the WHERE drop-down I get a “No data” message in the main panel.
All the tutorials I can find want me to enter “entity_id” in this field, which I don’t have in my drop-down. The nearest I can see is “entity_id::tag” which produces the “No data” message. In fact it doesn’t seem to matter what I pick or freehand enter in this WHERE field I always get “No data”

Is this my rank stupidity or an I missing something ?

Have you found a solution? I’ve been using grafana and influxdb in Home Assistant for 2 years now and recently I noticed that any dashboard and query I create, it is missing the entity_id. I only have entity_id::tag but using this does not filter out entity that do not belong into the respective measurement.

FROM “A” WHERE enitty_id::tag (this is where it lists every entity)
in the past I had it like this
FROM “A” WHERE entity_id (it listed only the entities that have a measurement in Amps)

This is really strange and I cannot find when and where this has changed and what caused it.

Same here. I noticed also issues with the new entity-ID::tag. Anybody a solution to this?

Hi @vladvelciu and welcome @t077584 to the Grafana forum.

Not sure this will be helpful, but below is an example of InfluxQL in Grafana with some WHERE clauses which do not use template variables, and which specify one tag value from the tag region and three tag values from the tag fueltype. I cannot say how long it has worked like this or if it was different before, as I have not used InfluxQL over the long term.

SELECT sum("value")
FROM "ElectricPowerGeneratedByEnergySource"
WHERE ("fueltype"::tag =~ /(Wind|Hydro|Nuclear)/
AND "region"::tag = 'California')
AND $timeFilter
GROUP BY fueltype, time($__interval)