1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
0
The problem I had was the bridged MQTT was not sending the 'payload' in json format.
{
"format": "json",
"topic": "mygateway2-out/20/0/1/0/0",
"timestamp": 1621717535170,
"payload": 56
}
I would not have had this problem if the "payload" was sent like this:
...
"payload": {
"temperature": 28
}
So I needed to build the json sql query to convert the payload into a numerical value:
SELECT cast(concat(substring(decode(encode(, 'base64'),'base64'),0, 2), ".", substring(decode(encode(, 'base64'),'base64'),3, 8)) as Decimal) AS value FROM 'mygateway2-out///1/0/0'
Now the numerical values get inserted as "NUM" (numbers) in my DynamoDB table.
respondido hace 3 años
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 3 años