IoT TwinMaker and Grafana integration where component has multiple list properties

0

Hello! I'm currently trying to create a dashboard where one component of an entity has multiple property definitions of the list type.

My property definitions and lambda function seem to be operating as intended. Using the "Test" functionality in the AWS IoT TwinMaker console shows me the following:

{
  "assetId": {
    "propertyReference": {
      "componentName": "master_task_list",
      "entityId": "AllTasks",
      "propertyName": "assetId"
    },
    "propertyValue": {
      "stringValue": "master_task_list"
    }
  },
  "assetType": {
    "propertyReference": {
      "componentName": "master_task_list",
      "entityId": "AllTasks",
      "propertyName": "assetType"
    },
    "propertyValue": {
      "stringValue": "task_list"
    }
  },
  "robotIdList": {
    "propertyReference": {
      "componentName": "master_task_list",
      "externalIdProperty": {},
      "entityId": "AllTasks",
      "propertyName": "robotIdList"
    },
    "propertyValue": {
      "listValue": [
        {
          "stringValue": "3e2b4d1d-a86f-4f7b-a436-46e7653f7fef"
        }
      ]
    }
  },
  "siteArn": {
    "propertyReference": {
      "componentName": "master_task_list",
      "entityId": "AllTasks",
      "propertyName": "siteArn"
    },
    "propertyValue": {
      "stringValue": "arn:aws:iotroborunner:us-east-1:<accountId>:site/<siteId>"
    }
  },
  "stateList": {
    "propertyReference": {
      "componentName": "master_task_list",
      "externalIdProperty": {},
      "entityId": "AllTasks",
      "propertyName": "stateList"
    },
    "propertyValue": {
      "listValue": [
        {
          "stringValue": "ACTIVE"
        }
      ]
    }
  },
  "taskIdList": {
    "propertyReference": {
      "componentName": "master_task_list",
      "externalIdProperty": {},
      "entityId": "AllTasks",
      "propertyName": "taskIdList"
    },
    "propertyValue": {
      "listValue": [
        {
          "stringValue": "0ed00afe-c55f-4311-9468-4dca01b1625d"
        }
      ]
    }
  },
  "waypointsList": {
    "propertyReference": {
      "componentName": "master_task_list",
      "externalIdProperty": {},
      "entityId": "AllTasks",
      "propertyName": "waypointsList"
    },
    "propertyValue": {
      "listValue": [
        {
          "stringValue": "[(0, 0, 5), (40.529312, -74.626496, 5), (40.52904, -74.6267648, 5), (40.529152, -74.6268927, 5), (40.5291568, -74.6268862, 0)]"
        }
      ]
    }
  }
}

Which tells me all the values are being reported correctly as their respective types. However, when issuing a request from Grafana using the IoT TwinMaker data source, the query inspector asks for multiple properties, but only one comes back The query:

{
  "queries": [
    {
      "componentName": "master_task_list",
      "entityId": "AllTasks",
      "properties": [
        "waypointsList",
        "taskIdList",
        "robotIdList",
        "stateList"
      ],
      "queryType": "GetPropertyValue",
      "refId": "A",
      "componentTypeId": "com.defuzzy.task_list",
      "datasource": "AWS IoT TwinMaker",
      "datasourceId": 3,
      "intervalMs": 10000,
      "maxDataPoints": 2738
    }
  ],
  "range": {
    "from": "2022-04-26T22:54:24.962Z",
    "to": "2022-04-27T04:54:24.962Z",
    "raw": {
      "from": "now-6h",
      "to": "now"
    }
  },
  "from": "1651013664962",
  "to": "1651035264962"
}

The response

{
  "results": {
    "A": {
      "frames": [
        {
          "schema": {
            "name": "waypointsList",
            "refId": "A",
            "meta": {
              "custom": {}
            },
            "fields": [
              {
                "name": "Value",
                "type": "string",
                "typeInfo": {
                  "frame": "string",
                  "nullable": true
                }
              }
            ]
          },
          "data": {
            "values": [
              [
                "[(0, 0, 5), (40.529312, -74.626496, 5), (40.52904, -74.6267648, 5), (40.529152, -74.6268927, 5), (40.5291568, -74.6268862, 0)]"
              ]
            ]
          }
        }
      ]
    }
  }
}

Even if I only ask for one (different) property, I still only get one property back (waypointsList in this case). Am I doing something wrong? This feels a little broken. Any help would be appreciated!

已提問 2 年前檢視次數 402 次
1 個回答
0

Thank you for reaching out!

I've confirmed this bug and submitted an issue in our plugin's github repo: https://github.com/grafana/grafana-iot-twinmaker-app/issues/42

Will follow up with Grafana to make the fix.

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南