1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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.
beantwortet vor 3 Jahren
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- Wie veröffentliche ich MQTT-Nachrichten von meinem Gerät auf AWS IoT Core, wenn ich Python verwende?AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren