Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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. 


 

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

  • Author

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

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.

Guest
This topic is now closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.