In "New Action" we will leave the dropdown on "Start a program". In the "Program/script:" box, type (without the quotes) "C:\Windows\System32\cleanmgr.exe". In the "Add arguments (optional):" box, put the disk select switch and the sagerun switch, (without the quotes) "/D C /sagerun:01". The disk select switch (/D C) keeps Task Scheduler from stalling waiting for user input.
Click OK, the New Action box will close and you will return to the "Create Task" dialog box. Click on the Conditions tab.
The Conditions depend on whether you are setting the task to run on a desktop or laptop. A network connection is not necessary for Disk Cleanup. Whether or not a laptop is on battery power is important. In my experience, if the task is running in the wee hours, there's no need to wait for idle time; it is idle.
When you have the conditions set to your preference, click the Settings tab.