My office has bathrooms with motion sensor lights and stalls. If you’re the only one in the bathroom better bring a flashlight because 30 seconds after you close that stall door the lights are going out
That being said, @ashish the best option in this case is to use a motion sensor rather than a contact sensor on the door. There is no way for a contact sensor to tell if someone just entered or left, only that the door opened. I would also suggest setting a longer timeout for “sensor has been clear for”, like 5 or 10 minutes just to be sure the light doesn’t go out while the room is occupied.
As for turning on the light only during the day, Wyze has said they’re working on scheduled shortcuts but nothing has been released yet. If you can wait that would be the easiest option, otherwise you’ll have to involve IFTTT and a third-party automation engine like apilio.io, sequematic.com, etc.