Basic question : unable to compose my query

Hi there,

I run Grafana (v11.0.0) link to InfluxDB (v5.0.0) in HomeAssistant (v2024.9.1).

I have several dashboards that work the way I want them to, but one is giving me headaches.

I have the following query in InfluxDB that returns the desired table

SELECT "alphainnotec_etat_de_fonctionnement", "value" FROM "HomeAssistant"."autogen"."state" WHERE time > :dashboardTime: AND time < :upperDashboardTime: AND "domain"!='number'
time alphainnotec_etat_de_fonctionnement state.value
2024-09-08T16:53:16.068+02:00 1
2024-09-08T16:53:16.112+02:00 0
2024-09-08T16:55:39.051+02:00 1
2024-09-08T16:59:39.051+02:00 1
2024-09-08T17:03:39.052+02:00 1
2024-09-08T17:07:39.053+02:00 1
2024-09-08T17:11:15.884+02:00 482
2024-09-08T17:11:39.055+02:00 1
2024-09-08T17:15:39.056+02:00 1
2024-09-08T17:19:39.057+02:00 1

but in Grafana, the following query returns “no Data”

SELECT distinct("value") FROM "state" WHERE ("entity_id"::tag = 'alphainnotec_etat_de_fonctionnement') AND $timeFilter GROUP BY time($__interval) fill(null)

I guess I’m not selecting the right “value” parameter, but I think I’ve tried all the options, without success.

Could someone help me?

Thanks

Why are you using different queries in InfluxDB and Grafana?

You’re right, I should have specified that this query

SELECT "alphainnotec_etat_de_fonctionnement", "value" FROM "HomeAssistant"."autogen"."state" WHERE $timeFilter GROUP BY time($__interval) AND "domain"!='number'

(similar to the one that returns my value in InfluxDB, only with adapted time filter)

Returns No data (no parsing error) in Grafana