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公式更新しました 1年前