> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Activating a Climate Preset

> Learn how to activate a preconfigured climate preset immediately.

In addition to [scheduling](../creating-and-managing-thermostat-schedules) climate presets for a thermostat, you can activate a configured climate preset immediately. When you activate a climate preset, it overrides any scheduled climate preset that is already active on the thermostat.

Activating a climate preset returns an [action attempt](../../../core-concepts/action-attempts) that enables you to track the progress of the action. Poll this action attempt, until the action completes.

Further, Seam emits a [`thermostat.temperature_reached_set_point` event](/api/events/object) when the thermostat reports a temperature within 1° Celsius of the heating or cooling [set point](../understanding-thermostat-concepts/set-points) specified in the climate preset that you've activated. You can configure a [webhook](../../../developer-tools/webhooks) to watch for this event.

***

## Activate a Climate Preset

To activate a climate preset, issue a [`/thermostats/activate_climate_preset`](/api/thermostats/activate_climate_preset) request and specify the `climate_preset_key` of the desired climate preset.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.thermostats.activateClimatePreset({
    device_id: '2d488679-6f07-4810-aed2-e726872c1dd5',
    climate_preset_key: 'occupied',
  })
  ```

  ```bash cURL theme={null}
  curl -X 'POST' \
    'https://connect.getseam.com/thermostats/activate_climate_preset' \
    -H 'accept: application/json' \
    -H "Authorization: Bearer ${SEAM_API_KEY}" \
    -H 'Content-Type: application/json' \
    -d '{
      "device_id": "2d488679-6f07-4810-aed2-e726872c1dd5",
      "climate_preset_key": "occupied"
  }'
  ```

  ```python Python theme={null}
  seam.thermostats.activate_climate_preset(
    device_id = "2d488679-6f07-4810-aed2-e726872c1dd5",
    climate_preset_key = "occupied"
  )
  ```

  ```ruby Ruby theme={null}
  # Coming soon!
  ```

  ```php PHP theme={null}
  $seam->thermostats->activate_climate_preset(
    device_id: "2d488679-6f07-4810-aed2-e726872c1dd5",
    climate_preset_key: "occupied"
  );
  ```

  ```java C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    "status": "success",
    "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
    "action_type": "ACTIVATE_CLIMATE_PRESET",
    "result": {},
    "error": null
  }
  ```

  ```json cURL theme={null}
  {
    "action_attempt": {
      "status": "pending",
      "action_type": "ACTIVATE_CLIMATE_PRESET",
      "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
      "result": null,
      "error": null
    },
    "ok": true
  }
  ```

  ```json Python theme={null}
  ActionAttempt(
    action_attempt_id='05de2295-d1dc-4748-aae3-9931658bde20',
    action_type='ACTIVATE_CLIMATE_PRESET',
    error={},
    result={},
    status='success'
  )
  ```

  ```json Ruby theme={null}
  # Coming soon!
  ```

  ```json PHP theme={null}
  {
    "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
    "action_type": "ACTIVATE_CLIMATE_PRESET",
    "error": null,
    "result": {},
    "status": "success"
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

***

## Poll the Action Attempt

Activating a climate preset returns an [action attempt](../../../core-concepts/action-attempts). Use the `action_attempt_id` from this response to poll the associated action attempt using the [`/action_attempts/get`](/api/action_attempts/get) request. When the activation completes successfully, the `status` of the action attempt changes to `success`.

**Request:**

<CodeGroup>
  ```javascript JavaScript theme={null}
  await seam.actionAttempts.get(
    action_attempt_id: "05de2295-d1dc-4748-aae3-9931658bde20"
  );
  ```

  ```bash cURL theme={null}
  # Use GET or POST.
  curl -X 'GET' \
    'https://connect.getseam.com/action_attempts/get' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer ${SEAM_API_KEY}' \
    -H 'Content-Type: application/json' \
    -d '{
    "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20"
  }'
  ```

  ```python Python theme={null}
  seam.action_attempts.get(
    action_attempt_id = "05de2295-d1dc-4748-aae3-9931658bde20"
  )
  ```

  ```ruby Ruby theme={null}
  # Coming soon!
  ```

  ```php PHP theme={null}
  $seam->action_attempts->get(
    action_attempt_id: "05de2295-d1dc-4748-aae3-9931658bde20"
  );
  ```

  ```csharp C# theme={null}
  // Coming soon!
  ```
</CodeGroup>

**Response:**

<CodeGroup>
  ```json JavaScript theme={null}
  {
    "status": "success",
    "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
    "action_type": "ACTIVATE_CLIMATE_PRESET",
    "result": {},
    "error": null
  }
  ```

  ```json cURL theme={null}
  {
    "action_attempt": {
      "status": "success",
      "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
      "action_type": "ACTIVATE_CLIMATE_PRESET",
      "result": {},
      "error": null
    },
    "ok": true
  }
  ```

  ```json Python theme={null}
  ActionAttempt(
    action_attempt_id='05de2295-d1dc-4748-aae3-9931658bde20',
    action_type='ACTIVATE_CLIMATE_PRESET',
    error={},
    result={},
    status='success'
  )
  ```

  ```json Ruby theme={null}
  # Coming soon!
  ```

  ```json PHP theme={null}
  {
    "action_attempt_id": "05de2295-d1dc-4748-aae3-9931658bde20",
    "action_type": "ACTIVATE_CLIMATE_PRESET",
    "error": null,
    "result": {},
    "status": "success"
  }
  ```

  ```json C# theme={null}
  // Coming soon!
  ```
</CodeGroup>
