No Motion for a period of Time- Elderly Care


(Bruce) #21

I did add the presence sensor option. It's in the code above in this thread.


#22

I'm just still a little confused for why you're not just using the basic hello home actions for this. They already have everything you're asking for built-in, I think. No custom code required.

Put the presence sensor on your mom's car key chain.

1) set up a HHA to change the mode to "Away" when the presence sensor leaves the house.

2) set up HHA to change the mode to "home" when the presence sensor returns to the house.

3) set up HHA to notify you after x minutes of inaction on the sensor, but not if the mode is away.

(The first time you set up this action you have to have it change the mode to something so you get access to the motion sensor settings, but then just go back in and take out the mode change and it will still run.)

What am I missing?


#23

I think different people handle this differently so there are a lot of creative ways to approach it.

Just to give a little perspective from the other side…

I'm quadriparetic, in a wheelchair with limited hand function. I have a housemate who works irregular hours. I have aides who come in a couple of times a week. I have a service dog. So there a lot of times when it's just me and the dog at home.

I have a panic button that I wear all the time. I really like it. With one button I can connect with two way voice to their help center. So they can call my neighbor, or my housemate at work, or 911 depending on the situation. The device cost about 50 bucks, with a $20 a month fee. No contracts. It's waterproof, and can be worn in the shower. Works on the Verizon cellular network, which is a good coverage where I live. It also has GPS, so if I use it while I'm out in the neighborhood they can locate me.

There are several brands of similar devices. The one I use is the great call splash, which is the waterproof model. You can buy it at RiteAid or from their website. Don't buy it from Amazon, because it messes up the customer service.

It doesn't integrate with smartthings, but I don't care. It gives me everything I want in a panic button device at a very reasonable cost.

http://www.greatcall.com/products/greatcall-splash

So I guess I would say that's the first thing. You don't have to have all your systems integrated together. The most important thing is that you cover all the situations that you want to cover. The panic button device give me something that I can initiate from my side no matter where I am, at home, away, in the shower. And, it doesn't just call 911, it gives me a person to talk to who can call my neighbor if all I need is somebody to come help me with something simple. (Classic example: some idiot delivery person who left a package blocking my gate so I can't get out.)

As far as motion sensor monitoring, or contact sensor monitoring, sure whatever gives your family peace of mind.

There's a topic on a medical smart home that's being developed for VA patients with traumatic brain injury, and it might give you some more ideas.

p.s. The smartthings presence sensor device is not waterproof, and cannot be worn in the shower. Even if it could, you would probably lose the signal there, so it would indicate you left the house, the opposite of what you want.

Its purpose is really for geo-fence detection, that is, you left a 100 m radius area, or you returned to that area. So perfect for attaching to car keys, or a backpack you always take with you when you leave. Many people leave one in the car's glove compartment or attached to the visor on the windshield.

The panic button devices are different, because the person usually triggers the call from their side, and because you have two way voice communication. So those are the kinds of things that you wear all the time. (You can also pay about $35 a month instead of $20 a month and get fall detection, where the device will initiate a call automatically. Useful for some people, not worth the extra money to me.)


(Tim) #24

Not sure what you mean by HHA?


#25

My bad.

HHA = Hello Home Action

See 3) in the following FAQ:


(Bruce) #26

You're missing that he wants to be notified when there is no motion at all during a set period of time, like say 6:00 AM to 10:00 AM. You can't do that with a Hello Home phrase. Also, he want's to monitor for no motion during other time periods. This isn't really a mode based use case, although modes are handy to disable the app, and those modes could be tied to the presence sensor coming and going.

You must be thinking of something else, because Hello Home actions don't offer notification for inaction on sensors.


(Bruce) #27

One more thing to be aware of: the option "Turn off when there is no motion" (from Lights & Switches) only works when there has been motion. The timer is only started by motion. So even that approach won't meet this use case.


#28

Yes they do! The only trick is that the first time you use the set up wizard, you have to specify a mode change. That's what reveals the "when things quiet down" option. (And you can go back in and remove the mode change after the very first time you use the wizard and the HHA will still run fine.)

And they have a time window that you can specify.

Here's screen caps showing exactly those options:

Here I am changing the mode to a guest mode, but that's just while I'm setting it up the first time, I'll take that out later.

Then I'm going to use the "automatically perform" options:

And here you can see that because I specified a mode change on the previous page, I now get to choose from motion sensor options, including the one about inaction which is called "things quiet down":

Since I chose "things quiet down" on the previous page, now I can set the minutes of inactivity and the time when I want to check for that inactivity.

This next Is the same page, I just scrolled down so you can see the time window options:

So it is a part of the official smart things mobile app, no custom code needed, you just have to know the trick about selecting change the mode the first time you set it up.


(Bruce) #29

There still must be motion before this will work. When things quiet down is triggered by motion inactive. Without initial motion, it won't work.


#30

Good to know, thanks!


(Bruce) #31

When a motion sensor detects motion, it throws a motion.active event. Depending on the particular motion sensor, some number of seconds after it no longer detects motion, it throws a motion.inactive event. Failure to throw both of these events would constitute failure of the device, and is rare. N.B. motion.inactive is only thrown once, and only in response to the end of motion detection; it's the closing event of motion detection, where motion.active is the opening event.

You don't have to be a coder to understand the logic of this code:

def noMoreMotion = true
motionSensors.each { noMoreMotion = noMoreMotion && (it.currentMotion == "inactive") }

This code checks each motion sensor in a list of motion sensors (called motionSensors above) to see if it's inactive (&& means AND). If this code is executed each time one of the motion sensors throws motion.inactive, it won't yield true for noMoreMotion until the very last one goes inactive. This is how "Turn off when there is no motion" works, and "When things quiet down".

Most use cases for motion sensors are centered on the function of motion sensing as the cause of some automation event, triggered off the beginning or ending of motion. The OP's use case is the opposite: the triggering of an automation event in the absence of any motion, pure and simple.


#32

I know what you're saying and I agree that if you want to test the state of multiple motion sensors, it's going to require custom code.

But if we're just talking about monitoring a person in their home with a single motion sensor, I tested it and it seems to be okay with the vanilla hello home actions.

I have a sensor which was last active yesterday, and registered inactivity at 8:27 PM.

I set up a new hello home action that would fire after inactivity on that sensor of 15 minutes in a timeframe from 2 PM to 6 PM. And, it fired correctly at 2 PM, so it was looking at the inactivity from last night. It didn't require motion within the timeframe, which I thought might be a smartthings issue, or at least something in the "when things quiet down" code. But it appears to just be looking at the last inactivity flag. So it just comes down to how long those flags are kept.

This is where the details of the use case matter. A person in their own home would presumably have had some measured activity within 24 hours, or somebody would already have checked on them.

The very first time you set it up you're going to have to have some activity on the motion sensor but that's pretty likely to happen anyway just during the physical set up of the device.

So I'm not seeing the "must-have motion before it reports no motion" as a big limitation given the use case.

Again though, I agree absolutely that if you want to check the state on multiple devices, it's going to require custom code. But that wasn't part of the original use case.


(Bruce) #33

No, multiple devices has nothing to do with it. That code was just to show the logic. All of the built-in apps in ST allow multiple motion sensors wherever they allow one.

I did not know that "When things quiet down" acts the way you describe. That's interesting! All of the events are kept for a week, so looking back is not difficult. It's a bit counter-intuitive to say "when things quiet down" and have it apply to an empty house. Not sure that's what's intended either.

I have no ax to grind about custom code. If anything, I always lean towards "less is more" when it comes to ST. If something can be done using built-in apps, that's absolutely the way to go. Some things can be done quite simply also with simple custom apps, and since I can write them, the fact that they are "custom code" is pretty much irrelevant to me. Of course, it is relevant to most people. So when someone shows up asking how can I do x or y, where it isn't at all obvious that ST can do it, my first reaction is to write 6 lines of code that does whatever it is. Part of the cool thing about this community is that this sort of thing can happen to solve someone's problem. smile


#34

After your tip about using multiple sensors in the HHA, I tested both the AND and the OR setups and both worked as expected. 😊

1) sensor 1 inactive and sensor 2 inactive since yesterday, notification sent when the time frame started.

2) sensor 1 inactive, sensor 2 active, notification not sent.


(Scott Windmiller) #35

@mrf161,
Just wanted to say that I love this idea. I don't have a use for this just yet but can definitely see it being very useful down the road. As my parents are getting older they don't want people taking care of them and think they can do everything themselves. This is a good non-intrusive was to keep an eye on them, like you said without bothering them with calls every few hours.
For about $150 to $200 (depending on sensors) you can have a decent setup to keep an eye on them and they would most likely forget it's even there.

My opinion also is to use a presence sensor on her keys provided she always takes the keys with her to lock the door, regardless of if she is driving or not.


(Scott Windmiller) #36

Can you "fake" a motion trigger when the time frame starts so you don't get the notification at first.
Not sure if that's even the problem, I'm just intrigued by this smile


#37

I would think so, if you added a virtual motion sensor to the group of sensors that you test for, and then just trigger it. But I haven't actually done that myself, so I don't know if there are any smart things quirks involved. In particular, I don't know if the inactivity flag works for a virtual sensor.

Another alternative is the old-school fan method where you just have a networked fan near one of the motion sensors and you turn the fan on and off in order to trigger the sensor. It's simplistic, but it works really well. 😊


(Bruce) #38

Here's a thought: Your method with HHA, while it uses only built-in features, is convoluted and unobvious. My solution, while it uses "custom" code (a dozen lines of it), is clean and simple, obvious to the user just what it does. Hmmmm...


#39

Yeah, pretty much everything in the official mobile app is convoluted except for toggling on the things screen and even that is way harder than it needs to be because of the lack of text labels. No argument there.

However, not everyone can or wants to read code. Even simple code. I rely on a text-to-speech reader which makes following groovy almost impossible. So it's going to be "obvious" to some people, but not everybody.

The thing that is so weird to me is that smartthings is using well-established home automation technology in terms of both Z wave/zigbee and cloud to cloud protocols. Really the only thing new about it, besides the cheap price, is the use of the smart phone. And yet they seem to put almost no resources into improving the mobile app experience. It desperately needs an official rules engine/scheduler with a good view into both. Until we get that, almost any solution is going to feel convoluted.

FWIW


(Bruce) #40

Certainly not to make light of your difficulty reading code, what I meant by easy to understand is when you install the app, it's pretty obvious what's going on.

And, as for using text-to-speech on groovy, man that's got to be impossible. The better the groovy code is, the tighter it is, the more obscure it will be in a text-to-speech setting.