Try @JasonJoel’s excellent component driver. It splits the motion sensor from the switch into separate devices, and allows automations to set the modes (occupancy, vacancy, manual). Highly recommended.