Automatically set special motion detection mode when everyone is in bed

Most of the lights in my house are triggered by hue motion detectors. The problem is that when we are asleep and going to get a drink from the kitchen we get a bright light in the face, even if it is at 10am and we are still hungover. Not a smart light.

So, I would essentially like two different modes for the motion detector lights in the house. One for when everyone is sleeping and one for normal daytime use (when one or more people are not sleeping). (My use case is more complex than this but this is the principle.)

I know when people are sleeping as we use a sleep app that can trigger a personX_in_bed variable in apilio, one for each person. Apilio can then trigger a routine when all person*_in_bed variables are true and when any are false. I know I can set variables in the bridge, but not sure how to automate these. I’m not sure how and if I can automate reconfiguring the sensors in any way.

Is it possible reconfigure the motion detectors using Hue Essentials in this way, or any other suggestions? I currently use Ifttt and apilio.

I would also like to use the same approach to set the hue alarm system (at home), however I’m aware that Philips/Signify haven’t yet made this api available, but fingers crossed