[RELEASE] Unifi Presence Sensor

Is there a quick way to force a container update?

I’ve updated both the Docker container and the SmartApps, but there seems to be no problem. If there is a problem, I will provide feedback. Thank you for prompt response.

1 Like

@tmleafs, not that I know of. But I’m very new to Docker. It’s super easy though to just follow the steps I outlined above to sejuni

All currently working, it took 3 mins after my hacked life360 app & dth had already changed to home though can’t see a way to improve that without sticking a AP on the front of the house

Ah, dang. Sucks your device doesn’t connect to wifi sooner. Thanks for the update though.

I have two AP-AC-PROs in the center of the house mounted on the ceiling on each floor. It’s probably due to me having two SSIDs spilt 5Ghz and 2.4Ghz of which my phone is connected to 5Ghz. I’m planning on going back to one SSID now they have added loads of features to the unifi controller to improve the balance of devices

Great project. I have all the components installed , but I can’t seem to get the UniFi Wireless Presence working. When I put the Bridge Address, Controller Address, username, password and Controller Site and click Unifi Client List, it continues to spin and doesn’t return results. Is there a log file I can verify?

@veclempt, thanks for checking it out! A few things to double-check real quick.

  1. For your Controller Site, make sure you are using the site id that you can locate in the URL of the controller and not the name of the site.
  2. When you click on Unifi Client List, at the next screen, the spinning animation will never stop. But you should be able to click (rather tap) on Which client(s) to monitor? and once you do that, then you’ll see a list of devices to choose from.

Let me know if that helps any.

@xtreme22886 I only have one site, so I was using “default”. I verified the URL after I logged into UniFi. https://w.x.y.z:8443/manage/site/default/dashboard and it works to login.

In regards to the UniFi Client List, the list never populates with a value.

@veclempt thanks for checking. Are you running vlans on your network? Are you sure your SmartThings Hub can communicate with this Unifi Bridge? And that the Unifi Bridge can communicate with the Unifi Controller?

You can check the Unifi Bridge’s config file to see if it has anything in it. If there is no config file, then your SmartThings hub is unable to communicate to the Unifi Bridge over your network for some reason.

To check for a config file, browse to: http://bridge-ip:9443/config

Thanks. I get: “No config file!” when I query that URL.
I can ping the SmartThings hub from the UniFi Bridge Container Console, so they can see each other.

Any other suggestions?

And, no VLANS.

@veclempt, thanks for checking. Perhaps, open up the SmartApp again and click Save. When you click Save that is when the SmartApp will send the data fields you filled out over to the Unifi Bridge to store in a config file. If there is no config file, and since you already confirmed that the two devices can see each other. I would try clicking Save again to try to send the data over to the Unifi Bridge again. I would also log into the SmartThings IDE and view the Live Logging and view the logs for the Unifi Wireless Presence. You should see a debug line about Updated with settings after clicking save. Then you might see a debug line about Telling the Unifi Bridge to monitor the following device(s).

Here is what Live Logging shows. I am assuming the “null” is an issue.

9a9fed03-024c-46d4-9072-e20603b953fa 8:31:25 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:31:20 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:31:15 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:31:10 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:31:05 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:30:59 PM: debug Getting list of Unifi wireless clients

9a9fed03-024c-46d4-9072-e20603b953fa 8:30:43 PM: debug Telling the Unifi Bridge to monitor the following device(s): null

9a9fed03-024c-46d4-9072-e20603b953fa 8:30:43 PM: debug Updated with settings: [unifiAddress:http://w.x.y.z:8443, bridgeAddress:http://w.x.y.z:9443, unifiPassword:, unifiUsername:myUsername, unifiSite:http://w.x.y.z:8443/manage/site/default/dashboard]

9a9fed03-024c-46d4-9072-e20603b953fa 8:30:43 PM: debug initialize

@veclempt, I see the issue :slight_smile: Your Unifi Site is wrong. Do not put the entire URL. Only put the Site ID, which in this case is only default. That should fix your issue.

Wow. That’s what it was. Thx! :slight_smile: I also had to remove https:// from the bridge and controller addresses.

This morning I tried to add an additional device, but I am receiving ‘Error Saving Page’ in the UI and the following error message in Live Logging:

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: error physicalgraph.exception.NotFoundException: Child device with device network id unifi-fc:89 not found @line 243 (doCall)

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: debug Deleting device(s): [HS105 (fc:89), HS105 (fd:26)]

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: debug New list: null

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: debug Old list: [HS105 (fc:89), HS105 (fd:26)]

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: debug Updated with settings: [unifiAddress:w.x.y.z:8443, bridgeAddress:w.x.y.z:9443, unifiPassword:, unifiUsername:myUsername, unifiSite:default]

9a9fed03-024c-46d4-9072-e20603b953fa 12:49:24 PM: debug initialize

@veclempt, did you manually delete a presence senor that my App auto-created? Looking at the debug messages, it looks like you manually deleted device with mac ending in fc:89 and my App is looking for that device but it can no longer be found causing some issues.

If that is the case, you should allow my SmartApp to both add and remove devices. To remove devices, you would just got back into the list of devices you wish to monitor and uncheck the box to the device you want to remove. By doing that and clicking Save, it will delete the device for you.

Also, if you make any changes in the App, always be sure to click Save all the way out.

To resolve the issues you currently have, I would simply blow it away and start over again. So do this:

  1. Manually remove all presence sensors my app created
  2. Go into my SmartApp (Unifi Wireless Presence) and scroll down to the bottom and Remove it.
  3. Once removed go back into the SmartApp > My Apps and set it back up again.
  4. Once you enter in all your bridge and Unifi info, click Save
  5. Go back into the app and go to the client list and select the devices you want to setup
  6. Should be good again hopefully :slight_smile:

Now moving forward, if you want to add/remove devices, don’t manually delete anything. Just go back into the app and either select (to add) or deselect (to remove) a device.

I can also see about coding in a fix to this scenario.

1 Like

Thanks. I will try that out.

I’ve updated the SmartApp and Docker image to resolve an issue I found when sometimes adding/deleting devices. I also added the ability to monitor for guest connected to the Guest Portal :slight_smile: