This is my query when I’ve selected a few “device_id” in the dropdown:
{
“request”: {
“url”: “api/ds/query”,
“method”: “POST”,
“data”: {
“queries”: [
{
“refId”: “A”,
“datasource”: {
“type”: “mysql”,
“uid”: “e387d16b-7f41-4304-9cec-757555016605”
},
“rawSql”: “SELECT\r\n $__timeGroupAlias(timedate, 10m),\r\n AVG(posicion) AS posicion\r\nFROM xxxx_q2.med_ncu\r\nWHERE $__timeFilter(timedate)\r\nAND device_id IN (‘1001’,‘10012’,‘10017’,‘10020’)\r\nGROUP BY device_id, $__timeGroup(timedate, 10m)\r\nORDER BY timedate ASC”,
“format”: “time_series”,
“datasourceId”: 4,
“intervalMs”: 600000,
“maxDataPoints”: 1508
}
],
“range”: {
“from”: “2023-05-24T06:07:49.986Z”,
“to”: “2023-05-25T06:07:49.987Z”,
“raw”: {
“from”: “now-24h”,
“to”: “now”
}
},
“from”: “1684908469986”,
“to”: “1684994869987”
},
“hideFromInspector”: false
},
“response”: {
“results”: {
“A”: {
“status”: 200,
“frames”: [
{
“schema”: {
“refId”: “A”,
“meta”: {
“typeVersion”: [
0,
0
],
“executedQueryString”: “SELECT\r\n UNIX_TIMESTAMP(timedate) DIV 600 * 600 AS "time",\r\n AVG(posicion) AS posicion\r\nFROM ignis_q2.med_ncu\r\nWHERE timedate BETWEEN FROM_UNIXTIME(1684908469) AND FROM_UNIXTIME(1684994869)\r\nAND device_id IN (‘1001’,‘10012’,‘10017’,‘10020’)\r\nGROUP BY device_id, UNIX_TIMESTAMP(timedate) DIV 600 * 600\r\nORDER BY timedate ASC”
},
“fields”: [
{
“name”: “Time”,
“type”: “time”,
“typeInfo”: {
“frame”: “time.Time”,
“nullable”: true
}
},
{
“name”: “posicion”,
“type”: “number”,
“typeInfo”: {
“frame”: “float64”,
“nullable”: true
}
}
]
},
“data”: {
“values”: [
[
1684908600000,
1684908600000,
1684908600000,
1684908600000,
1684909200000,
1684909200000,
1684909200000,
1684909200000,
1684909800000,
1684909800000,
1684909800000,
1684909800000,
(MANY MORE VALUES THAT I’VE DELETED FOR POST)
]
]
}
}
],
“refId”: “A”
}
}
}
}