Jump to content

Security lights program


TheWabit

Recommended Posts

I am having an issue with this program. Everything after the first "wait" works sporadically. Foyer goes off about half of the time - front house lights never turn off. Is there a better way to write this?

 

 

 

 

 

Front Security  - [iD 0030][Parent 0001]
If
        From    12:00:00AM
        To      Sunrise (same day)
    And Control 'Front House Security-S' is switched On
 
Then
        Set Scene 'Front House Lights' On
        Set Scene 'Dining Room' On
        Set Scene 'Foyer' On
        Wait  5 minutes
        Set Scene 'Dining Room' Off
        Wait  5 minutes
        Set Scene 'Foyer' Off
        Wait  5 minutes
        Set 'Front House Lights' Off
 
Else
   - No Actions - (To add one, press 'Action')
 
 

 

Link to comment

 

I am having an issue with this program. Everything after the first "wait" works sporadically. Foyer goes off about half of the time - front house lights never turn off. Is there a better way to write this?

 

 

 

 

 

Front Security  - [iD 0030][Parent 0001]
If

        From    12:00:00AM

        To      Sunrise (same day)

    And Control 'Front House Security-S' is switched On

 

Then

        Set Scene 'Front House Lights' On

        Set Scene 'Dining Room' On

        Set Scene 'Foyer' On

        Wait  5 minutes

        Set Scene 'Dining Room' Off

        Wait  5 minutes

        Set Scene 'Foyer' Off

        Wait  5 minutes

        Set 'Front House Lights' Off

 

Else

   - No Actions - (To add one, press 'Action')

 

 

 

What type of device is "Front House Security-S", and once it's turned on does it stay on?

 

Every time a parameter in the IF statement changes the THEN clause will start over.

Link to comment

You program, if "Front House Security-S" remains on during the specified times, will run twice, once at 12:00AM and once at Sunrise.

Link to comment

Anytime you have problems with statements after a "Wait" not running, suspect the issue raised above.

 

The quick and dirty workaround is to move all the actions into a separate program.

Front Security Switch - [ID 0030][Parent 0001]
If
    From 12:00:00AM
    To Sunrise (same day)
    And Control 'Front House Security-S' is switched On

Then
     Run Program 'Front Security' (Then path)
Else
     Run Program 'Front Security' (Else path)
The second program, below, has no conditions, so it will only run when it is called explicitly, in this case, by the first program:

Front Security - [ID 0031][Parent 0001]
If 
     - No Conditions -

Then
    Set Scene 'Front House Lights' On
    Set Scene 'Dining Room' On
    Set Scene 'Foyer' On
    Run Program 'Front Security' (Else path)

Else
    Wait 5 minutes
    Set Scene 'Dining Room' Off
    Wait 5 minutes
    Set Scene 'Foyer' Off
    Wait 5 minutes
    Set 'Front House Lights' Off
Because the second program has no conditions, there is nothing to be reevaluated after the wait, it will always run all the way to end.
Link to comment

I think the 2 programs is the answer. But let me make sure my statement "And Control 'Front House Security-S' is switched On" is correct. This is a MS. Any issues with that? It seems to turn everything on fine - It is just the turning off that is the problem.

Link to comment

I think the 2 programs is the answer. But let me make sure my statement "And Control 'Front House Security-S' is switched On" is correct. This is a MS. Any issues with that? It seems to turn everything on fine - It is just the turning off that is the problem.

Yes, you're good.

 

For testing out programs like this one, try making the sensor trigger a noise or notification, for example:

Front Security Switch - [ID 0030][Parent 0001]
If
     Control 'Front House Security-S' is switched On

Then
     Run Program 'Front Security' (If path)
     Set Scene 'Dining Room' Beep 

The "Beep" line will cause any beep-enabled controller (e.g. a lightswitch) in the scene to emit a single chirp.   I like to use a notification which writes a timestamped line to a logfile for this kind of execution tracking.

 

 

The second program, below, is disabled (You'll need to right click on the program and select 'Disable') and has the time range as the conditions, so when 'If' is called by the first program, it will only run if the time condition is true. 

NOTE:   Disable this program!!!
Front Security - [ID 0031][Parent 0001] 
If   
     From 12:00:00AM
     To Sunrise (same day)

Then
    Set Scene 'Front House Lights' On
    Set Scene 'Dining Room' On
    Set Scene 'Foyer' On
    Wait 5 minutes
    Set Scene 'Dining Room' Off
    Wait 5 minutes
    Set Scene 'Foyer' Off
    Wait 5 minutes
    Set 'Front House Lights' Off

Else
    - No Actions -

With the above, anytime the motion sensor is triggered, you will get a beep, but only when it is triggered at night will it turn the lights on, then off.

Link to comment

Great idea - Thanks Kevin!

If your device is a motion detector, retriggering your program, a second program will be called and retrigger the same as one program did, cancelling further program lines from executing. A trigger, whether from being called by another program, or an internal If section trigger event line, makes no difference.

 

Two programs will not help that problem.

 

You need to have an MS that doesn't retrriger on motion until the the Waits are all done, or a disable the first program from the second to lock out further action until done, and then re-enable the first program again.

Link to comment

Let me play with this. But even if it retriggers, wouldnt that just reset the wait? Looking at the logs, this thing triggers earlier in the night (morning) like 1 am. Then I wake up in the morning and they are still on. Except the dining room light.

Link to comment

Let me play with this. But even if it retriggers, wouldnt that just reset the wait? Looking at the logs, this thing triggers earlier in the night (morning) like 1 am. Then I wake up in the morning and they are still on. Except the dining room light.

Yeah, Last trigger it should complete with any amounts of retriggering.

 

I suspect you have somethng in your scene Offs that isn't working. Test them manually from the admin console.

 

That program time schedule cannot run anything except Else, ANDed with a control/switched line. A control/switched line is never True to other conditions, only when it triggers itself.

Link to comment

Another thought. Some Insteon MSes send erroneous On signals when their batteries are getting low.

 

It's just possible this may be an issue here.

Another good reason to add a "Beep", notification, or log to the first program, as shown above.

 

Yeah, Last trigger it should complete with any amounts of retriggering.

 

I suspect you have somethng in your scene Offs that isn't working. Test them manually from the admin console.

 

That program time schedule cannot run anything except Else, ANDed with a control/switched line. A control/switched line is never True to other conditions, only when it triggers itself.

 

With the original single program, conditions are re-evaluated (including at the end of each Wait).  Program will stop early if the conditions are false, which is why statements after the wait sometimes do not execute.

 

Go with the two program solution, so "Last trigger it should complete with any amounts of retriggering".

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...