How should I connect my new motion-detecting light switch?
Run cable from the panel to the switch and another from the switch to the light. Connect the supply cable black to the switch's black wire with a wirenut. Connect the light cable's black wire to the red wire with a wirenut. Connect together the white wires with a wirenut , not connecting to the switch. Connect together the the green wires along with a separate short piece of green or bare wire with a wirenut. This short wire goes to the green screw. The yellow wire is not connected; cover the end with a wirenut.

At the light, connect black to black, white to white and green to ground.