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!

1 Respuesta
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas