Greetings,
Can you please confirm the following configurations:
- Make sure that the AWS IoT Rule Query statement is correctly set.
This is the format that the AWS IoT Rule Query statement should have:
SELECT topic(3) as device, * as payload FROM "$aws/things/+/shadow/update"
At the plugin creation interface as well as in the AWS “route” section
It should be like this:

- Parse de incoming data correctly.
Since AWS IoT Core sends the following JSON to Ubidots:
{
"state": {
"reported": {
"temperature": 23,
"humidity":55
}
}
}
You’d need to access the keys in which your data is, then build an Ubidots compatible JSON with that data. Said so, your decoder should look like this for this particular example:
def decode(args):
print("Arguments received in decode function", args)
payload = args.get("payload")
device_label = args.get("device")
# Please format your data and make sure this function returns a dictionary like this:
# {
# "device_label":"your_device_label",
# "payload": <An Ubidots API v1.6 compatible payload (See https://ubidots.com/docs/hw/#send-data)>
# }
return {"device_label": device_label, "payload": payload["state"]["reported"]}
I hope this guidelines help you on your integration.
Please feel free to reach back to us if any other question/doubt arises.
Best regards