Force Change status of mobile presence sensor?


(Jack R) #1

My wife’s android phone is connected to ST as a presence sensor. Occasionally it dosen’t show away when she leaves the house. Is there a way I can force or update the status to away?


Smarttings Hub thinks my iPhone is "Home" but it is not
(Scott Shell) #2

I’ve had this problem before with my wife’s phone (an iPhone) and was pointed here by SmartThings Support.

I should add that since I did these things her presence has been updating much better than it was before.


(Jack R) #3

Appreciate the info but what I really want to know is if I can update / force a status change.


#4

I’ve never really found out how to force it. I just text my wife to please open the ST app and close it after a few seconds and then the status gets updated (most of the time).

It happened to my own presence and I couldn’t fix it for the life of me, but I did not tell her :wink:


(Jack R) #5

that’s what I was afraid of. ST needs a refresh button for it.


(Kevin) #6

From what I can tell, the default Mobile Presence DTH doesn’t run locally so I ended up modifying it so that I could force the presence when needed.

I’ve been using it for a little while and haven’t had any problems so I just posted it to GitHub.


[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)
[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)
(Jack R) #7

nice :slight_smile: works great ! Thanks.


(Kevin) #8

If you’re home and you force it to not present, after a little while it should correct itself and go back to “present”, but it’s useful for short term situations like the ones you mentioned.


(Jack R) #9

so it will continue to work (change presence automatically) like the “stock” device type but your code has the force option?


(Kevin) #10

Correct, I added code that raises the “present” and “not present” events when those buttons are pushed, but I didn’t modify any of the original code that handles determining presence.


(Scotty) #11

How do I add this? I tried as a Smart App and it didnt like it.


Variable Passed Between Methods/Events?
(Kevin) #12

You need to install it in the “My Device Handlers” section. Once you install and publish it, go to the “My Devices” screen, select the mobile device that you want to use it on, click the edit button, and then select the new device handler from the “Device Types” field.


(Scotty) #13

Ahhh, dangit, I should know this by now, sorry.


(Scotty) #14

Okay, appears to work, but you loose the battery status and the ability to make the sensor ‘beep’ so it can be found if lost.


(Kevin) #15

It sounds like you’re trying to use it with the SmartSense Arrival Sensor, but this DTH is for Mobile Presence.

The presence on my Mobile Phone acts up frequently, but I’ve never had that problem with my arrival sensor.

I could easily add this functionality to the arrival sensor, but it would no longer run locally and I’m not sure if that would have any affect on it’s reliability or battery life. If you still think the ability to override the state is worth it, let me know and I’ll make the same changes to the arrival sensor DTH.


(Scotty) #16

Well, crap! Forgive me yet again. I had just assumed that Presence Sensor and Arrival Sensor were one in the same. So that is on me and I apologize.

However, the reason I was trying it out is that the wife and I work near polar opposite hours, so it’s difficult to set up and test different rules and automations. I’m using the CoRE rules engine to do all this. So when I saw this post I thought wow, here is the perfect thing to test the automations based on presence whether we are here or not.

So, yeah, it has some practical applications, at least to me, in that respect. I had, in fact, already printed out the code for the Arrival Sensor and the code for this (Forced Status Change) trying to do a stare and compare to see if I could do something.

By the way, can you tell me what DTH stands for? I think I have also seen SMH as well but have not been able to glean what they mean from the usages I have seen here.


(Kevin) #17

When you’re testing things, it’s often a lot easier to create a virtual device.

Go to the devices page in the IDE, click new device, leave the zigbee id field empty and enter whatever you want into the name, label and device network id fields. Choose a device like “Simulated Presence Sensor” from the “device type” field.

DTH: Device Type Handler
I think you mean SHM and that one means Smart Home Monitor.


(Scotty) #18

Geeesh, I’m learning so much from this thread. Thank you for that input. I was not aware I could create virtual devices for such things and purposes. Off to the races I go then.

Thank you again so much for the input and help.


(Jack R) #19

This code is very good for testing mobile presence based activities / routines. No more driving around in my car. I am surprised this wasn’t published before.

Big thanks to Kevin.


(Jason Dreher) #20

I got this working on my device and am able to change the status but it does not update itself. Any idea what the issue may be? I am away from home (23 miles away), I update the status to “Present” and it does not change back to “Away”. I am leaving it for 30 minutes but nothing changes.

Any idea?