SmartTag on API?

Hey guys.

I just received a SmartTag and tested it with SmartThings App, quite fun on my cat :smile:

I then questioned the API. I can see the Smarttag as a devices. (
As other devices I have (washer, Harmony Hub…), I questioned device status on the API (“GET https://api.smartthings.com/v1/devices/my_device_id/status”)
But there is nothing, all values are null. So no information to get.
I even tried sending POST request like “alarm” or “volume”. Commands are accepted, but nothing helps.

Is the SmartTag really reachable through the API?

json status
{
"components": {
    "main": {
        "tag.e2eEncryption": {
            "encryption": {
                "value": null
            }
        },
        "audioVolume": {
            "volume": {
                "value": null
            }
        },
        "tag.searchingStatus": {
            "searchingStatus": {
                "value": null
            }
        },
        "tag.tagStatus": {
            "connectedUserId": {
                "value": null
            },
            "tagStatus": {
                "value": null
            },
            "connectedDeviceId": {
                "value": null
            }
        },
        "geofence": {
            "enableState": {
                "value": null
            },
            "geofence": {
                "value": null
            },
            "name": {
                "value": null
            }
        },
        "alarm": {
            "alarm": {
                "value": null
            }
        },
        "tag.updatedInfo": {
            "connection": {
                "value": null
            }
        },
        "tag.tagButton": {
            "tagButton": {
                "value": null
            }
        },
        "tag.factoryReset": {},
        "battery": {
            "battery": {
                "value": null
            }
        },
        "geolocation": {
            "method": {
                "value": null
            },
            "heading": {
                "value": null
            },
            "latitude": {
                "value": null
            },
            "accuracy": {
                "value": null
            },
            "altitudeAccuracy": {
                "value": null
            },
            "speed": {
                "value": null
            },
            "longitude": {
                "value": null
            },
            "lastUpdateTime": {
                "value": null
            }
        }
    }
}

}

So I’ve been digging a little and discovered that the API https://api.smartthings.com/v1/devices/my_device_id/status doesn’t communicate entirely device information. Maybe I don’t really understand the way it is supposed to communicate in the first place.
But the API https://api.smartthings.com/v1/devices/my_device_id seems to give some informations in the metadata field:

api / devices
{
"deviceId" : "$myDeviceId",
"name" : "Tag(BLE)",
"label" : "SmartTag",
"manufacturerName" : "Samsung Electronics",
"presentationId" : "IM-SmartTag-BLE",
"deviceManufacturerCode" : "Samsung Electronics",
"locationId" : "$myLocationId",
"ownerId" : "$myOwnerId",
"roomId" : "$myRoomId",
"components" : [
{
"id" : "main",
"capabilities" : [
{
"id" : "alarm",
"version" : 1
},
{
"id" : "tag.tagButton",
"version" : 1
},
{
"id" : "audioVolume",
"version" : 1
},
{
"id" : "battery",
"version" : 1
},
{
"id" : "tag.factoryReset",
"version" : 1
},
{
"id" : "tag.e2eEncryption",
"version" : 1
},
{
"id" : "tag.tagStatus",
"version" : 1
},
{
"id" : "geolocation",
"version" : 1
},
{
"id" : "geofence",
"version" : 1
},
{
"id" : "tag.updatedInfo",
"version" : 1
},
{
"id" : "tag.searchingStatus",
"version" : 1
}
],
"categories" : [
{
"name" : "BluetoothTracker",
"categoryType" : "manufacturer"
}
]
}
],
"createTime" : "2021-05-12T15:42:43.765Z",
"bleD2D" : {
"encryptionKey" : "12345",
"cipher" : "AES_128-CBC-PKCS7Padding",
"identifier" : "12345",
"configurationVersion" : "2.0",
"configurationUrl" : "https://apis.samsungiotcloud.com/v1/miniature/profile/c02e8c67-605d-44fc-89c6-2b7026b30b59",
"metadata" : {
"regionCode" : 11,
"privacyIdPoolSize" : 1000,
"privacyIdSeed" : "12345",
"privacyIdInitialVector" : "12345",
"numAllowableConnections" : 2,
"firmware" : {
"version" : "01.01.26",
"updateTime" : 1622982468000
},
"currentServerTime" : 1623057633,
"searchingStatus" : "stop",
"lastKnownConnection" : {
"updated" : 1623044072,
"connectedUser" : {
"id" : "myid",
"name" : "myname"
},
"connectedDevice" : {
"id" : "device",
"name" : "Galaxy Note8"
},
"d2dStatus":"bleScanned",
"nearby" : false,
"onDemand" : false
},
"lostMessage" : {
"enabled" : false,
"type" : "PREDEFINED"
},
"e2eEncryption" : {
"enabled" : false
},
"geolocationStorage" : {
"recentDataOnly" : true
},
"timer" : 1623042919,
"category" : {
"id" : 110
},
"remoteRing" : {
"enabled" : true,
"targetId" : "IMEI:myimei",
"targetName" : "Galaxy Note8"
},
"onboardedBy" : {
"saGuid" : "myguid"
},
"createTime" : 1620834164,
"updateTime" : 1623057023,
"iBeacon" : {
"uuid" : "uuid",
"majorMinorId" : "majorminorid"
}
}
},
"type" : "BLE_D2D",
"restrictionTier" : 0
}
  • searchingStatus:
"searchingStatus" : "stop",

This seams to be matching the capability tag.searchingStatus->searchingStatus from the API /device/status:

  • connectedUserId and connectedDeviceId:

“connectedUser” : {
“id” : “myid”,
“name” : “myname”
},
“connectedDevice” : {
“id” : “device”,
“name” : “Galaxy Note8”
},

This seems to match the capability tag.tagStatus->connectedUserId and connectedDeviceId from the API /device/status:

  • connection:

“connectedDevice” : {
“id” : “device”,
“name” : “Galaxy Note8”
},
“d2dStatus”:“bleScanned”,
“nearby” : false,
“onDemand” : false
},

d2dStatus seems to indicate wether the tag is found or in search. gattConnected=connected to device, bleScanned=in search (capabilities tag.tagStatus are a bit different)
“nearby”& “onDemand” : if the tag is near and reachable from the phone.
Related to the following capability ?

  • e2eEncryption:

“e2eEncryption” : {
“enabled” : false
},

The same ?

  • category:
"category" : {
"id" : 110
},

I found that this is the category chosen in the App (110 = others, 100= key, 101=cat, 102=dog, 103=bagpack… 123=sportwear)

  • remoteRing:

“remoteRing” : {
“enabled” : true,
“targetId” : “IMEI:myimei”,
“targetName” : “Galaxy Note8”
},

This seems to indicate whether this option is active or not : “let the tag ring/localize the phone”

So the SmartTag is clearly communicating on API Level, but is the definitive way? And what happened to sending command like ‘alarm/siren’ to ring the tag? Tried every way possible, not working on API /command
No battery level, like the app shows it?

One command seems to work : main->tag.updatedInfo->update
After sending this one, the API device indicates information about searching the Tag:

“connectedDevice” : {
“id” : “device”,
“name” : “Galaxy Note8”
},
“d2dStatus”:“bleScanned”, => “gattConnected”
“nearby” : false,
“onDemand” : false
},

Feel free to share information/advice on SmartTag :slight_smile: