Closed rduivenvoorde closed 3 years ago
Hi Richard Duivenvoorde, fixed the issue, please, update your gateway to the newest version via the master branch and let us know if it helps you.
@samson0v Thanks! Will do after my holidays when I'm back at work and report back. But thanks for the swift reaction!
Describe the bug Not able to retrieve timeseries value if the data/message is a list itself
The data the gateway received is something like:
[{"id":"123456"}]
(note: the message is actually adocker inspect
result) Using the MQTT converter, I seem to be able to retrieve the value by using"${ [0].id }"
But I receive the traceback below, I think because: https://github.com/thingsboard/thingsboard-gateway/blob/master/thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py#L72 tries to find a ts or timestamp key in the (straight) data:but as said: data is an array itself so a call to
data.get(...)
will result in the error below.A solution would maybe be to check if data is a list, and if not do current lines, else either take only the first one, or use a json expression?
Connector name (If bug in the some connector): MQTT Connector
Error traceback (If available):
Versions (please complete the following information):