Skip to content

Locations

Michelle Staley edited this page Jan 18, 2023 · 10 revisions

A Location is a user-defined geolocation such as "Home" or "Office". Locations are a way to group users and devices together to benefit from Automations.

Locations can include hubs, devices, and Automations. Automations allow control of the devices in a Location, the ability to monitor and receive notifications about what's happening at the Location, and more.

A Location can be further organized into Rooms, such as "Kitchen" or "Bedroom".

Note

Be aware of the following requirements:

  • A user can belong to 10 Locations. This includes Locations they are invited to and Locations that they own.
  • Each Location can have up to 20 members, including the owner.
  • A Location can have up to 200 devices.
  • The SmartThings app creates the "My home" Location by default.

Find more information about Locations here.

This article explains how your integration can use our API to create and manage Locations.

The Locations endpoint supports the following commands:

Functions

Note: The list of functions can also be found here.

  • list - Returns a list of all locations accessible by the user.

  • get - Get the definition of a specific location. Returns the UUID of the location.

  • create - Creates a location.

  • update - Updates a location. Requires the UUID of the location and the new location definition.

  • delete - Deletes a location and all of the devices and installed apps associated with it. Requires the UUID of the location

Examples

First you need to import the SmartThings core SDK into your project. You can import the project for NodeJS ES2015+.

NodeJS

const {SmartThingsClient, BearerTokenAuthenticator} = require('@smartthings/core-sdk')

E2015+

const client = new SmartThingsClient(new BearerTokenAuthenticator('{YOUR-PAT-TOKEN}'))

Now that the project has been imported, you can get the list of locations as follows:

client.locations.list().then(locations => {
    console.log(`Found ${locations.length} locations`)
})
Clone this wiki locally