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

Detecting Mobile Phone Entered and Exited WiFi Range

Featured Replies

I want to set a State var to 1 when I come into wifi range, and 0 when I go out of range. Is this doable?

I recommend using UD Mobile Geofencing. Geofences use WiFi (including access points which do not belong to you) along with GPS. If using Wifi only it may change the variable when the when the screen is off for long periods, which will cause the variable to change even when in range. Geofence lookup is usually triggered when the device connects to a WiFi access point.

  • Author
3 hours ago, Javi said:

I recommend using UD Mobile Geofencing. Geofences use WiFi (including access points which do not belong to you) along with GPS. If using Wifi only it may change the variable when the when the screen is off for long periods, which will cause the variable to change even when in range. Geofence lookup is usually triggered when the device connects to a WiFi access point.

Thanks Javi. You mentioned a couple of things:

  • "usually triggered when the device connects to a WiFi access point"

  • "(including access points which do not belong to you)"

Does "usually" mean it doesn't always trigger, when the device connects to WiFi? Or, is not predictable to when it changes the var?

Does the second part mean I can't restrict UD Mobile setting the var only when it connects to my WiFi? If so, that may explain why I didn't see a way to set my WiFi SSID. Is this not possible to limit the trigger to only my WiFi?

The attached capture is what I had set up over the weekend, but haven't seen it reliably changing var sMichaelPhoneHome - At this point, not even sure if it ever changed 🙂

Thanks again.

GeoFence Set Var.png

It looks like it last triggered at 3:13 PM as an exit, so it is working. The app's geofence logs will show all entries and exists along with any communication errors.
https://wiki.universal-devices.com/UD_Mobile#Geofencing

I say usually as the fence notification is handled by the OS, not the app. How the OS does things differs depending on may variables such as platform (iOS/Android), OS version, battery level, privacy settings, location settings, and MFG (in the case of Android). The Android App can do things to change this behavior (UD Mobile Location Services Section in Wiki), but on iOS it is mostly controlled by Apple.

The most important thing is setting, both the OS Global and App Location Settings must all be enabled or fences may not work.

  • Author
2 hours ago, Javi said:

It looks like it last triggered at 3:13 PM as an exit, so it is working. The app's geofence logs will show all entries and exists along with any communication errors.
https://wiki.universal-devices.com/UD_Mobile#Geofencing

I say usually as the fence notification is handled by the OS, not the app. How the OS does things differs depending on may variables such as platform (iOS/Android), OS version, battery level, privacy settings, location settings, and MFG (in the case of Android). The Android App can do things to change this behavior (UD Mobile Location Services Section in Wiki), but on iOS it is mostly controlled by Apple.

The most important thing is setting, both the OS Global and App Location Settings must all be enabled or fences may not work.

Thanks Javi. What you see at 3:13 pm, was done using "Trigger Exit Command" to verify the var would change. I had physically gone out of Wifi range, and back into wifi range without any change to the var. I repeated doing that yesterday afternoon, but this time I turned off cellular and used a browser to show I was connected to my Wifi, and once connected, looked at the state of the var and it was still unchanged. It's been over a day since I came back within Wifi range and still no change to the var. Repeated the test again this morning, but went a different direction - checked the logs, and they show no new entries.

I have had both the IOS global setting and app Location Settings enabled - specifically,, UD Mobile app is set to Always. Has anyone had entering and exiting WiFi range trigger when running on and iPhone, and if so, what settings did it take to get it to work?

Javi - Any other solution you can think of (other than using a beacon) to signal I'm within range? Normal geofencing has been unpredictable/unreliable, but generally close enough that when I'm near the house I should be within the geofence circle. I am outside the city and surrounded by hills, so cell towers are few, and we are relying on signals which are bouncing off of hills.

Am trying to understand the conversation here and feel like you guys are missing each others views / requests, etc.

The question as I see it is, due to poor cell phone reception, a normal geo fence (circle) doesnt work very well. So if the phone enters the WiFI range of the house, can it then trigger a variable. And conversely, if you leave the house, will it trigger.

In the question, it seems like you want WIFI connectivity between your phone and local wifi to trigger the variable, not technically the geofence.

This doesnt seem possible. When you leave the house, and you lose wifi, if you have a small geofence set up, it will still need the cell phone signal to alert the system that you have left. Losing wifi wont trigger anything.

Likewise, on the reverse, if you are entering hte geofence, cell service to wifi, it will have to wait until you are connected locally to then register you are in the fence.

The only way this would work is to have a geofence smaller than you wifi area which seems unlikely.

Javi's answers dont seem to match the problem as I am interpreting it.

@Michaelco am I reading this correctly?

On 4/7/2026 at 2:47 PM, Michaelco said:

Is this doable?

I would say no. This isn't possible with UD Mobile. As @dbwarner5 points out looks like the main point of ONLY using wifi is not supported with UD Mobile. At least not in the geofence method. I don't see a way to make wifi connection change a variable. Geofence only uses location inside or outside an area. Not only relative to if you're connected to a certain SSID/Wi-Fi.

@Michaelco the thing that I see suggested a lot of times is to set multiple geofence areas. If you have spotty service near the house a larger geofence could also be set that might have better cell coverage and set a variable when that is crossed.

I do agree with @Javi in the point that if something did only use wifi that it could erroneously trigger just by having a router go offline or a device rebooting.

Ultimately, the question needs to be what are you trying to accomplish? Perhaps use case of what you are trying to accomplish we could give suggestions of alternative methods of making something like this "work".

Ping plugin will detect a phones Wi-Fi and a program can be used to set a variable based on ping. However as Javi mentioned when the phone goes to s!esp or whatever ping may indicate you have left when you havent.

That was my experience with wifi.

48 minutes ago, TJF1960 said:

Ping plugin will detect a phones Wi-Fi and a program can be used to set a variable based on ping.

Wouldn't you need to put an IP reservation in the router for the phone then? Also, most phones (at least I know the iOS) now uses random MAC address to limit tracking. Of course those that remember to might disable this and set it to fixed for known networks, but just how many really remember/know to do that?

Then the issue becomes needing to remember to update the router/program/plugin to ping a new phone. Too many moving parts to remember.

  • Author
On 4/9/2026 at 10:26 AM, dbwarner5 said:

Am trying to understand the conversation here and feel like you guys are missing each others views / requests, etc.

The question as I see it is, due to poor cell phone reception, a normal geo fence (circle) doesnt work very well. So if the phone enters the WiFI range of the house, can it then trigger a variable. And conversely, if you leave the house, will it trigger.

In the question, it seems like you want WIFI connectivity between your phone and local wifi to trigger the variable, not technically the geofence.

This doesnt seem possible. When you leave the house, and you lose wifi, if you have a small geofence set up, it will still need the cell phone signal to alert the system that you have left. Losing wifi wont trigger anything.

Likewise, on the reverse, if you are entering hte geofence, cell service to wifi, it will have to wait until you are connected locally to then register you are in the fence.

The only way this would work is to have a geofence smaller than you wifi area which seems unlikely.

Javi's answers dont seem to match the problem as I am interpreting it.

@Michaelco am I reading this correctly?

You read it correctly - Since the Cell reception is so unpredictable, I need to widen the geofence radius wider than I'd like in order for me to show up as being within range when I'm home. The downside is I could be in the area, but not heading home. The thought was, the iPhone detects when I come into wifi range, so I had hoped there was a way to take advantage of that.

  • Author
On 4/9/2026 at 12:42 PM, Geddy said:

Ultimately, the question needs to be what are you trying to accomplish? Perhaps use case of what you are trying to accomplish we could give suggestions of alternative methods of making something like this "work".

A couple weeks ago, there was a car that drove down our street, slowed in front of our entrance gates, and stopped just past the gate. The gates opened without our involvement - could be coincidental and some hardware glitch that I just happened to see, or something else.

The Goal: I want "Smart Gate Monitoring" for a Linear RE-1 (318MHz MegaCode) integrated with an eisy.

The Hardware: > * Linear RE-1: Triggered by car's HomeLink (RF) or handheld remotes.

  • eisy: Connected to an Insteon I/O Linc on the gate to monitor status and fire the relay.

  • The Challenge: The house is 250' away with multiple interior/exterior walls.

The Problem: I want to get an alert if the gate opens without me or my wife being the cause.

  1. If I use UD Mobile (via ioLinc), the eisy knows it's authorized.

  2. If the Homelink or Remote (MegaCode RF) is used, the eisy doesn't know it was us, making it indistinguishable from a "code grabber" or "brute force" breach.

  3. Wi-Fi/GPS Geofencing has been unreliable for our situation.

Does UD Mobile support iBeacons for setting variables, or is there another way to verify "Presence" at the gate (250' away) that can handshake with the eisy logic?

I typically recommend this: https://guardline-electronics.myshopify.com/products/guardline-500-ft-wireless-driveway-alarm

Been using it for about 6 or 7 years without an issue. This one has a range of 500 feet, but they also have ones with a longer range.

In my case, I connect it to my Elk and with the Elk plugin, get it to my eisy. You could also connect it to an IO Link.

9 hours ago, Michaelco said:

or is there another way to verify "Presence" at the gate (250' away) that can handshake with the eisy logic?

UD mobile has a "geofence" feature which recognizes the location of the cell phone within a certain radius of your chosen location. Whether that radius can be set to 250 ft, I am unsure. Geofence could be a trigger to perform some action in the EISY such as setting a variable or turning on a switch.

The short answer is if you do not have good cell service geofencing will not work, and/or will require a wider fence. Wifi Range in not a good indicator for the various reasons listed above (faux mac addresses (iOS), wifi sleeping, or a dead spot in the corer of the room). Ble has it's own issues even worse than WiFi for this sort of situation.

If your router supports, you can trigger something when your phone connects, but you will have the same issues. There are vehicle gps systems that can send geofence triggers, this is likely the best in your case, although for most of us a city with high concentrations of WiFi access points and cell towers geofencing works good enough without the extra fee of the vehicle gps system.

While UDM, and any other app, can read an SSID it can only do so in a foreground request. Apple does not allow apps to read SSIDs in the background (without it being a special category of HotSpot, we have asked apple and have been denied, the app must be for a HotSpot). Also many background request are queued so the request and the response may be minutes or hours apart.

Geofencing uses a number of indicators, like GPS, WiFi access points, and cell towers. GPS is not always on or your battery would die in a few hours. Wifi is not always on for the same reason, although it would last a few more hours. So your phone periodically wakes, connects to Wifi, then check may things or allows apps to do a queued background update. This wake may check fences, I say may as there are other indicators as is more complicated than my simple explanation, you don't want your phone checking GPS ever X-num of minutes or the battery would die.

@Michaelco one thing I just thought of...looks like you're on an iOS device. You could use Apple Shortcuts to trigger the variable. In Shortcuts there is a way to trigger if you're in a geofence area or connected to a specific SSID (can choose multiple). You'd then need to know how to send the command to the eisy to set the variable. I'm sure that's with a rest or some other URL based command (I don't do that kind of coding so I'm not entirely sure how that's setup, but I know many here seem to be able to do that or the info might be in the UD Wiki).

I just checked about the connecting to an SSID and it has an option not to run again if it reconnects within 3 minutes.

That part gets too complicated for me to sort out, but it's another option. I'm not sure if Apple's geofence option would work as good or better than the UD option. But the Apple Shortcut does give you an option to select which SSID you connect to and then trigger a shortcut that could be programmed to update the variable.

I'd probably go on the side of over notification at that point. Just get an alert every time the gate opens. Kind of like MyQ with the garage door it will always alert open/close no matter who does it.

@Michaelco It doesnt sound like wifi or cell phone triggers are going to work for you to denote that its YOU at the gate.

I do not know the answer, but I wonder if there is a bluetooth device that could act as a trigger? Seem like one of the few last technologies left to "connect" to.

There would have to be some bluetooth device that would notice you being closely and that then could let the eisy know its you. But again, I dont know what that might be offhand.

For the distance issue, YoLInk uses Loran technology and can easily cover that distance. Also there is a plugin for eisy for youlinnk. You may want to peruse their stuff and see if there is some sort of I/O device that a bluetooth device could trigger. Pathway would be: iPhone to bluetooth device (maybe with the use of a "shortcut on iPhone), bluetooth device triggers Yolinc, which triggers eisy.

Create an account or sign in to comment

Account

Navigation

Search

Search

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.