I am trying to configure a light, so that it turns off, if there is no activity for 20 minutes, and it is between 12 am to around 5 am. But, when I select "night" mode, it keeps changing to "early morning" mode for some reason. Any thoughts on what might be happening here?
Did you configure anything for Early Morning mode? What you've circled in the second screenshot (in parentheses) just shows you the current mode, i.e., what the app would do right now based on your hub's state.
One observation - Yesterday I turned on the lights after 11:45, and the lights turned off, as expected, after 20 mins of no motion in the room!
Can it be, that the automation is failing, if the lights are turned on before 11:45?
My expectation/requirement is that even if the lights are turned on before 11:45 pm, they should turn off if there is no motion for 20 mins, beyond 11:45 pm.
E.g. I turn on lights at 10:30 pm. The family goes to sleep at 12. The lights should turn off at 12:20 am.
Room Lighting is acting normal and will not turn off the lights the way you want. This instance needs an "inactive" event from the motion sensor in order to have the action of "turn off" to happen. This is the general basis for how Hubitat works as it is an event based system. With no inactive event, Room Lighting will not turn off the switch. Basically, if everyone has already left the Family Room before 11:45pm, and the motion sensor has sent its inactive event, there is nothing to turn off Room Lighting.
With the above said, you can create a rule to turn off the switch as a back up for this specific purpose:
Trigger - 11:45pm
Action - If Family Room Motion is inactive, turn off Hanging Lights Switch
This rule would turn off your switch as long as the motion sensor is inactive and allow for the Room Lighting to work as normal should someone come into the Family Room after 11:45pm. If the motion sensor is showing as active at 11:45pm, the rule would not run, but Room Lighting would take over (since the inactive event would occur after 11:45pm).
The OP is trying to set up a vacancy app instance. Under "Means to Activate Lights" the OP has chosen "Don't Activate". That can work, but requires the "Turn Off even if already partially off" option to be chosen. If the 'partially off' option is not chosen the lights won't turn off as the app believes the lights are already off. The vacancy/don't activate functionality is in the Room Lighting documentation, but it does not include the necessity to choose the 'partially off' setting. @bravenel@bertabcd1234
There are other ways of setting up a vacancy app, and I'll show that in another reply.
You could always create an activator device and share that with Alexa instead of the switch directly. This way Room Lighting would know that it is on whenever you activate the light.
the problem here, i think, is not that Room lighting does not know. I feel Room lighting does know when the light is on.
If i turn on the light before 11:45 pm it does not auto turn off. But if I open the light after 11:45 it works as intended. I will try to test this again today.
I duplicated the issue. It's easy to see when the logs are turned on. The "don't turn off between two times" keeps any 'off' actions from being scheduled while in the restricted time even if the 'off' is outside the restricted time. I'm not sure if that works as intended. @bravenel
It is true that the inactive event will not lead to the lights being turned off if it happens during the restricted period, even if there is a delay for turning off that would push beyond that period. But the posted Room Lights instance does not have a delay.
@saurabh9 the mistake I made would take more time to investigate. Make sure to turn logging on whey you are trying to replicate. I'm pretty sure you will see where the issue is.
Having said that, I think the way to get the app to work as you intend is to delete the don't turn off between 2 times and to only use the 'Vary lighting using' options to set the operating times. You don't need to use modes, you can use arbitrary periods. (I'm assuming this app is only being used to turn off the lights between 11:45 and 5:00.)
You could always just use Rule Machine if the goal is to only turn off the light. If you are not using modes to adjust the lighting in any other way, a simple conditional action would suffice for your needs.