Jump to content

Adding If statement to Geofence


Go to solution Solved by Javi,

Recommended Posts

Posted

I am trying to set up a Geofence that will turn the outdoor lights on, between sunset and sunrise, upon Geofence entry. I have created a program with that If statement and the lights on in Then. Geofence does not seem to like that. Adding all the lights individually to Geofence has no problem. How would I get the nighttime to work?

Geofence program that would not work:

>>>>>>>>>>>>>>>>>>>>>>>

Geofence Lights DO NOT DELETE - [ID 0022][Parent 0001][Enabled]

If
        From    Sunset  - 15 minutes
        To      Sunrise + 15 minutes (next day)
 
Then
        Set 'Sc Front Floods' On
        Set 'Sc Kitchen Sink Light' On
        Set 'Sc LR Floor Lamp' On
        Set 'Sc Rear Flood Lights' On
 
Else
   - No Actions - (To add one, press 'Action')

>>>>>>>>>>>>>>>>>>>>>>>>>

Thanks!

Al Zulich

Posted

Please show the UD Mobile setup.

 

The program should be disabled to prevent the program from running automatically. And UD Mobile should execute"Run If" on the program.

Posted

Thanks for replying Javi.

I'm sorry to say that I'm new to UD Mobile, just coming from ISY. Therefore, I'm not sure how to answer your first question, nor know how to have UD Mobile execute a "Run If". I assume that when I figure out a "Run If", I would delete the If statement from the program and the "Run If" would take care of it.

I ran Geofence via Mobilinc for years ..(Thanks Wes!!)

If you can send me to a wiki or describe further, I'd appreciate it.

Posted

Take a screenshot of the Geofence setup in UD Mobile which show the command.  The command should be RUN IF (not Enable, Run Then, Run Else) on the Program.

The program looks fine, but needs to be disabled or it will be triggered by the time change.... unless that is what you want.

Posted

Thanks Javi.

I didn't see the RUN IF selection in Geofence (first geofence attempt). I also saw a "Run If" selection if I right click the program. Does this need to be done also?

Here is a pic. Thanks again!

az_geofence.jpg

  • Solution
Posted

That look correct, RUN IF (Set RUN IF) should be triggered on geofence enter. 

The program itself needs to be disabled or it will run at the time in the IF condition.

This can be tested when the time is valid by pressing Trigger Enter Command.  Note that geofences may take a couple of minutes to trigger so the radius may need to be larger.

Posted

Another option is to set your geofence to turn a variable to 1  for entrance and 0 for exit. 

This manner offers the future flexibility and ease to trigger ANY program by writing it in the AC vs utilizing the geofence in UDM to add programs etc. 

Additionally with two phones (mine and my wife's), I am able to distinguish which one is home to open the correct garage door and in the case that we both come home together, it opens the most likely garage door that houses the car we usually drive in together. 

A lot more flexibility this way. 

 

 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...