> ## 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.

# Set the HVAC Mode

> Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).



## OpenAPI

````yaml /openapi.json post /thermostats/set_hvac_mode
openapi: 3.0.0
info:
  title: Seam Connect
  version: 1.0.0
servers:
  - url: https://connect.getseam.com
security: []
tags:
  - description: access_codes
    name: /access_codes
  - description: acs
    name: /acs
  - description: action_attempts
    name: /action_attempts
  - description: client_sessions
    name: /client_sessions
  - description: connected_accounts
    name: /connected_accounts
  - description: connect_webviews
    name: /connect_webviews
  - description: devices
    name: /devices
  - description: events
    name: /events
  - description: health
    name: /health
  - description: locks
    name: /locks
  - description: networks
    name: /networks
  - description: noise_sensors
    name: /noise_sensors
  - description: phones
    name: /phones
  - description: thermostats
    name: /thermostats
  - description: user_identities
    name: /user_identities
  - description: webhooks
    name: /webhooks
  - description: workspaces
    name: /workspaces
paths:
  /thermostats/set_hvac_mode:
    post:
      tags:
        - /thermostats
      summary: Set the HVAC Mode
      description: >-
        Sets the [HVAC
        mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings)
        for a specified
        [thermostat](https://docs.seam.co/capability-guides/thermostats).
      operationId: thermostatsSetHvacModePost
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                propertyName: hvac_mode_setting
              oneOf:
                - properties:
                    device_id:
                      description: >-
                        ID of the thermostat device for which you want to set
                        the HVAC mode.
                      format: uuid
                      type: string
                    hvac_mode_setting:
                      enum:
                        - 'off'
                      type: string
                  required:
                    - hvac_mode_setting
                    - device_id
                  type: object
                - properties:
                    cooling_set_point_celsius:
                      description: >-
                        [Cooling set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °C that you want to set for the thermostat. You must
                        set one of the `cooling_set_point` parameters.
                      format: float
                      type: number
                    cooling_set_point_fahrenheit:
                      description: >-
                        [Cooling set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °F that you want to set for the thermostat. You must
                        set one of the `cooling_set_point` parameters.
                      format: float
                      type: number
                    device_id:
                      description: >-
                        ID of the thermostat device for which you want to set
                        the HVAC mode.
                      format: uuid
                      type: string
                    hvac_mode_setting:
                      enum:
                        - cool
                      type: string
                  required:
                    - hvac_mode_setting
                    - device_id
                  type: object
                - properties:
                    device_id:
                      description: >-
                        ID of the thermostat device for which you want to set
                        the HVAC mode.
                      format: uuid
                      type: string
                    heating_set_point_celsius:
                      description: >-
                        [Heating set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °C that you want to set for the thermostat. You must
                        set one of the `heating_set_point` parameters.
                      format: float
                      type: number
                    heating_set_point_fahrenheit:
                      description: >-
                        [Heating set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °F that you want to set for the thermostat. You must
                        set one of the `heating_set_point` parameters.
                      format: float
                      type: number
                    hvac_mode_setting:
                      enum:
                        - heat
                      type: string
                  required:
                    - hvac_mode_setting
                    - device_id
                  type: object
                - properties:
                    cooling_set_point_celsius:
                      description: >-
                        [Cooling set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °C that you want to set for the thermostat. You must
                        set one of the `cooling_set_point` parameters.
                      format: float
                      type: number
                    cooling_set_point_fahrenheit:
                      description: >-
                        [Cooling set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °F that you want to set for the thermostat. You must
                        set one of the `cooling_set_point` parameters.
                      format: float
                      type: number
                    device_id:
                      description: >-
                        ID of the thermostat device for which you want to set
                        the HVAC mode.
                      format: uuid
                      type: string
                    heating_set_point_celsius:
                      description: >-
                        [Heating set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °C that you want to set for the thermostat. You must
                        set one of the `heating_set_point` parameters.
                      format: float
                      type: number
                    heating_set_point_fahrenheit:
                      description: >-
                        [Heating set
                        point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points)
                        in °F that you want to set for the thermostat. You must
                        set one of the `heating_set_point` parameters.
                      format: float
                      type: number
                    hvac_mode_setting:
                      enum:
                        - heat_cool
                      type: string
                  required:
                    - hvac_mode_setting
                    - device_id
                  type: object
                - properties:
                    device_id:
                      description: >-
                        ID of the thermostat device for which you want to set
                        the HVAC mode.
                      format: uuid
                      type: string
                    hvac_mode_setting:
                      enum:
                        - eco
                      type: string
                  required:
                    - hvac_mode_setting
                    - device_id
                  type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  action_attempt:
                    type: object
                    description: >-
                      Tracks the progress of this operation. Poll using the
                      action_attempt_id.
                    properties:
                      action_attempt_id:
                        type: string
                        format: uuid
                        description: ID of the action attempt.
                      action_type:
                        type: string
                        enum:
                          - SET_HVAC_MODE
                        description: Type of action being tracked.
                      status:
                        type: string
                        enum:
                          - pending
                          - success
                          - error
                        description: Current status of the action.
                      result:
                        type: object
                        nullable: true
                        description: Result payload on success.
                      error:
                        type: object
                        nullable: true
                        description: Error details on failure.
                        properties:
                          type:
                            type: string
                          message:
                            type: string
                    required:
                      - action_attempt_id
                      - action_type
                      - status
                  ok:
                    type: boolean
                required:
                  - action_attempt
                  - ok
                type: object
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security:
        - client_session: []
        - pat_with_workspace: []
        - console_session_with_workspace: []
        - api_key: []
      x-codeSamples:
        - lang: javascript
          label: Seam SDK
          source: |-
            await seam.thermostats.setHvacMode({
              device_id: "5d5c3b30-5fed-47a3-9df1-ed32f32589e5",
              hvac_mode_setting: "heat_cool",
              heating_set_point_celsius: 20,
              cooling_set_point_celsius: 25,
            });

            /*
            {
              "action_attempt_id": "b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",
              "action_type": "SET_HVAC_MODE",
              "error": null,
              "result": {},
              "status": "success"
            }
            */
        - lang: bash
          label: cURL
          source: >-
            curl --include --request POST
            "https://connect.getseam.com/thermostats/set_hvac_mode" \
              --header "Authorization: Bearer $SEAM_API_KEY" \
              --json @- <<EOF
            {
              "device_id": "5d5c3b30-5fed-47a3-9df1-ed32f32589e5",
              "hvac_mode_setting": "heat_cool",
              "heating_set_point_celsius": 20,
              "cooling_set_point_celsius": 25
            }

            EOF


            # Response:

            # {

            #   "action_attempt": {

            #     "action_attempt_id": "b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",

            #     "action_type": "SET_HVAC_MODE",

            #     "error": null,

            #     "result": {},

            #     "status": "success"

            #   }

            # }
        - lang: python
          label: Seam SDK
          source: |-
            seam.thermostats.set_hvac_mode(
                device_id="5d5c3b30-5fed-47a3-9df1-ed32f32589e5",
                hvac_mode_setting="heat_cool",
                heating_set_point_celsius=20,
                cooling_set_point_celsius=25,
            )

            # ActionAttempt(
                action_attempt_id="b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",
                action_type="SET_HVAC_MODE",
                error=None,
                result={},
                status="success",
            )
        - lang: ruby
          label: Seam SDK
          source: |-
            seam.thermostats.set_hvac_mode(
              device_id: "5d5c3b30-5fed-47a3-9df1-ed32f32589e5",
              hvac_mode_setting: "heat_cool",
              heating_set_point_celsius: 20,
              cooling_set_point_celsius: 25,
            )

            # => {
              "action_attempt_id" => "b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",
              "action_type" => "SET_HVAC_MODE",
              "error" => nil,
              "result" => {
              },
              "status" => "success",
            }
        - lang: php
          label: Seam SDK
          source: |-
            $seam->thermostats->set_hvac_mode(
                device_id: "5d5c3b30-5fed-47a3-9df1-ed32f32589e5",
                hvac_mode_setting: "heat_cool",
                heating_set_point_celsius: 20,
                cooling_set_point_celsius: 25,
            );

            // [
                "action_attempt_id" => "b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",
                "action_type" => "SET_HVAC_MODE",
                "error" => null,
                "result" => [],
                "status" => "success",
            ];
        - lang: bash
          label: Seam CLI
          source: >-
            seam thermostats set-hvac-mode --device_id
            "5d5c3b30-5fed-47a3-9df1-ed32f32589e5" --hvac_mode_setting
            "heat_cool" --heating_set_point_celsius 20
            --cooling_set_point_celsius 25


            # {

            #   "action_attempt_id": "b0e1d2c3-4f5e-6a7b-8c9d-0e1f2a3b4c5d",

            #   "action_type": "SET_HVAC_MODE",

            #   "error": null,

            #   "result": {},

            #   "status": "success"

            # }
components:
  securitySchemes:
    client_session:
      bearerFormat: Client Session Token
      scheme: bearer
      type: http
    pat_with_workspace:
      bearerFormat: API Token
      scheme: bearer
      type: http
    console_session_with_workspace:
      bearerFormat: Console Session Token
      scheme: bearer
      type: http
    api_key:
      bearerFormat: API Key
      scheme: bearer
      type: http

````