Jump to content

Turning on My Outside Lights for 5 mins when entering Geofence.


Recommended Posts

Posted

So I setup a program so that when I come home late at night it should turn on my garage lights outside for 5 mins and then shut them off.  But the lights stay on because the if statement is true the whole time.  How would I get it to run that one time when i enter the geofence.

 

 

If
        $Geofence-Home is 1
    And Status  'Outside / Outside - Garage Light' is Off
    And From    11:00:00PM
        To      Sunrise (next day)
 
Then
        Set 'Outside / Outside - Garage Light' On
        Wait  5 minutes 
        Set 'Outside / Outside - Garage Light' Off
 
Else
   - No Actions - (To add one, press 'Action')
 

Posted

The problem is not because the variable remains equal to 1.  The problem is more likely because, when the program turns on the light, the condition suddenly becomes false and interrupts the WAIT action.  (There are also a couple of other potential problems.)

A simple solution is to remove the second line from the condition.  The solution I would choose is to break this into two programs.  The first program would keep the existing condition, but change the THEN action to do nothing more than call the second program.  The second program would have no conditions, but would have the THEN actions from the original program.

  • Like 2
Posted (edited)
27 minutes ago, oberkc said:

The problem is not because the variable remains equal to 1.  The problem is more likely because, when the program turns on the light, the condition suddenly becomes false and interrupts the WAIT action.  (There are also a couple of other potential problems.)

A simple solution is to remove the second line from the condition.  The solution I would choose is to break this into two programs.  The first program would keep the existing condition, but change the THEN action to do nothing more than call the second program.  The second program would have no conditions, but would have the THEN actions from the original program.

Makes sense.  I removed the 2nd condition and it worked.  Split into two programs and it didnt work.

Edited by BigEfromDaBx
Posted (edited)

Program1 [enabled]

If
        $Geofence-Home is 1

Then
    run (if) Program2

Else
     -----

 

Program2 [disabled]
If

    Status  'Outside / Outside - Garage Light' is Off  <---- this will also activate it in an enabled program

    And From    11:00:00PM   <---this will also activate it in an enabled program
        To      Sunrise (next day)
 
Then
       Disable Program1

        Set 'Outside / Outside - Garage Light' On
        Wait  5 minutes 
        Set 'Outside / Outside - Garage Light' Off
        Enable Program1

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

Edited by larryllix
  • Like 1
Posted
2 hours ago, BigEfromDaBx said:

Makes sense.  I removed the 2nd condition and it worked.  Split into two programs and it didnt work.

You probably didn't have it do a "run then" on the second program.  The two program solution will work.  Though you have another problem in that if you turn the light off while you are at home and between the hours of 11pm and sunrise, the program will turn the light back on again.

In the end, simply removing the "status . . off" line is a very good and simple solution.  The only reason it would not be to your liking is if the light were already on for some reason and you wanted it to stay on, it would shut off 5 minutes after geo-fence turns to 1.  Like. . . .  maybe. . . . your wife is having cocktails on the driveway with the light on (on purpose), you drive up, the light stays on, but 5 minutes later it shuts off.  Your wife curses at your GD HA setup and you get no action.

  • Like 1
Posted
3 hours ago, larryllix said:

Program1 [enabled]

If
        $Geofence-Home is 1

Then
    run (if) Program2

Else
     -----

 

Program2 [disabled]
If

    Status  'Outside / Outside - Garage Light' is Off  <---- this will also activate it in an enabled program

    And From    11:00:00PM   <---this will also activate it in an enabled program
        To      Sunrise (next day)
 
Then
       Disable Program1

        Set 'Outside / Outside - Garage Light' On
        Wait  5 minutes 
        Set 'Outside / Outside - Garage Light' Off
        Enable Program1

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

This worked.  Thank you very much.

  • Like 1
Posted
1 hour ago, apostolakisl said:

You probably didn't have it do a "run then" on the second program.  The two program solution will work.  Though you have another problem in that if you turn the light off while you are at home and between the hours of 11pm and sunrise, the program will turn the light back on again.

In the end, simply removing the "status . . off" line is a very good and simple solution.  The only reason it would not be to your liking is if the light were already on for some reason and you wanted it to stay on, it would shut off 5 minutes after geo-fence turns to 1.  Like. . . .  maybe. . . . your wife is having cocktails on the driveway with the light on (on purpose), you drive up, the light stays on, but 5 minutes later it shuts off.  Your wife curses at your GD HA setup and you get no action.

I did have the run then on the second program.  And yes and if the light is already on, I need it to stay on.  Thanks anyways.

Posted (edited)

Glad to help!! I only exemplified what oberkc was trying express above and also fixes apostolakisl's concerns.

Edited by larryllix
  • Like 1
Posted
Just now, larryllix said:

Glad to help!! I only exemplified what oberkc was trying express above.

You definitely did.  The few times i have posted in here you have always helped. Your SN seems very familiar LOL.  Thanks.

  • Thanks 1
Posted (edited)

I have a similar situation with a mud-room light.  It needs to be on in the evening for a few hours, and stay on (so the dogs can see their dog food bowls).  It needs to turn on when the outside door is open, and turn off when the door is closed.  It needs to be turn on automatically if someone enters from hallway, and stay on while the room is occupied (laundry, perhaps).

The solution for me is a door sensor and a motion sensor, and a switchlinc dimmer for the light.  A series of programs are triggered by time-of-day, by the motion sensor, and by the door sensor.  Each program sets the light to a specific brightness (very close together so the human eye can't tell the levels apart) -- this allows any program to determine if the light is already on, which other program set it to on by the specific brightness level.  Thus, when the program goes to turn it off again, it knows if it should do so or not.

As a specific example, consider the motion sensor tripping at 9:05PM -- it will find that the  light is already on at 99%, and will leave it that level because that's the level for the dog's evening timer.  Thus the motion sensor won't end up plunging the dogs into darkness.  However, at 11PM, if I walk into the mudroom to let one of the dogs out, the motion sensor will turn the lights on at 98%.  Opening the external door will run a program that will note that the lights are at 98%, and won't turn the lights off on me when I close the door.  Turning on the light from the switchlinc results in it being set to 100% on -- and none of the programs will turn it off if they find it set to that value (because you turned it on manually).   You get the general idea I'm sure -- use the brightness level to record who and why it was turned on, so you know when what program is allowed to turn it off.

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

×
×
  • Create New...