1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
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.
답변함 3년 전
관련 콘텐츠
- AWS 공식업데이트됨 3년 전