Closed octal-ip closed 1 month ago
@octal-ip Please confirm the data source is Influx.
Could you please send us how the data looks like as Table View
and in the inspector.
Yes, I'm using Flux to query InfluxDB.
Sure thing, here's the output of the inspector:
{
"request": {
"url": "api/ds/query?ds_type=influxdb",
"method": "POST",
"data": {
"queries": [
{
"query": "from(bucket: \"Inverter\")\r\n |> range(start: -7d, stop: now())\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"Power_switch_enable\" or\r\n r[\"_measurement\"] == \"Factory_reset_enable\" or\r\n r[\"_measurement\"] == \"Island_protection_enable\" or\r\n r[\"_measurement\"] == \"MTTP_enable\" or\r\n r[\"_measurement\"] == \"GFDI_enable\" or\r\n r[\"_measurement\"] == \"RCD_enable\" or\r\n r[\"_measurement\"] == \"RISO_enable\" or\r\n r[\"_measurement\"] == \"PV_curve_enable\" or\r\n r[\"_measurement\"] == \"Limiter_enable\" or\r\n r[\"_measurement\"] == \"RSD_enable\")\r\n |> filter(fn: (r) => r[\"MAC\"] =~ /d83addd8d2ab/)\r\n |> last()",
"datasource": {
"type": "influxdb",
"uid": "ddxu7noheujggc"
},
"datasourceId": 1
}
]
},
"hideFromInspector": false
},
"response": {
"results": {
"A": {
"status": 200,
"frames": [
{
"schema": {
"name": "Factory_reset_enable",
"refId": "A",
"meta": {
"typeVersion": [
0,
0
],
"executedQueryString": "from(bucket: \"Inverter\")\r\n |> range(start: -7d, stop: now())\r\n |> filter(fn: (r) => r[\"_measurement\"] == \"Power_switch_enable\" or\r\n r[\"_measurement\"] == \"Factory_reset_enable\" or\r\n r[\"_measurement\"] == \"Island_protection_enable\" or\r\n r[\"_measurement\"] == \"MTTP_enable\" or\r\n r[\"_measurement\"] == \"GFDI_enable\" or\r\n r[\"_measurement\"] == \"RCD_enable\" or\r\n r[\"_measurement\"] == \"RISO_enable\" or\r\n r[\"_measurement\"] == \"PV_curve_enable\" or\r\n r[\"_measurement\"] == \"Limiter_enable\" or\r\n r[\"_measurement\"] == \"RSD_enable\")\r\n |> filter(fn: (r) => r[\"MAC\"] =~ /d83addd8d2ab/)\r\n |> last()"
},
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "GFDI_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "Island_protection_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "Limiter_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "MTTP_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "PV_curve_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "Power_switch_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
1
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "RCD_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "RISO_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0
]
],
"nanos": [
[
788710
],
null
]
}
},
{
"schema": {
"name": "RSD_enable",
"refId": "A",
"fields": [
{
"name": "Time",
"type": "time",
"typeInfo": {
"frame": "time.Time",
"nullable": true
}
},
{
"name": "value",
"type": "number",
"typeInfo": {
"frame": "float64",
"nullable": true
},
"labels": {
"MAC": "d83addffffff",
"sensor": "Inverter"
}
}
]
},
"data": {
"values": [
[
1727419794084
],
[
0.01
]
],
"nanos": [
[
788710
],
null
]
}
}
]
}
}
}
}
And as a table:
Thank you very much for this fix - I've updated to 4.7.0 today and everything seems to be working.
Note that a variable I'm using for the dashboard (MAC) gets included with the query field selection (e.g. "A:Exporttime value {MAC=\"d83addffffff\", sensor=\"Inverter\"}") which ends up hard coded into the dashboard, and the initial values won't adjust to a change in the dashboard variable. I've managed to work around this by adding "keep(columns: ["_measurement", "value"])" to the flux query which excludes these unnecessary columns. This seems to work OK in my quick testing.
@octal-ip Thank you for confirming.
We use Grafana data frame's ids as they retrieved from the data source. Business Forms supports any data source and it's up to the user to name them properly.
When using a query that returns multiple measurements as the source for initial field values, they cannot be distinguished in the initial query fields drop-down list.
For example, when using the following query:
The query fields drop-down list will just show "A:Time' and "A:value" for each measurement, making them indistinguishable from each other. They also can't be individually selected in the drop-down list.
The workaround for this would be to make a separate query for every field, however this would be very cumbersome for forms containing more than a few fields.
Either I'm trying to do this wrong, or a suitable fix would be to include the measurement name in the query field drop-down menu. This would result in: "A:Power_switch_enable:Time" and "A:Power_switch_enable:value", etc.