Skip to main content
Use Seam to connect an ecobee thermostat, change supported temperature settings, and schedule climate presets around a reservation. Your application receives booking updates from its reservation software and translates them into Seam schedule changes; this guide does not require or imply a native PMS connector. Before connecting a real device, confirm that it is online in the ecobee app and authenticate as the account owner to whom the thermostat is registered. A household member account may not own the devices. See the ecobee setup guide. Create a Seam account and get an API key to start with a virtual thermostat. Then follow the reservation lifecycle after creating a climate preset below.

Step 1: Install a Seam SDK

Seam provides client libraries for many languages, including JavaScript, Python, Ruby, PHP, and others, as well as a Postman collection and an OpenAPI spec. First, install a Seam SDK, as follows:
Next, go to https://console.seam.co/ and sign up for Seam to get your API key. Then, export your API key as an environment variable.
This guide uses a sandbox workspace. You can only connect virtual devices and systems in this type of workspace. If you want to connect a real ecobee thermostat, use a non-sandbox workspace and API key.

To control your ecobee thermostat using the Seam API, you must first authorize your Seam workspace to connect to your ecobee account. If your application needs to connect to your users’ ecobee accounts, Seam provides fully-embedded, customizable client-side Connect Webviews 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 ecobee thermostats. The Connect Webview presents a flow that prompts your users to enter their credentials for their ecobee account. 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 ecobee account.
This guide shows you how to create a Connect Webview programmatically using the Seam API.The Seam Console provides another easy way to connect devices to your Seam workspace.Go to https://console.seam.co/. On the Devices page, click + Add Devices. Then, see Authorize your workspace in this guide to complete the Connect Webview authorization flow.You can also use the Seam Console to add devices.

Create a Connect Webview

Create a connect_webview object and then note the returned URL. Code:
Output:

Authorize Your Workspace

In a web browser, go to the URL that the Connect Webview object returned. 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 Connect Account Button within our suite of Seam Components that help you build your device management flow.
Because you’re using a sandbox workspace, you can connect Seam’s test ecobee account. We provide virtual devices 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 ecobee sandbox account credentials: Use the Seam Connect Webview authorization flow to connect an ecobee account with Seam. This flow varies slightly based on the device manufacturer. Confirm that authorization through the Connect Webview was successful by querying its status. Code:
Output:

Step 3: Retrieve ecobee thermostat devices

When you link an ecobee account with Seam, we create a device object to represent each ecobee thermostat in your account. You can then retrieve these ecobee devices using the List Devices and Get Device endpoints. 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:
Output:

Step 4: Control your ecobee thermostat

Next, you can use the Seam API to control your ecobee thermostat. 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 set the HVAC mode to heat, cool, or heat_cool. Seam’s intuitive and granular capability flags inform your application about what features and behaviors each device supports. Notice the capability flags within the code samples in this guide. Seam provides additional actions for thermostats, such as setting the fan mode, creating and scheduling climate presets, setting temperature thresholds, and configuring weekly thermostat programs. You can also monitor for Seam thermostat-related events, such as reported temperatures outside your set thresholds. Try out the following actions on your ecobee 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.
Specify the thermostat that you want to control by including the device_id in the request body. Also, include the desired temperature set point. In this example, set the HVAC mode to heat and the desired heating set point to 68 °F. Each of these HVAC mode endpoints returns an action attempt to track the progress of the operation. Code:
Output:
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, retrieve the action attempt by ID, or look for a thermostat.manually_adjusted event. Further, if you wanted to find out whether the HVAC system was currently heating, you could inspect properties.is_heating for the device. To query properties.current_climate_setting.hvac_mode_setting for the device: Code:
Output:

Create and schedule climate presets

You can use the Seam API to create climate presets for ecobee thermostats. Each climate preset is a saved group of settings, such as HVAC mode, fan mode, and temperature set points. Climate presets make it quick and easy to apply consistent climate settings for different scenarios. 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. You can schedule climate presets to start and stop whenever you’d like. You can even set a fallback climate preset, such as eco. 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:
Output:

Handle booking changes and cancellations

Store one thermostat_schedule_id for each booking and thermostat in your application. Process booking notifications in order, ignore an older booking version, and reuse the stored ID when a notification is delivered again. Convert check-in and checkout from the property’s IANA time zone to ISO 8601 instants before calling Seam. Do not interpret local booking times in your server’s time zone. Recompute the instants when dates change across daylight saving time. Preconditioning, such as starting comfort mode before arrival, is an offset your application chooses. The following server-side example uses the comfort preset created above. Set ECOBEE_DEVICE_ID to the intended thermostat and BOOKING_STARTS_AT and BOOKING_ENDS_AT to future ISO timestamps with Z or an explicit offset.
JavaScript
For production, place these create, update and delete operations in the corresponding booking handlers. Persist the intended operation before making a request. If a create request times out, reconcile existing schedules against your stored booking mapping before retrying; a repeated create can make another schedule. Retry transient failures with backoff, keep failed operations visible to staff, and preserve the schedule ID until cancellation is confirmed. A schedule record confirms the requested times, not the room’s temperature. Check errors, properties.active_thermostat_schedule_id, properties.current_climate_setting and reported temperature to distinguish scheduling, applied settings and physical response. The fallback preset takes effect when no schedule or overriding control is active; account for other schedules and manual overrides. Do not switch HVAC off as a generic error fallback. For a sandbox check, create a short future schedule, read it back, update checkout, and cancel it. This validates the API lifecycle. Verify actual HVAC response and safe unoccupied temperatures on the installed system before deployment. See thermostat schedules for the full scheduling rules, or Reservation Automations to use Seam’s reservation-data workflow.

Configure a weekly thermostat program

You can use the Seam API to create a thermostat weekly program for your ecobee thermostat. This standard feature of smart thermostats enables you to define full-week programs that are made up of reusable daily programs. Each daily program consists of a set of thermostat daily program periods, that is, time blocks with associated climate presets. In this example, create a weekday daily program and a weekend daily program. Then, combine these daily programs into a weekly program by assigning a daily program to each day of the week. Code:
Output:

Step 5: Connect a real ecobee thermostat

Now that you have learned the basics of using the Seam API, you can connect and control a real ecobee device. To do so, make sure to switch to a non-sandbox workspace and API key. For more details about setting up your real ecobee thermostat, see the ecobee thermostats integration guide.

Step 6: Build your application!

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 ecobee devices, you can learn more about what you can do with the Seam API.
If you have any questions or want to report an issue, email us at support@seam.co.

seam-api-key

Get an API Key (free)

Sign up for the Seam Console and get your API keys. →
seam-contact-us-light

Contact Sales

Got a project or a specific question? Contact our team to get answers. →