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

# Hold a temperature

> Override an HVAC device's schedule with a fixed temperature, then release it.

Push `heat` or `cool` with a `target` to hold that temperature until you say otherwise. Push `auto.schedule` to release the hold.

## 1. Check the device supports it

```bash theme={null}
curl https://api.amps.ai/hvac/device_abc123 \
  -H "x-api-key: $AMPS_API_KEY"
```

```json theme={null}
{
  "success": true,
  "data": {
    "id": "device_abc123",
    "state": { "temperature": 18.5, "mode": "heat", "heatSetpoint": 19, "holdType": "schedule" },
    "commands": {
      "heat": {
        "parameters": { "target": { "unit": "celsius", "min": 10, "max": 35 } },
        "execution": ["immediate", "scheduled", "windowed"]
      },
      "auto.schedule": { "parameters": {}, "execution": ["immediate"] }
    },
    "conflictStrategies": ["cancel_and_replace"]
  }
}
```

## 2. Send the command

```bash theme={null}
curl -X POST https://api.amps.ai/hvac/device_abc123 \
  -H "x-api-key: $AMPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": {
      "command": "heat",
      "parameters": { "target": { "value": 21, "unit": "celsius" } }
    }
  }'
```

```json theme={null}
{
  "success": true,
  "data": {
    "id": "action_MXfJmEfsEp",
    "command": "heat",
    "parameters": { "target": { "value": 21, "unit": "celsius" } },
    "state": "acknowledged"
  }
}
```

To hold a band instead, push `auto.maintain` with `heatSetpoint` and `coolSetpoint`. A new command replaces the hold; if the previous one is still in flight you'll get a `409` (see [Conflicts](/guides/push/conflicts)).

## 3. Confirm

When the action is `completed`, the device reads `holdType: "permanent"` and `heatSetpoint: 21`. See [Push](/guides/push) for the lifecycle.

## Release the hold

```bash theme={null}
curl -X POST https://api.amps.ai/hvac/device_abc123 \
  -H "x-api-key: $AMPS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "action": { "command": "auto.schedule" } }'
```

The device reads `holdType: "schedule"` again. `auto.schedule` is immediate only: sending `start` or `end` with it returns `422 DEVICE_NOT_CAPABLE`.

## Next steps

<CardGroup cols={2}>
  <Card title="Heat for a window" icon="clock" href="/cookbooks/hvac/heat-for-a-window">
    Hold a temperature between a start and end time.
  </Card>

  <Card title="Webhooks" icon="bell" href="/guides/webhooks">
    Get notified when the hold is applied.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.