The code you supplied did change what time the trigger started to run, so that part is working just fine. However the timer still runs when the light is on. I'm not really sure where the problem is within the code.

The code you supplied did change what time the trigger started to run, so that part is working just fine. However the timer still runs when the light is on. I'm not really sure where the problem is within the code.

When you say the timer still runs, do you mean that the scene actions are still being executed even if the light is on? Do you have an instant action to turn the light on and a delayed one to turn it off?

Where did you place the Lua code - in the scene Luup tab or in the trigger Luup event? Is there just one trigger for the scene? Will you re-post your current code in case a typo crept in?

I created the scene in the following way: I have Aeon labs hidden door sensor on the front door. When the sensor is triggered (from sunset until 2359) it triggers the hallway light (controlled by a GE/JASCO wall switch) to come on. Then I set a delay to turn the hallway light off 5 minutes later. I entered the code contained below in the scene under the LUUP tab.

if startTime <= endTime then -- Both the start time and the end time are in the same day: -- if the current time is in the given interval, run the scene. if startTime <= currentTime and currentTime <= endTime then return true endelse -- The start time is before midnight, and the end time is after midnight: -- if the current time is not outside the given interval, run the scene. if not (endTime < currentTime and currentTime < startTime) then return true endend

Thanks, I would be lying if I said that has never happened to me before. The SAVE button is off my laptop screen and I do forget to click that sucker every now and then!! I'll throw the code in and give it a try when i get home.

Also i stumbled across your PLEG Basics manual, its good reading. Thanks for putting it together!

I did add the updated code to my veralite. The light that would normally trigger will not trigger. If the light that is being triggered is already on when triggered it doesn't go off after the delay in the scene is reached.

I did add the updated code to my veralite. The light that would normally trigger will not trigger. If the light that is being triggered is already on when triggered it doesn't go off after the delay in the scene is reached.

I did add the updated code to my veralite. The light that would normally trigger will not trigger. If the light that is being triggered is already on when triggered it doesn't go off after the delay in the scene is reached.Any thoughts?

Sorry @kiether, I don't understand what your problem is. Are you saying that the scene does not now turn on the light at all? Even when the door is opened during the specified time period?

Quote

If the light that is being triggered is already on when triggered it doesn't go off after the delay in the scene is reached.

Isn't that what you wanted to happen?

Maybe I don't understand what you want to happen. Can you explain how you want it to work?