jim_ Posted November 3 Posted November 3 (edited) I tried looking through the forum, but could not locate anyone posting this scenario / problem ... I have a number of motion or switch activated scenes running for years and while they work perfectly 99% of the time, you hit the scenario where the timer has JUST expired and a new trigger occurs (less than a second) ... lights go off, then on, then off Example: basement stairs, motion triggers human, lights go on, human descends stairs, but does a turnaround trip ... the timer expires (light off sent) but within milliseconds of the off, human is detected, light goes back on for less than 1 second and then go off again ... stairs are dark I use a variable to reset the timer if there is a lot of traffic in the stairwell, this seems to work well. I've looked through Log to see if double Off is sent, but only see 1. Its like the perfect software race condition where the command "off" is sending and motion is triggering "on" to restart the script Anyone guide me on what I'm looking for ? CODE ------------------------------------------------------ Basement Stairs Trigger If 'Basement Stairs Mo' is switched On Then Set 'Basement Stair 3way' On $sBasement_Stairwell_Light_Timer = 60 ------------------------------------------------------ Stair Light Timer Decrement If $sBasement_Stairwell_Light_Timer > 0 Then Wait 1 second $sBasement_Stairwell_Light_Timer -= 1 Run Program 'Stair Light Timer Decrement' (If) Else Set 'Basement Stairs 3 Way' Fast Off ------------------------------------------------------ Basement Stairs Light Stop If 'Basement Stair 3way' Status is Off Then $sBasement_Stairwell_Light_Timer = 0 Set 'Basement Stairs 3 Way' Off Stop program 'Stair Light Timer Decrement' ------------------------------------------------------ Edited November 3 by jim_ Quote
larryllix Posted November 4 Posted November 4 Have you set your MS to send 'ON' only or does it send 'OFF' also. This could be creating a race condition. BTW: You may be creating a problem with the line Run Program 'Stair Light Timer Decrement' (If) It shouldn't necessary. The timer changing will re-run the decrement program automatically. (providing ii is a STATE variable.) Quote
jim_ Posted November 4 Author Posted November 4 Thanks larryllix for the reply I removed the "Run Program" line and you are correct, the decrement works With respect to "MS to send 'ON' only", is this the option ? (2844-222) 1 Quote
larryllix Posted November 4 Posted November 4 (edited) 3 hours ago, jim_ said: Thanks larryllix for the reply I removed the "Run Program" line and you are correct, the decrement works With respect to "MS to send 'ON' only", is this the option ? (2844-222) Yes. If you have created a scene between your MS and the device then it will send an Off as well as your program. Usually it doesn't hurt anything but in your case there may be some signal racing going on. Edited November 4 by larryllix Quote
larryllix Posted November 4 Posted November 4 Here is how I did this for my mudroom in an older installation. I created a scene to directly, and instantly, turn ON (only) the lights from the MS. The light switches (or Alexa vocal) can manually override the automatic off and yet still turn them off after a long period automatically. (people get used to automatic and don't use the switches). Note: the timer here is retriggerable so constant motion in the mudroom wil extend the timer. --------------------------------------------------------------- MudRm Lights.auto - [ID 0067][Parent 0017] If 'MudRoom / MudRm.MS' is switched On And 'MudRoom / MudRm.MS' is not switched Off Then Wait 5 minutes Set 'MudRoom / MudRm Potlights' Off Else Set 'MudRoom / MudRm Potlights' Off ---------------------------------------- MudRm Lights.manual - [ID 00D4][Parent 0017] // * * Enabled to Run at Startup, If will run False, resetting everything If 'MudRoom / MudRm Potlights' is switched On And 'MudRoom / MudRm Potlights' is not switched Off Then Set 'MudRoom / MudRm Potlights' On Disable Program 'MudRm Lights.auto' Wait 2 hours <--- human forgets = turn them off Run Program 'MudRm Lights.manual' (Else Path) Else Set 'MudRoom / MudRm Potlights' Off Enable Program 'MudRm Lights.auto' Quote
jim_ Posted November 5 Author Posted November 5 Ok, so changes made ... now to wait for the event to occur in the next month ... maybe 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.