I honestly do not understand the use case, but here is an example how to get data from a bucket with a device:
Hope this help.