[RELEASE] Improved Mobile Presence (Android only)

android
presence
dth_presence
project_presence
webcore

#161

Try disabling AdGuard. Saw that it was an ssl cert error before so that could possibly cause that.


#162

That seemed to work. I just whitelisted the app in my ad blocker. Thanks.


#163

Out of curiosity, how will the app/DTH handle it when my wifi goes to sleep to conserve battery? Will that show me as away?


#164

Shouldn’t do anything unless you actually get out of range.


#165

Whenever I try to do the update on the Improved “Mobile Presence Device” Handler, as described in step 2, I get the following error:
Error: 500: Internal Server Error
URI: /ide/device/update
Reference Id: 5ed74f3a-d0b8-4952-b390-0a658a5a06c2

I assume this is the reason why I can’t seem to make this thing work for me?

Thanks


#166

You get that from GitHub?

Add the device handler first then go back and add the smartapp after. Let me know if it works so I can update the instructions.


#167

Does this work when wifi goes to sleep? Doesn’t it disconnect and reconnect then? So, you’d show as away and then back again.


#168

Thanks a lot for the quick response and for writing this app.

That message is coming from the SmartThings IDE. I activated GitHub integration recently to setup the “Smart Home Monitor Delay”, so I believe GitHub integration is working okay, since the Delay works.

I initially set things up without forking the code in GitHub (because at first I didn’t understand that instruction). So I did that here (while logged into my GitHub account): https://github.com/johndc7/Smartthings
I then went and deleted the previously installed ‘Device’, ‘Device Handler’ and ‘SmartApp’, and then pulled/updated and setup the ‘Device’ again (making sure to add the Device Handler first, and then the SmartApp).

The “johndc7 : Improved Mobile Presence” entry on the Device Handler page is in blue and not black, if that might be an issue? I also can’t get that entry to appear unless I add it via the “Update from repo” button first (and “Execute Update” with “Publish” checked). Whereas the instructions in Step 2 suggest that it should be visible as soon as I add the repo in the Device Handlers page (via the Settings button).

I’m trying to get this working with a Pixel 2, so I downloaded and applied the Android 8.1 apk. I assume we’re supposed to apply that patch from this link and not the Play store:
https://st.callahtech.com/latest-patch.apk

Thanks again


#169

It uses the WiFi events triggered by Android. So basically it doesn’t actually trigger anything unless you get out of range or manually disconnect / turn off WiFi


#170

You need the play store app and the 8.1 patch for it to work. Any help getting more detailed instructions is good since I don’t actually have another account to run through the instructions with.

Both the device handler and the smartapp need to be published to be able to work. Also are you just installing for the first time or are you just adding the smartapp? I believe the blue highlight in SmartThings means there is an update available, which could be the reason for the error as both the device handler and the smartapp have been recently updated.

Let me know what happens and if you (or anyone) has any ideas to make the process simpler or more clear, let me know.


(Zhang) #171

I have a Samsung S8, running Android 8.0.0. So I followed the instruction to get the DH published, device added, oauth enabled, disabled battery optimization for the app on the phone etc. Seems those should be all. But I can only get the status to change when I open the app and click on refresh or click on the settings icon of the app. Any suggestions?
If I have the app open, and connect/disconnect the WIFI, the status in ST won’t change until I do refresh or click on settings.

Thanks


#172

Does it work with the patch installed? Haven’t heard of anyone else having issues on 8.0 but try using the patch and see if it helps.


(Zhang) #173

No. Installed the patch and still the same. Only connect/update when hit “refresh” in the app. Looking at the IDE log, says “Recieved “{“id”:“xxx-xxxx”,“present”:true,“location”:“Home”}” from server” hours after the phone left home. Will check if the phone has a adblocker installed as others mentioned and report back.


#174

Turn on the status notifications in the settings so you can see where its getting stuck. If you have an adblocker installed, that could possibly be the problem. Let me know how it goes.


(Zhang) #175

No luck. Checked phone and it does not have adblocker installed. When connect/disconnect WIFI, getting error as shown in the image.
PastedGraphic-1


#176

Check if you have any type of web filter / adblocker on your network. Since thats an SSL error its most likely caused by something blocking it (So it wouldn’t have the correct SSL certs). If you get the same result when disconnecting from WiFi, its most likely something on your phone. If its only when connecting to your network then its probably something on your network.


(Zhang) #177

It (update error #2) happens both at the time WIFI is connected and disconnected. But I could not find anything that blocks the connection and asked my daughter (who uses the device) and she said she did not install anything like that. Again, it works when hit “refresh”, so seems connection attempts at background are having problems. I have not played with Android since 5 so I am way behind… Anything to debug what the problem is?


#178

That’s the same thing what was happening with the other person that had the ad blocker. Do you have any data savers turned on? It sounds like something on your phone is blocking it from connecting.


(Zhang) #179

Yeah, seems “data saver” is the problem. Disabled data saver for Presence Sensor app. Now, few seconds after I connect the phone to WIFI, the status changes. But disconnect WIFI seems taking a lot longer, need more tests. Thanks,


#180

It takes a little longer after it disconnects since it has to wait for your data to connect.