Jump to content

Adding If statement to Geofence


awzulich
Go to solution Solved by Javi,

Recommended Posts

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

Link to comment

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.

Link to comment

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.

Link to comment
  • Solution

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.

Link to comment

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
Link to comment

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.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.5k
×
×
  • Create New...