Jump to content

Perform an action based on timing from another action


zg825

Recommended Posts

Posted

I am trying to set up a program that is based on the action of another action.  I have a scene set up to turn lights on at a certain time and then turn off several hours later.  There are times when I don't want this scene to run when I just turned off this light slightly before the set time.

Here is what I am trying to do:

 

If the Family room status changed to "off" within the last 30 minutes, then program "evening lights on" shouldn't start.    Right now, I have the program set as "If time is sunset & family room status is off, then set evening lights as on

Yes, i know being upstairs by 8:45 is lame, but we get tired and feel like relaxing in bed after putting the toddler to bed!  When we go upstairs, we hit the 1st floor off button which can happen before Sunset. The issue is that once sunset hits, the lights will turn back on downstairs.  I'd like to stop this.   If I put in the programing, that when we hit 1st floor off, the program "evening lights on" is deactivated for 24 hours, this could cause other problems. We will sometimes hit the 1st floor off in the middle of the day, so we may not want it deactivated that night.  

Also, as we get into winter, sunset is around 530 ish, so I'd like the lights to automatically turn on as we may be coming home at that time or slightly after.   Having a program to be based on the timing of when a previous action was last done seems to be my best action. 

I see a "last run" option in the schedule, but not sure how to best program that

Posted

If

    1st floor off button is switched off    (use the 'control' dropdown not status)

then

     disable program Evening Lights On

     wait 30 Minutes

     enable program Evening Lights On

else

     (nothing)

 

 that should do it, adjust the wait to fit, i picked 30 minutes because you said 30 minutes.

  • Like 1
Posted

You could also set an integer variable when selecting off at a certain time (Ss-1hr to SS). Set iRecentOff=1. Then use iRecentOff<>1 as a condtion on SS light on program. Reset iRecentOn to 0 at sunrise. Think that would work. 

Posted

Thank you both for your suggestions. While I don't know much, I definitely don't know the "integer variable" stuff yet! Will need to read up on it.

I'll try out your suggestion Bill, that makes sense to me on how to get this to work. Seems easy enough path to follow and can use it on some of my other ideas

 

Posted

I use this:

Saw 1st floor off button - [ID 0942][Parent 00FF] 

If
       'Family Room off button' is switched  Off

Then

     Run Program 'evening lights OFF' (Then)

!!Runs the "Then" path, so ignores conditions on the program being run


Saw 1st floor off button recently - [ID 0011][Parent 00FF] 

If
        From    Last Run Time for 'Saw 1st floor off button'
        To      Last Run Time for 'Saw 1st floor off button' +  2 hours  (same day)
 Then

       -  No actions



evening lights on - [ID 0077][Parent 00FF] 

If
    Time is Sunset - 30 minutes
    And Program 'Saw Family room off recently' is False
 
Then
       Set 'Evening Lights' on
  

evening lights OFF- [ID 0078][Parent 00FF] 

If
   Time is 8:45:00 PM
 
Then
       Set 'Evening Lights' off

Basically I'm using the "False" status of the "Saw...recently" program to simulate a logical NOT statement.

  • Like 1
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.1k
    • Total Posts
      371.5k
×
×
  • Create New...