> ## Documentation Index
> Fetch the complete documentation index at: https://developer.energy-hub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit command to change temperature of HVAC

> This endpoint creates an asynchronously executed command request to change temperature of HVAC.



## OpenAPI

````yaml post /v1.0.0/hvacs/{hvacId}/commands/temperature
openapi: 3.0.1
info:
  description: A service used for HVAC devices
  title: hvac-service
  version: 1.0.0
servers:
  - description: Generated server url
    url: https://api.energy-hub.io
security: []
paths:
  /v1.0.0/hvacs/{hvacId}/commands/temperature:
    post:
      tags:
        - Hvac Controller
      summary: Submit command to change temperature of HVAC
      description: >-
        This endpoint creates an asynchronously executed command request to
        change temperature of HVAC.
      operationId: setTemperature_1
      parameters:
        - schema:
            format: uuid
            type: string
          in: path
          name: hvacId
          description: HVAC ID
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommandTemperatureRequest'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitCommandResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorMessageDto'
              examples:
                BAD_REQUEST:
                  $ref: '#/components/examples/BAD_REQUEST'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                UNAUTHORIZED:
                  $ref: '#/components/examples/UNAUTHORIZED'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                HVAC_NOT_FOUND:
                  $ref: '#/components/examples/HVAC_NOT_FOUND'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                COMMAND_ALREADY_SUBMITTED:
                  $ref: '#/components/examples/COMMAND_ALREADY_SUBMITTED'
                COMMAND_TYPE_NOT_ALLOWED:
                  $ref: '#/components/examples/COMMAND_TYPE_NOT_ALLOWED'
        '501':
          description: Not implemented
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessageDto'
              examples:
                COMMAND_REQUEST_NOT_IMPLEMENTED:
                  $ref: '#/components/examples/COMMAND_REQUEST_NOT_IMPLEMENTED'
      security:
        - API_Key: []
components:
  schemas:
    CommandTemperatureRequest:
      description: Object of temperature target of HVAC device.
      type: object
      properties:
        temperature:
          format: double
          description: The target temperature set by the user in °C.
          type: number
          example: 18.1
    SubmitCommandResponse:
      type: object
      required:
        - createdAt
        - deviceId
        - id
        - state
        - type
        - userId
      properties:
        createdAt:
          format: date-time
          description: The timestamp when command is created.
          type: string
        id:
          format: uuid
          description: The ID of the command.
          type: string
        state:
          $ref: '#/components/schemas/CommandState'
        type:
          description: The name of the command type to execute.
          type: string
          enum:
            - SET_TEMPERATURE
            - SET_MODE
            - SET_SCHEDULE
            - POWER_BOOST
        userId:
          description: The ID of the user.
          type: string
          example: 896f9d5a-b618-48a2-98ae-957059bf1bc9
        deviceId:
          format: uuid
          description: The ID of the vehicle.
          type: string
    ValidationErrorMessageDto:
      allOf:
        - $ref: '#/components/schemas/ErrorMessageDto'
        - type: object
          properties:
            errorCode:
              description: The error code
              type: string
              example: EXAMPLE_ERROR_CODE
            validationErrors:
              description: List of validation errors
              type: array
              items:
                $ref: '#/components/schemas/ValidationError'
            id:
              format: uuid
              description: The error identifier
              type: string
              example: 7958818d-64d2-4ede-b12b-4786dd2f348b
            message:
              description: The error message
              type: string
              example: Example error message
      type: object
      required:
        - errorCode
        - id
        - message
    ErrorMessageDto:
      type: object
      required:
        - errorCode
        - id
        - message
      properties:
        errorCode:
          description: The error code
          type: string
          example: EXAMPLE_ERROR_CODE
        id:
          format: uuid
          description: The error identifier
          type: string
          example: 7958818d-64d2-4ede-b12b-4786dd2f348b
        message:
          description: The error message
          type: string
          example: Example error message
    CommandState:
      description: |
        The state of the command.
        * `PENDING` - Command is waiting to be executed.
        * `FAILED` - Execution of command has failed.
        * `EXECUTED` - Command has been executed successfully.
      type: string
      enum:
        - PENDING
        - EXECUTED
        - FAILED
    ValidationError:
      type: object
      properties:
        field:
          description: Affected field
          type: string
        message:
          description: Validation message
          type: string
  examples:
    BAD_REQUEST:
      value:
        errorCode: BAD_REQUEST
        validationErrors:
          - field: Affected field
            message: Validation message
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: Bad request
    UNAUTHORIZED:
      value:
        errorCode: UNAUTHORIZED
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: Unauthorized
    HVAC_NOT_FOUND:
      value:
        errorCode: HVAC_NOT_FOUND
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: '[HVAC] HVAC not found'
    COMMAND_ALREADY_SUBMITTED:
      value:
        errorCode: COMMAND_ALREADY_SUBMITTED
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: '[VEHICLE] Command has already been submitted'
    COMMAND_TYPE_NOT_ALLOWED:
      value:
        errorCode: COMMAND_TYPE_NOT_ALLOWED
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: '[VEHICLE] Command type for this vehicle is not allowed'
    COMMAND_REQUEST_NOT_IMPLEMENTED:
      value:
        errorCode: COMMAND_REQUEST_NOT_IMPLEMENTED
        id: 4c30ae83-182e-4c92-a108-b6ee12619de8
        message: '[VEHICLE] Submitting command request is not implemented'
  securitySchemes:
    API_Key:
      in: header
      name: X-API-KEY
      description: API key used for authorization and authentication.
      type: apiKey

````