Page 1 of 1

Notification triggered by a lack of activity

Posted: 16 Jul 2014 16:22
by scoggy
I'm trying out Automagic and wondered if the following is possible.

I'd like to set a phone to send an SMS (or email or other notification) to a specified recipient if the phone hasn't been used for a specified period. I'm open to the definition of 'lack of activity'. It could be that no motion has been detected, or a specific app hasn't been opened, or some other trigger I've not thought of. I can't work out how to have a lack of event as a trigger. Presumably I'd need some log file of activity, with a check on that file triggering the SMS.

(A reason why this might be useful is given below, but it's not really essential for the request.)

Background:
My mum lives alone, but isn't elderly and doesn't want any of the available 'monitoring' devices. She does worry about having a fall or something though (as anyone living alone might), and whilst I'm in regular contact with her worries that if she, say, fell down the stairs friends may not realise she's incapacitated for a few days. This SMS wouldn't necessarily be a cause for alarm, but could trigger a phone call to check all is well.

Re: Notification triggered by a lack of activity

Posted: 16 Jul 2014 19:38
by Martin
If you want to detect inactivity of some minutes or even hours then following approach might work:
Store the time of the last detected activity in a global variable:
Activity Detector Flow:
-trigger User Present
-action Script: global_last_activity = triggertime;

You could add several other triggers to the flow, for example Significant Motion Detected, Shake (this one will drain battery), User Activity etc.

A second flow could periodically check if the global variable contains a recent time:
Activity Checker Flow:
-trigger Periodic Timer: every 15m
-condition Expression: addMinutes(global_last_activity, 15) < triggertime
--> true: -action Send SMS: Inactive for more than 15 minutes

This flow will send an SMS every 15 minutes as soon as the inactive period starts and will stop to send when activity is detected again. It might be a good idea to use one more global variable to remember when the inactivity SMS was sent and clear the variable again as soon as activity is detected again so that you don't sent too many SMS.

Re: Notification triggered by a lack of activity

Posted: 16 Jul 2014 20:05
by scoggy
Thanks Martin. Sounds logical. I'll give that a go and see if I can get it to work.