[RELEASE] Unifi Presence Sensor

Hi @xtreme22886. I’ve installed this on my Raspberry Pi which is also running my Unifi Controller. Is there a reason why you put this rest api server at the same port as the Unifi Controller? I’m new to docker, but it looks like I can mess with the docker run command to perhaps map to a different port so I don’t get a conflict. I’ll see if I can figure that out.

I have been on smartthings for a while, but am relatively new to Unifi. I have been watching the slow demise of the smartthings classic app, and it sounds like this device handler and smart app will need a (likely major) revision to continue to work.

For now, I will uninstall this container so I can regain access to my controller (hopefully).

I am coming here not only looking for presence sensing but automation of device blocking (very similar to what is available in Home Assistant apparently). I’m hoping that it’s not too far a stretch from what you’ve been working on. Once you get a new SmartThings device going, I wouldn’t mind trying to contribute on github.

They aren’t using the same port :slight_smile:. By default the UniFi controller uses port 8443. The port I’m using on my Docker image is using port 9443. There should be no port conflicts unless you changed the default port on your UniFi controller.

But you are correct, you should be able to change the port on the Docker image by using the “-p” switch in the command.

I appreciate you checking this solution out though! Hopefully you can get it working. The Classic App will be retired on October 14th so pretty soon. I’m been trying to rewrite this solution to work with the new app but struggling a bit :slight_smile:. Hopefully I’ll get it figured out.

Oops, I confused 9443 with 8443 when I saw it. That figures. Sorry for the confusion!


1 Like

Interesting. Either this weeks app update or ST changed something on the backend has cause these devices to show up when I edit automations in the new app (They still don’t show as devices but my Samsung phone doesn’t either - I think that’s a known issue) I tried a test ’ at least one person home’ automation and that seemed to work. I’ll test a ’ no one home’ automation next

I’m missing one device which I’ve checked in the smart app, it doesn’t show up in the IDE either. Is there any logging on the bridge (In my case, my raspberry pi) I can look for problems @xtreme22886 ?

[Edit : enabling the hotspot devices allowed the missing device to be seen]


1 Like

Hi! I just installed your UniFi presence sensor solution. I hope you have not given up on rewriting it for the new ST app :slight_smile:

What’s not working in the new app for you ?
I set up the smart app and found the devices under ‘member location’ when creating an automation. I then went one step further and created virtual presence devices for each family member and used this smartapp to toggle them - Everyone's Presence

Hi Tim_Jones,
Thanks for the reply. I was expecting to see the selected UniFi presence sensor device(s) in the new ST’s Devices list. I wanted to add them to WebCoRE using the new ST app.

Not sure why the presence status of my phone doesn’t change (still Present) although I have disconnected from wifi for 10 minutes. This is for Classic app

Hi, my unifi presence seems to have gone offline. The icons in actiontiles now show ? instead of presence and webcore doesn’t seem to pick up the presence value. Is this because this app only works with smartthings classic?


@tekken007, I would compare the MAC address of your device while connected to the network to what the app is monitoring. I have seen devices (Smart Phones) change their MAC address when connecting to a wireless network. It is possible you configured the app to watch your device but then the device ending up changing it’s MAC address at some point.

@mixedveg, I don’t use ActionTiles so can’t speak to that issue. But I just did a test and I’m not seeing any issues with webCoRE. webCoRE is able to pick up my presence value. I just tested on the classic app by going into webCoRE and added my phone as an available sensor in webCoRE. I then created the following test piston to verify it was able to pick up on my phone connecting/disconnecting from my network.

Test Presence Piston

I’ve double checked the MAC address. It’s the correct one. Does the present status of your device change in Smartthings IDE? Mine doesn’t at all. Same thing for webcore.

Yes, mine shows present/not present.

What do your IDE logs show?

Thank you for your reply. After looking at your pictures, I have traced back my whole setup process and found the culprit. It was the virtual machine Ubuntu. Not sure if it’s the combination of being a virtual machine (I’ve even made sure it’ staying in the same subnet as the rest of the devices) and Ubuntu’s built-in firewall or both but installing on a Raspberry Pi 3 works fine.

I’m glad you got it working :slight_smile:. I also run my UniFi controller on an Ubuntu VM (HyperV). I haven’t had any issues with it.

Applied this today, works fantastic. Had a lot of troubles with the standard smartthings precense GPS sensor since changing phone. This was awesome, and it’s also so close to the house so i do not have to be 250meter away before it locks. And does not unlock until i am there :slight_smile:

1 Like

That is awesome to hear! Thank you so much for the feedback :slight_smile:

Thanks for the reply. I can’t use the classic app anymore as I have migrated to the new app. Should webcore still be picking up the presence device from the new Smartthings App?

Yes. Make sure you go into webCoRE and add your phone as an available device under the “Which sensors” section.

Then you should see the device in webCoRE and use it as needed.

FYI, Docker image for SmartThings_Unifi-Presence-REST has been updated to:

  • Work with UDM Pro
  • More detailed home page listing available endpoints
  • More useful diagnostic feedback when trying to get a list of UniFi cilents