Kentinada Posted December 18 Posted December 18 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. Quote
Geddy Posted Friday at 12:36 AM Posted Friday at 12:36 AM @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. Quote
Kentinada Posted Friday at 12:30 PM Author Posted Friday at 12:30 PM @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. Quote
Geddy Posted Friday at 07:36 PM Posted Friday at 07:36 PM @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? Quote
MrBill Posted Friday at 11:32 PM Posted Friday at 11:32 PM 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. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.