johnnyt Posted April 25 Posted April 25 I set up Geofencing on my iPhone a couple weeks ago and it works reliably so far. I used Occupancy v2.0 Node Server and followed the instructions found at https://wiki.universal-devices.com/index.php?title=UD_Mobile#Geofencing It took me a few tries to realize that the Enter command cannot be a program. May I suggest the doc on wiki make it clear what it could/needs to be? So what I did was have the Enter command change a state variable to 1, and the Exit command change the same state variable to 0. Then I wrote the two simple programs below for my wife and myself. For me it's worked fine so far but for my wife the "enter" program has triggered 4 times in past 4 days even though UD Mobile is not yet installed on her iPhone. For what it's worth there have been no Exit events, no eISY restarts, and no LAN/internet outage that anyone noticed. Before I start counting on this for locking/unlocking doors, turning off/on lights, and setting/disabling alarms, etc., what could be happening? Will a loss of communication with the UD mothership cause the "enter" program to run? Do I need to check that I have network connectivity before I do anything with a change in the node's state? Any info would be appreciated. Lauren Enters Geofence - [ID 04A5][Parent 01E4] If 'Home / Lauren' Occupied is True And $sHomeStatus.Lauren is 0 Then Send Notification to 'me' content 'Generic Main Log' Wait 5 seconds $sHomeStatus.Lauren Init To 1 $sHomeStatus.Lauren = 1 Else - No Actions - (To add one, press 'Action') Lauren Exists Geofence - [ID 04A6][Parent 01E4] If 'Home / Lauren' Occupied is False And $sHomeStatus.Lauren is 1 Then Send Notification to 'me' content 'Generic Main Log' Wait 5 seconds $sHomeStatus.Lauren Init To 0 $sHomeStatus.Lauren = 0 Else - No Actions - (To add one, press 'Action')
Solution Javi Posted April 26 Solution Posted April 26 17 hours ago, johnnyt said: It took me a few tries to realize that the Enter command cannot be a program. May I suggest the doc on wiki make it clear what it could/needs to be? It can be a program, but be sure the "Command" is executing the correct command. Commands are Run IF, Run Then, Run Else, and Enable (Enable enables or disables a program, it does not run the program). However if using the occupancy Node Server UD Mobile should update the node see https://wiki.universal-devices.com/index.php?title=UD_Mobile#Occupancy_v2.0_Node_Server 17 hours ago, johnnyt said: For me it's worked fine so far but for my wife the "enter" program has triggered 4 times in past 4 days even though UD Mobile is not yet installed on her iPhone. Likely a programing issue. I would remove all variables and use the Occupancy Node as the trigger, see link above.
johnnyt Posted April 26 Author Posted April 26 ok, I was clearly looking in wrong place when I tried to use a program initially because I only saw two options. When I look now I see all the normal options. So I will remove use of the variable now that I can call a program directly. Thanks.
johnnyt Posted April 28 Author Posted April 28 (edited) ok I change to the program logic (see below), with no variable in the condition - only the node state (True vs False) and each person having its own node and program but BOTH programs run every time I leave or come back. I've tried starting over 3 times now, i.e. delete both Geofences in UDM, resynchronize UDM, recreate separate Geofences, re-add command, i.e. "run then" for each command separately/respectively for each Geofence node. What am I doing wrong or not understanding? LT Enters Geofence - [ID 04A5][Parent 01E4] If 'Home / LT' Occupied is True Then Send Notification to 'me' content 'Generic Main Log' Wait 5 seconds $sHomeStatus.Lauren Init To 1 $sHomeStatus.Lauren = 1 Else - No Actions - (To add one, press 'Action') JT Enters Geofence - [ID 0499][Parent 01E4] If 'Home / JT' Occupied is True Then Send Notification to 'me' content 'Generic Main Log' Wait 5 seconds $sHomeStatus.Jean Init To 1 $sHomeStatus.Jean = 1 Else - No Actions - (To add one, press 'Action') Edited April 28 by johnnyt
Javi Posted April 28 Posted April 28 If using Occupancy V2 there is no need for programs or variables see the link above for instructions https://wiki.universal-devices.com/index.php?title=UD_Mobile#Occupancy_v2.0_Node_Server
Recommended Posts