I need to get the temperature and humidity values and store them into a AWS timestream table as values, so that i can use them in Grafana.
How could i retrieve those numbers-values in a usable format instead of string array? I tried to retrieve only temperature with no success:
SELECT (SELECT temperature FROM data.value.device_list) as temp FROM MyAWSTopic
The received MQTT payload is the following:
{
"time": 1651066698,
"mac": "30:ae:7b:e2:23:72",
"from": "BLE",
"to": "GATEWAY",
"data": {
"attribute": "mod.device_list",
"mac": "20:ae:7c:e2:28:72",
"value": {
"device_list": [
{
"modelstr": "MDSensor",
"sensortype": "Temperature_Humdity",
"connectable": 1,
"ble_addr": "E5:02:C5:79:F2:C4",
"temperature": "26.392",
"scan_rssi": -35,
"addr_type": 1,
"scan_time": 1651064693,
"dev_name": "DBeacon",
"data": "02010608FF5904555B454360573756E426561636F6E",
"humidity": "35.119",
"connect": 0
}
]
}
},
"deviceCode": "aws_device_code",
"type": "reportAttribute"
}
And this is the result i get : [{"temperature":"26.073"},{},{},{}]