Seam provides a universal API to connect and control many brands of IoT devices and systems, including thermostats, smart locks, access control systems (ACSs), and noise sensors.
This guide shows you how to install a Seam SDK and then control your Google Nest thermostat using the Seam API.
Step 1: Install a Seam SDK
First, install a Seam SDK, as follows:
npm i seam
pip install seam
# For some development environments, use pip3 in this command instead of pip.
In this guide, you create a Connect Webview object. Then, you display the graphical component of the created Connect Webview and enter a set of sample credentials to connect a sandbox Google Nest account.
This guide shows you how to create a Connect Webview programmatically using the Seam API.
Create a Connect Webview
Create a connect_webview object and then note the returned URL.
Code:
from seam import Seam
seam = Seam() # Seam automatically uses your exported SEAM_API_KEY.
connect_webview = seam.connect_webviews.create(accepted_providers=["nest"])
assert connect_webview.login_successful is False
# Use the returned Connect Webview URL to display
# the Connect Webview authorization flow to your user.
print(connect_webview.url)
import { Seam } from "seam";
const seam = new Seam(); // Seam automatically uses your exported SEAM_API_KEY.
const connectWebview = await seam.connectWebviews.create({
accepted_providers: ['nest']
});
console.log(connectWebview.login_successful); // false
// Use the returned Connect Webview URL to display
// the Connect Webview authorization flow to your user.
console.log(connectWebview.url);
using Seam.Client;
var seam = new SeamClient(apiToken: SEAM_API_KEY);
var connectWebview = seam.ConnectWebviews.Create(
acceptedProviders: new() {Seam.Api.ConnectWebviews.CreateRequest.AcceptedProvidersEnum.Nest}
);
Console.WriteLine(connectWebview.LoginSuccessful); // False
// Use the returned Connect Webview URL to display
// the Connect Webview authorization flow to your user.
Console.WriteLine(connectWebview.Url);
The Seam API exposes each device's properties, such as the current temperature reading in Fahrenheit and Celsius, current HVAC and fan modes, available climate presets, thermostat-specific constraints, and much more.
Code:
# Retrieve all devices, filtered by manufacturer,
# which is one of several filters that list() supports.
all_google_nest_thermostats = seam.devices.list(manufacturer="nest")
# Select the first device as an example.
living_room_thermostat = all_google_nest_thermostats[0]
# Inspect specific properties.
pprint("Current temperature: " + str(living_room_thermostat.properties["temperature_fahrenheit"]))
pprint("Fan running: " + str(living_room_thermostat.properties["is_fan_running"]))
# View the entire returned device object.
pprint(living_room_thermostat)
# Retrieve all devices, filtered by manufacturer, which is
# one of several filters that the list endpoint supports.
all_google_nest_thermostats=$(
# Use GET or POST.
curl -X 'GET' \
'https://connect.getseam.com/devices/list' \
-H 'accept: application/json' \
-H "Authorization: Bearer ${SEAM_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{
"manufacturer": "nest"
}')
# Select the first device as an example.
living_room_thermostat=$(jq -r '.devices[0]' <<< ${all_google_nest_thermostats})
# Inspect specific properties.
echo $(jq -r '"Current temperature: " + (.properties.temperature_fahrenheit | tostring)' <<< ${living_room_thermostat})
echo $(jq -r '"Fan running: " + (.properties.is_fan_running | tostring)' <<< ${living_room_thermostat})
# View the entire returned device object.
echo ${living_room_thermostat}
// Retrieve all devices, filtered by manufacturer,
// which is one of several filters that list() supports.
const allGoogleNestThermostats = await seam.devices.list({manufacturer: "nest"});
// Select the first device as an example.
const livingRoomThermostat = allGoogleNestThermostats [0];
// Inspect specific properties.
console.log("Current temperature: " + livingRoomThermostat.properties.temperature_fahrenheit);
console.log("Fan running: " + livingRoomThermostat.properties.is_fan_running);
// View the entire returned device object.
console.log(livingRoomThermostat);
# Retrieve all devices, filtered by manufacturer,
# which is one of several filters that list() supports.
all_google_nest_thermostats = seam.devices.list(manufacturer: "nest")
# Select the first device as an example.
living_room_thermostat = all_google_nest_thermostats [0]
# Inspect specific properties.
puts "Current temperature: " + living_room_thermostat.properties.temperature_fahrenheit.to_s
puts "Fan running: " + living_room_thermostat.properties.is_fan_running.to_s
# View the entire returned device object.
puts living_room_thermostat.inspect
// Retrieve all devices, filtered by manufacturer,
// which is one of several filters that list() supports.
$all_google_nest_thermostats = $seam->devices->list(manufacturer: "nest");
// Select the first device as an example.
$living_room_thermostat = $all_google_nest_thermostats [0];
// Inspect specific properties.
echo "Current temperature: ", $living_room_thermostat->properties->temperature_fahrenheit, "\n";
echo "Fan running: ", $living_room_thermostat->properties->is_fan_running ? 'true' : 'false', "\n";
// View the entire returned device object.
echo json_encode($living_room_thermostat, JSON_PRETTY_PRINT);
Next, you can use the Seam API to control your Google Nest thermostat.
Seam provides additional actions for thermostats, such as setting the fan mode, creating and scheduling climate presets, and setting temperature thresholds. You can also monitor for Seam thermostat-related events, such as reported temperatures outside your set thresholds.
Try out the following actions on your Google Nest thermostat:
Set the HVAC mode
To set the HVAC mode, use any of the following endpoints or their equivalents in the Seam SDKs:
/thermostats/heat
/thermostats/cool
/thermostats/heat_cool
/thermostats/off
/thermostats/set_hvac_mode
This endpoint is a consolidated version of the other four endpoints.
In this example, set the HVAC mode to heat and the desired heating set point to 68 °F.
Code:
# Confirm that the device supports heat mode.
# You're using a capability flag here!
if living_room_thermostat.can_hvac_heat:
# Set the HVAC mode
# and return an action attempt.
action_attempt = seam.thermostats.heat(
device_id = living_room_thermostat.device_id,
heating_set_point_fahrenheit = 68
)
// Confirm that the device supports heat mode.
// You're using a capability flag here!
if (livingRoomThermostat.can_hvac_heat) {
// Set the HVAC mode
// and return an action attempt.
const actionAttempt = await seam.thermostats.heat({
device_id: livingRoomThermostat.device_id,
heating_set_point_fahrenheit: 68
});
};
# Confirm that the device supports heat mode.
# You're using a capability flag here!
if (living_room_thermostat.can_hvac_heat)
# Set the HVAC mode
# and return an action attempt.
action_attempt = seam.thermostats.heat(
device_id: living_room_thermostat.device_id,
heating_set_point_fahrenheit: 68
)
end
// Confirm that the device supports heat mode.
// You're using a capability flag here!
if ($living_room_thermostat->can_hvac_heat) {
// Set the HVAC mode
// and return an action attempt.
$action_attempt = $seam->thermostats->heat(
device_id: $living_room_thermostat->device_id,
heating_set_point_fahrenheit: 68
);
}
To query properties.current_climate_setting.hvac_mode_setting for the device:
Code:
# Get the device by ID.
updated_living_room_thermostat = seam.devices.get(
device_id = living_room_thermostat.device_id
)
# Inspect properties.current_climate_setting.hvac_mode_setting
# to confirm that setting the HVAC mode to heat was successful.
pprint(
updated_living_room_thermostat.
properties["current_climate_setting"]["hvac_mode_setting"]
)
Output:
'heat'
Code:
# Get the device by ID.
updated_living_room_thermostat=$(
# Use GET or POST.
curl -X 'GET' \
'https://connect.getseam.com/devices/get' \
-H 'accept: application/json' \
-H "Authorization: Bearer ${SEAM_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"device_id\": \"$(jq -r '.device_id' <<< ${living_room_thermostat})\"
}")
# Inspect properties.current_climate_setting.hvac_mode_setting
# to confirm that setting the HVAC mode to heat was successful.
echo $(jq -r '(.device.properties.current_climate_setting.hvac_mode_setting)' <<< ${updated_living_room_thermostat})
Output:
heat
Code:
// Get the device by ID.
const updatedLivingRoomThermostat = await seam.devices.get({
device_id: livingRoomThermostat.device_id
});
// Inspect properties.current_climate_setting.hvac_mode_setting
// to confirm that setting the HVAC mode to heat was successful.
console.log(
updatedLivingRoomThermostat.properties.
current_climate_setting.hvac_mode_setting
);
Output:
heat
Code:
# Get the device by ID.
updated_living_room_thermostat = seam.devices.get(
device_id: living_room_thermostat.device_id
)
# Inspect properties.current_climate_setting.hvac_mode_setting
# to confirm that setting the HVAC mode to heat was successful.
puts updated_living_room_thermostat.
properties.current_climate_setting.hvac_mode_setting
Output:
heat
Code:
// Get the device by ID.
$updated_living_room_thermostat = $seam->devices->get(
device_id: $living_room_thermostat->device_id
);
// Inspect properties.current_climate_setting.hvac_mode_setting
// to confirm that setting the HVAC mode to heat was successful.
echo $updated_living_room_thermostat->properties->
current_climate_setting->hvac_mode_setting;
Output:
heat
Code:
// Coming soon!
Output:
// Coming soon!
Code:
// Coming soon!
Output:
// Coming soon!
Code:
// Coming soon!
Output:
// Coming soon!
Create and schedule climate presets
You can use the Seam API to create climate presets for Google Nest thermostats. Each climate preset is a predefined configuration that specifies settings, such as HVAC mode, fan mode, and temperature set points. Climate presets make it quick and efficient for users to apply consistent climate settings tailored to different scenarios, enhancing both comfort and energy efficiency. For example, you could create two climate presets: a comfort preset for when a vacation rental is occupied and an eco preset for when the vacation rental is empty.
Once you create climate presets, you can schedule them to start and stop whenever you'd like. For example, you could schedule your thermostat to switch to the comfort preset in sync with your vacation rental reservations. You can even set a fallback climate preset, such as eco, and Seam enforces this preset's settings on your thermostat whenever there is no other active climate preset.
In this example, create comfort and eco climate presets, set eco as the fallback, and schedule the comfort climate preset to coincide with two vacation rental reservations.
Code:
# Confirm that the thermostat supports heat_cool mode
# so that the climate presets can use this mode.
if updated_living_room_thermostat.can_hvac_heat_cool:
# Create the climate presets.
seam.thermostats.create_climate_preset(
device_id = updated_living_room_thermostat.device_id,
climate_preset_key = "comfort",
name = "Comfort",
fan_mode_setting = "auto",
hvac_mode_setting = "heat_cool",
cooling_set_point_celsius = 25,
heating_set_point_celsius = 20
)
seam.thermostats.create_climate_preset(
device_id: updated_living_room_thermostat.device_id,
climate_preset_key = "eco",
name = "Eco",
fan_mode_setting = "auto",
hvac_mode_setting = "heat_cool",
cooling_set_point_celsius = 30,
heating_set_point_celsius = 15
)
# Then, set eco as the fallback climate setting.
seam.thermostats.set_fallback_climate_preset(
device_id = updated_living_room_thermostat.device_id,
climate_preset_key = "eco"
)
# Now, schedule the comfort preset to coincide with two reservations.
seam.thermostats.schedules.create(
device_id = updated_living_room_thermostat.device_id,
name = "Jim's stay",
climate_preset_key = "comfort",
starts_at = "2025-03-10T15:00:00Z",
ends_at = "2025-03-15T12:00:00Z",
is_override_allowed = True,
max_override_period_minutes = 90
)
seam.thermostats.schedules.create(
device_id = updated_living_room_thermostat.device_id,
name = "Jane's stay",
climate_preset_key = "comfort",
starts_at = "2025-03-17T15:00:00Z",
ends_at = "2025-03-20T12:00:00Z",
is_override_allowed = True,
max_override_period_minutes = 90
)
Seam makes it easy to develop your application. The robust Seam API and Seam SDKs in a wide variety of programming languages provide robust, up-to-date information about your thermostats. We also provide helpful thermostat-related events that enable you to monitor the status of your thermostats and the connected HVAC systems. Further, our simulation endpoints make it easy for you to test your thermostat app against events that can be difficult to orchestrate in your quality assurance (QA) environment using real devices.
Next steps
Now that you've completed this getting started guide for Google Nest thermostats, you can learn more about what you can do with the Seam API.
Quick links
This guide gives you a rapid introduction to connecting and controlling your thermostats using the Seam API. For application developers, you can use the Seam API in your app, and your users can authorize your app to control their devices using Seam.
For detailed information about the Google Nest devices that Seam supports, see the following table and our :
To learn more about other IoT device and system brands that Seam supports—such as Honeywell Resideo, ecobee, Yale, Schlage, and many more—visit our .
Another easy way to learn about what you can do with the Seam API is to explore the , which you can access from directly within the .
Seam provides client libraries for many languages, including JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and an spec.
JavaScript / TypeScript (, )
Python (, )
Ruby Gem (, )
PHP (, )
Java ()
C# (, )
Go ()
Install using .
Next, go to and to get your .
This guide uses a . You can only connect virtual devices and systems in this type of workspace. If you want to connect a real Google Nest thermostat, use a and API key.
To control your Google Nest thermostat using the Seam API, you must first authorize your Seam workspace to connect to your Google Nest account. If your application needs to connect to your users' Google Nest accounts, Seam provides fully-embedded, client-side to collect their authorization securely. These user-friendly pre-built authorization flows walk your users through the process of granting your Seam workspace permission to control their Google Nest thermostats. The Connect Webview presents a flow that prompts your users to enter their credentials for their Google Nest account.
The provides another easy way to connect devices to your Seam workspace.
Go to . On the Devices page, click + Add Devices. Then, see in this guide to complete the Connect Webview authorization flow.
For application developers, you can redirect your user to this Connect Webview URL so that they can authorize your app to control their devices using Seam. We even provide a prebuilt within our suite of that help you build your device management flow.
Because you're using a sandbox workspace, you can connect Seam's test Google Nest account. We provide for each of the brands that we support. These sandbox devices and systems enable you to test your app with devices from multiple brands without the need to own all the corresponding physical devices.
Complete the Connect Webview authorization flow by entering the following credentials:
When you link a Google Nest account with Seam, we create a device object to represent each Google Nest thermostat in your account. You can then retrieve these Google Nest devices using the and endpoints.
Each device that you connect to Seam has a specific set of capabilities. These capabilities define the Seam API actions that you can use. For thermostats, device-specific capabilities include whether you can to heat, cool, or heat_cool. Seam's intuitive and granular inform your application about what features and behaviors each device supports. Notice the capability flags within the code samples in this guide.
Specify the thermostat that you want to control by including the device_id in the request body. Also, include the desired temperature .
Each of these HVAC mode endpoints returns an to track the progress of the operation.
You can track the status of the operation to confirm that the device was set to heat mode successfully. Query properties.current_climate_setting.hvac_mode_setting for the device, by ID, or look for a . Further, if you wanted to find out whether the HVAC system was currently heating, you could inspect properties.is_heating for the device.
Now that you have learned the basics of using the Seam API, you can connect and control a real Google Nest device. To do so, make sure to switch to a and .
For more details about setting up your real Google Nest thermostat, see the .
Explore
See the that Seam supports.
Learn
Read about Seam and the that Seam supports.
Expand your abilities
Find out what other you can perform using the Seam API.
Use webhooks
Learn how to use as an efficient way to receive device events.
Find out more
Explore the other types of devices and systems that you can control with Seam, including , , and .
Develop for mobile access
Learn about Seam's .
If you have any questions or want to report an issue, email us at .
Use the Seam Connect Webview authorization flow to connect a Google Nest account with Seam. This flow varies slightly based on the device manufacturer.