Thanks jakaskerl
I read about that before, but I couldn't find it in C++. I would also like some limits for the automatic control since I want it on even when it's bright to assure penetrating e.g. sunglasses.
For now I use IR intensity 0.3, turn off anti banding, set the exposure limit to 10000, activate auto exposure and "continuously" update the exposure region.
With that I get an exposure time of 10 ms (what I set) and a sensitivity around 235 for a face about 0.7 meters away and a darkish room sitting in front of a fairly bright monitor.
The sensitive changes when changing the distance between face and camera, so it appears to work ok. I'll have to see what happens when I take it outside and sun light…