How does the 2 steps command works "behind the scene" in a scene ?

In a simple scene, it is possible to turn on a light at a specific time.
It is also possible to turn on a light for a specific period of time, and then return to the previous state, or turn it off.

Could someone describe the process “behind the scene” in this later case ? Does MIOS schedule a job at a specific time, and then fire that job when the time comes ?

I’m asking because I have a scene (A) that increase the light level for 15 minutes if a motion sensor detect a movement, and then return to the previous state(let’s say 25%). Another scene (B) closes all the lights at home at midnight. If the motion detector starts scene A at 11:50PM, is it ok to say that the light will be turned off at midnight (as a result a scene B request), and then on (25%) at 00:05AM by scene A ?

No answer ? Is the question irrelevant, too easy, too difficult, a thousand times explained ?

I think it is quite important to understand the process hidden behind a 2 steps command in a scene. No ?

Thanks

My understanding is that the second part of multi part actions are superseded by new actions, provided you are using the built in methods and not custom luup code. That is to say if you issue an new command using Scene B to a device such as turn off at midnight, it will discard the previously scheduled action to reset that specific device to the original level after 15 minutes, resulting in Scene A part 2 never running.

This is one of the arguments I’ve heard before for not using the “after N minutes” method, when N is a long duration, but rather scheduling two different scenes (one for ON and one for OFF). In your case though, it sounds like this method will be preferred if you want the lights to turn off at midnight and stay off?

Or, I could be totally wrong. Have you tried testing the scenario you mentioned? If anyone else has conflicting experience, please jump in.

I think it runs to completion in sequence; except for when the device gets turned off, in which case the rest is canceled.

Ok, let’s suppose that instead of lights, we deal with a door lock.

A scene is fired by the event “door unlocked”
That scene has the command : do nothing now, but lock the door in 30 minutes.

Another scene is fired by the event “door locked”.
Is it possible for that second scene to cancel the action of “locking” as scheduled by the first scene ?

Someone should know ?

Perhaps it’s an implementation question that only MCV folks can answer.

Have you tried your scenario to see what happens?

Scenes are fired and devices polled in a cyclical order in the way they were created.
Scene #1 will be queued before scene #40, Node #20 will be polled before node #60. If you have a command to turn a device on in scene #1 and the same device to turn off in scene#20 then the device will be on for x milliseconds before scene #40 fires.

If you have a scene fire of “do nothing now, but lock the door in 30 minutes” and another scene fires to unlock the door, then the door will unlock and 30 minutes later the other scene wll lock the door.

JOD.

Sure. But @huogas is specifically interested in preventing a second lock. So if a scene is scheduled to lock the door at a certain time, but another scene already locked the door, will the door get locked again?

Sure it will.

JOD.

That’s what I expected.

Now the scenario where one scene is scheduled to lock the door, but a second scene gets scheduled before that to unlock the door at a time after the locking by the first scene. Will the unlock happen?