Use sensor to switch off lights

If by sensor you mean a Hue Motion Sensor, yes that is possible. Go the the motion sensor in Hue Essentials and you can configure it to do what you want.

See also: Device state automations (smart switches, motion sensors, lights, and plugs)