SmartThings API: How to Access Device Locations for “View in Map”?
Hey SmartThings Community!
I’m working on a script to retrieve device locations using the SmartThings API, similar to the “View in Map” feature in the app. However, when I query my devices, the latitude
and longitude
fields return None
, even for devices that should support location tracking.
What I’ve Tried So Far:
- Checked device status via API (
/devices/{deviceId}/status
) – Location fields exist but are alwaysNone
. - Fetched device capabilities (
/devices/{deviceId}/components/main/capabilities
) – No clear geolocation-related capabilities. - Sent a refresh command (
/devices/{deviceId}/commands
) – No change in data. - Tested with different devices (e.g., Samsung SmartTags, Mobile Presence) – Same issue.
Questions:
- Does the SmartThings API support GPS location retrieval for devices like SmartTags, Mobile Presence, or other trackers?
- Is there a way to force a location update via API?
- Are there permissions or settings that need to be enabled for location data to be exposed?
Any insights would be greatly appreciated!
Thanks in advance!