iOS App - Duplicate presence devices

I'm seeing duplicate presence devices (xxxxx-iPhone-6S-Plus) being created every time I log out and log in to the iOS app. Wondering if anyone else has run into this.

Steps to reproduce:

  1. Log out of the Hubitat app on the phone.
  2. Close (force quit) the app.
  3. Open the app.
  4. Choose "Existing Hub Owner" and login.
  5. App will get stuck on "Loading Mobile Devices".
  6. Force quit the app again, and re-open.
  7. Enable geofence in app settings.

This creates a duplicate presence device with the same name as the previous one. Only the most recent device will correctly reflect presence.

I tried rebooting the hub and the phone, but the duplicate devices still get created.

Device / OS details:
iPhone 6S Plus on iOS 12.3.1.
Hubitat app version 1.0.4 build 48
Hub C4 on (the latest build).

When you log into the mobile app, are you creating a new device or are you selecting your existing presence device from the list?

I would recommend deleting all of your mobile presence devices and then creating a new one the next time you log into the app. That way you're starting out fresh.

I don't get to the point where I can select a new or existing device -- the app hangs and I need to force-quit.

So I removed all seven (!) duplicate Mobile App Devices and tried again.

The first time I log into the app, it creates a new device, xxxxx-iPhone-6S-Plus. When I go into the settings, I see that geofence is enabled. All is good.

Now if I log out, quit the app, and log back in, here's what I see after entering the password:
(a) A screen saying "Loading User Devices" flashes by.
(b) The next screen says "Loading Mobile Devices". Here the app gets stuck. It has found an existing device (hidden under the pop-up) but for some reason it is not able to use it.

(c) From here the only way forward is to force-quit and re-open the app. Now I see that geofence is NOT enabled in settings. The moment I enable it, a new device (with the same name) is created.

I don't think there is anything unusual with my set-up... except that I did try the Beta version yesterday, and then deleted it and re-installed the released version. That's when I first noticed the duplicate devices. Now it's 100% reproducible.

Have you tried uninstalling/deleting and reinstalling the Hubitat mobile app?

Yes, I have. (I think that's the only way to get back from Beta to released version.)

I uninstalled and re-installed again today just to be sure. Same difference :slightly_frowning_face:

Why are you logging out of the app? That's the part I don't understand.

That's a fair question.

I've been using the mobile app since shortly after it was released, and it has never logged me out (unlike other reports here, especially on Android.)

I tried the beta version of the app yesterday, and decided to switch back to the release version. That is when I had to log in again, and noticed the duplicate phone device being created. The issue is 100% reproducible for me.

I don't have many automations which use the mobile app device at the moment, but it would be painful to have to change 10 or 20 app instances to point to a new device if this happens later on.

So, the short answer is, I'm logging out of the app to narrow down what it takes to reproduce the bug :slight_smile:

(As an aside -- I wish Hubitat had a "swap device" feature to recover from issues such as this.)

The reason that has never been implemented is that it can cause major headaches from a support perspective. If you pick a device with different capabilities than the first device you are gonna be SCREWED! So, it's more dangerous than helpful.

When I first setup the mobile app on my wife's 6s (back when the app first came out) anytime here app made her logon again it would create a duplicate object, after finally getting it working correctly (by deleting the duplicates many times and getting one where both the push and Geofencing worked) it hasn't been an issue since.

I never had this issue on my XS although I recently loaded the beta app and it has logged me out multiple times and it gets stuck each time I have to logon at the Loading Mobile Devices as the iOS app always had in my experience but after forcing closed the app and opening it again it has not been creating duplicate objects (I've checked multiple times due to the issues I saw originally on my wife's phone) and Geofencing and push notifications have been working on both phones very well.

So, perhaps the system could check if the two devices have the same declared capabilities, and flag a warning if not. Still allow the user to over-ride, but with a "use at your own risk" caveat.

I know it would have saved me a bit of effort in the past.

The only problem is, what do you do when you screw it up? You contact hubitat. What does hubitat have to do when you do it manually? Nothing.

It's in their interest to not allow users to do that.

@Terk, thank you for your detailed response. Your issue with the 6s sounds very much like what I'm seeing.

I did try to delete all duplicates and re-start, but it did not fix the problem.

My work-around is to create a dummy presence device, and set up a rule so it follows the current working Mobile App Device. Then point all other automations to this dummy device. So I'll only have to fix one rule if the Mobile App Device changes.

There isn't an equivalent dummy device for notifications, but I can just stay with Pushover for now.

I think @cobra added something like this to one of his apps, but it might be like Speaker Central where I think you'll need to set up "restrictions" since the intent is to only go to some devices sometimes and others other times. If it can't work like that, I have a custom app and driver combo I threw together (no guarantees!) that I can share that allows you to use a "proxy" notification device and route it to one or more "real" ones, which I did because I could see something like this happening to me down the road and because I already have multiple devices I want to get the same notifications (and selecting one is easier than more than one).

I'll take a look at Speaker Central. Would be great if you can share your app / driver as well.

BTW I found your Lights On Motion Plus app very useful, especially as a launch point to writing my own custom lighting automations. Thanks for posting it!

Here it is! You'll need both parts:

The documentation at the link to the app code should explain installation and usage, but basically, you create a virtual device using the notification proxy driver, then use the notification proxy app to "link" that virtual/proxy device to one or more "real" notification devices. For apps/automations, you'd then use the proxy device in lieu of the "real" devices, and you can swap out the "real" devices without needing to change automations that use the proxy. (Unlike Speaker Central, I have no way to restrict when notifications go to which "real" devices, so I'd use that instead if you need that; I just wanted something I could use instead of one or more "real" devices all the time in case I switched anything out or changed my mind.)

Great! I'll give these a test drive tonight.

I certainly understand this viewpoint, but a user can already do this to themself by changing the device type (for a random device) to a driver that implements different capabilities. Obviously, anyone who does this should know what they're doing, but you could say the same for either "feature," and the outcome would be the same: likely not hub-stoppingly disastrous, but certainly likely to have a bunch of errors thrown if any automations rely on specific commands or attributes from certain capabilities.

"Replace" is actually a feature that's required for Z-Wave certification. I'm assuming this is one of the reasons Hubitat isn't certified (that plus S2, probably some cost, and who knows how much hassle on top of everything else). SmartThings implements it, and...I can't say it works well more than I could about anything on ST, but I think it works like it's supposed to if you don't intentionally sabotage yourself. :slight_smile:

I’m now running into this issue too.

Was anyone able to resolve it without having to add their newest (and functional) presence device to all the automations and rules that referenced an older (and no longer functional) mobile presence device?

I could do that and delete the old device, but that’s gonna be a bit tedious. In other words, I wonder if the mobile app can re-establish a link with a virtual presence sensor once it’s bern lost?

Usually when you log into the mobile app, you first have to select a hub (if you have multiple). Then, you should be presented with a list of 'mobile devices' on that hub. By selecting the original one for your phone, the link between your mobile phone and the mobile presence/notification device on your hub is reestablished. Hubitat designed it this way to allow users to easily change phones, but still link back to the original device on their hub.

Is this not working for you? Are you on the latest iOS Hubitat Mobile App Beta? It has been running pretty well for me on my iPhone 7, iOS 12.4.1.

I've actually been seeing behavior like what the OP describes for months, through several app versions. Tonight was the first time I ended up with a duplicate device though. I'm running the most recent ios beta app, on ios 13.


Download the Hubitat app