Jump to content

Will this code run on 'KBM Home' state change?


Kentinada

Recommended Posts

Posted

I have this very short program below that is intended to turn our indoor Christmas lights on as long as either my wife or I am home.  I have a geofence defined that sets a variable in the geofence settings on UD Mobile for both us.  It works.  KBM Home is true if either Kent or Nancy is true meaning we're within the geofence.  Here's the code: 

If
        From     6:00:00AM
        To      12:00:00AM (next day)
    And 'KBM Home' Occupied is True
 
Then
        Set '02-LR-DR / Christmas Indoors' On
 
Else
        Set '02-LR-DR / Christmas Indoors' Off

Will this code be triggered if the state of the geofence variable 'KBM Home' changes from true to false or vice versa? Thanks. 


 

Posted

@Kentinada I'm not sure that "True" is correct. Can always try by triggering an entrance event in UD Mobile to see if it triggers it on. Is the program active? If you're both home try by running the "IF". If it runs true and turns the lights on then it should be good. Do you want the lights to be on until midnight?

It depends on how your variable is setup. Is it a STATE variable? Those will cause programs to trigger. Usually I've seen them referred to the value of the variable (0, 1, 2) not as true/false. 

You can test both the program and the geofence to tinker with it to correct the logic if what you have doesn't work. 

Posted

@Geddy These aren't state variables.  They are geofence devices (both of our iPhones).  I set up this geofence so long ago I'm not sure how they got created.  I tried uploading a screenshot of how they look in the Admin console but got errors both times.  I've added a notification to the program so I'll know if it fires appropriately.  And yes, I only want this working between 6a and midnight. 

Posted

@Kentinada there were errors adding images to the forums earlier. Should be good now.

It depends how your variables are setup. Did you make this program to turn the lights on and did it work? Or are you having issues? 

Posted

Are you utilizing the portal geofence? With perhaps Locative?   Or the UD mobile App then YES the program should run when KBM Home changes state.   So leaving  and anrriving and time triggers will both trigger the program.  
 

I’d change the end time to 11:59:59 pm, for one it’s easier to understand at a glance, second there was once wonkyness with 12:00:00 AM and next day/same day.  I don’t remember the details but I think it got fixed.

  • 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...