Note that it's important to check the capabilities of a thermostat before attempting to use an imperative endpoint. For example, if a thermostat is attached to an HVAC system that does not have cooling capabilities, you cannot use /thermostats/cool or /thermostats/heat_cool. To check the capabilities of a thermostat, retrieve the thermostat and confirm the relevant capability flags.
These imperative operations return an action attempt that enables you to track the progress of the action. Poll this action attempt, until the action completes.
HVAC Settings
When you use an imperative endpoint to set the HVAC settings for a thermostat, you specify the HVAC mode and the desired set points in Fahrenheit or Celsius.
To set the HVAC mode and set points, issue a thermostat heat, cool, heat_cool, or off request and include the desired set points in the body of the request.
Fan Mode Settings
Seam supports the following fan mode settings:
Fan mode
Description
Process Overview
To configure and then verify a climate setting on a thermostat, perform the following steps:
Before you attempt to set the HVAC or fan mode settings for a thermostat, be sure to confirm that your device has the capability to perform these operations. You can inspect the capabilities of a device by checking the following capability flags for the device:
device.can_hvac_heat
device.can_hvac_cool
device.can_hvac_heat_cool
device.can_turn_off_hvac
Use the /devices/get endpoint for a specific device to return these capability flags. Then, use an if statement or similar check to confirm that the relevant flag is both present and true before attempting to perform the imperative thermostat action.
If the relevant capability flag is false or not present, you can view the properties of the device, errors or warnings for the device, and events related to the device to learn more about the cause of these issues. For example, you could examine device.properties.online. In addition, you could look for a device.disconnected event.
Device(
device_id='a4b775e3-feb2-4c6b-8e78-a73ec2d70b61',
can_hvac_heat=True, // You can use seam.thermostats.heat() on this device.
can_hvac_cool=True, // You can use seam.thermostats.cool() on this device.
can_hvac_heat_cool=True, // You can use seam.thermostats.heat_cool() on this device.
can_turn_off_hvac=True, // You can use seam.thermostats.off() on this device.
...
)
Request:
# 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": "a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"}'
Response:
{"device": {"device_id":"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61","can_hvac_heat":true,// You can use /thermostats/heat on this device."can_hvac_cool":true,// You can use /thermostats/cool on this device."can_hvac_heat_cool":true,// You can use /thermostats/heat_cool on this device."can_turn_off_hvac":true,// You can use /thermostats/off on this device. ... },"ok":true}
{ device_id: 'a4b775e3-feb2-4c6b-8e78-a73ec2d70b61', can_hvac_heat:true,// You can use seam.thermostats.heat() on this device. can_hvac_cool:true,// You can use seam.thermostats.cool() on this device. can_hvac_heat_cool:true,// You can use seam.thermostats.heatCool() on this device. can_turn_off_hvac:true,// You can use seam.thermostats.off() on this device. ...}
{"device_id":"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61","can_hvac_heat":true,// You can use $seam->thermostats->heat() on this device."can_hvac_cool":true,// You can use $seam->thermostats->cool() on this device."can_hvac_heat_cool":true,// You can use $seam->thermostats->heat_cool() on this device."can_turn_off_hvac":true,// You can use $seam->thermostats->off() on this device. ...}
Request:
// Coming soon!
Response:
// Coming soon!
Request:
// Coming soon!
Response:
// Coming soon!
Request:
// Coming soon!
Response:
// Coming soon!
Set a Thermostat to Heat Mode
You can set a thermostat to heat mode and specify a desired heating set point temperature. By establishing the set point, the thermostat activates the associated heating system to maintain the specified temperature.
Issue the thermostat heat request, providing the device_id of the thermostat and the heating_set_point_celsius or heating_set_point_fahrenheit.
Request:
# Get the thermostat.thermostat = seam.devices.get( device_id ="a4b775e3-feb2-4c6b-8e78-a73ec2d70b61")# Confirm that the thermostat supports heat mode.if thermostat.can_hvac_heat:# Perform the heat request. seam.thermostats.heat( device_id = thermostat.device_id, heating_set_point_celsius =20 )
// Get the thermostat.constthermostat=awaitseam.devices.get({ device_id:"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"});// Confirm that the thermostat supports heat mode.if (thermostat.can_hvac_heat) {// Perform the heat request.awaitseam.thermostats.heat({ device_id:thermostat.device_id, heating_set_point_celsius:20 })};
// Get the thermostat.$thermostat = $seam->devices->get( device_id:"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61");// Confirm that the thermostat supports heat mode.if ($thermostat->can_hvac_heat) {// Perform the heat request. $seam->thermostats->heat( device_id: $thermostat->device_id, heating_set_point_celsius:20);}
You can set a thermostat to cool mode and specify a desired cooling set point temperature. By establishing the set point, the thermostat activates the associated cooling system to maintain the specified temperature.
Issue the thermostat cool request, providing the device_id of the thermostat and the cooling_set_point_celsius or cooling_set_point_fahrenheit.
Request:
# Get the thermostat.thermostat = seam.devices.get( device_id ="a4b775e3-feb2-4c6b-8e78-a73ec2d70b61")# Confirm that the thermostat supports cool mode.if thermostat.can_hvac_cool:# Perform the cool request. seam.thermostats.cool( device_id = thermostat.device_id, cooling_set_point_celsius =25 )
// Get the thermostat.constthermostat=awaitseam.devices.get({ device_id:"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"});// Confirm that the thermostat supports cool mode.if (thermostat.can_hvac_cool) {// Perform the cool request.awaitseam.thermostats.cool({ device_id:thermostat.device_id, cooling_set_point_celsius:25 })};
// Get the thermostat.$thermostat = $seam->devices->get( device_id:"a4b775e3-feb2-4c6b-8e78-a73ec2d70b61");// Confirm that the thermostat supports cool mode.if ($thermostat->can_hvac_cool) {// Perform the cool request. $seam->thermostats->cool( device_id: $thermostat->device_id, cooling_set_point_celsius:25);}
You can set a thermostat to heat-cool (also known as "auto") mode and specify desired set point temperatures for both heating and cooling. By establishing the set points, the thermostat activates the associated heating and cooling systems as needed to maintain the specified temperature range.
Issue the thermostat heat_cool request, providing the device_id of the thermostat and the following set points:
heating_set_point_celsius or heating_set_point_fahrenheit
cooling_set_point_celsius or cooling_set_point_fahrenheit
Request:
# Get the thermostat.thermostat = seam.devices.get( device_id ="a4b775e3-feb2-4c6b-8e78-a73ec2d70b61")# Confirm that the thermostat supports heat-cool mode.if thermostat.can_hvac_heat_cool:# Perform the heat_cool request. seam.thermostats.heat_cool( device_id = thermostat.device_id, heating_set_point_celsius =20, cooling_set_point_celsius =25 )
You can set a thermostat to "off" mode, which deactivates the associated heating and cooling systems. In this state, the thermostat does not regulate indoor temperatures.
Issue the thermostat off request, providing the device_id of the thermostat.
Request:
# Get the thermostat.
thermostat = seam.devices.get(
device_id = "a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"
)
# Confirm that the thermostat supports off mode.
if thermostat.can_turn_off_hvac:
# Perform the off request.
seam.thermostats.off(
device_id = thermostat.device_id
)
// Get the thermostat.
const thermostat = await seam.devices.get({
device_id: "a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"
});
// Confirm that the thermostat supports off mode.
if (thermostat.can_turn_off_hvac) {
// Perform the off request.
await seam.thermostats.off({
device_id: thermostat.device_id
})
};
// Get the thermostat.
$thermostat = $seam->devices->get(
device_id: "a4b775e3-feb2-4c6b-8e78-a73ec2d70b61"
);
// Confirm that the thermostat supports off mode.
if ($thermostat->can_turn_off_hvac) {
// Perform the off request.
$seam->thermostats->off(
device_id: $thermostat->device_id
);
}
The imperative HVAC or fan mode setting request returns an action attempt. Use the action_attempt_id from this response to poll the associated action attempt using the /action_attempts/get request. When the setting modification completes successfully, the status of the action attempt changes to success.
The fan runs all the time, regardless of whether the HVAC system is cooling or heating.
auto
The fan runs whenever the HVAC system is cooling or heating but does not run at other times.
circulate
The fan runs for a specific number of minutes each hour, regardless of whether the HVAC system is cooling or heating. This setting is only supported on certain Honeywell thermostats.