"Activity Recognition" as a Constraint

mdman2021

New member
I am trying to write a MacroDroid (or Tasker) macro that alerts me when the power goes off when I am sleeping.

At night I put my phone on a charging pad. If the charging pad loses power (Power Disconnected) I NEED the macro to alert me (wake me up) by speaking the text, "ATTENTION... Power has been lost." I will then start my generator to keep the food in my refrigerator from spoiling, etc, etc.

I am also trying to avoid false positive alerts -- like when I take the phone off the charging pad in the morning. I think I need to add a Constraint to the Power Disconnected trigger that ensures the phone is still motionless (still on the charging pad and not moving). To summarize, if the phone's power becomes disconnected -AND- the phone remains motionless THEN, and ONLY THEN, speak the alert.

There is a MacroDroid trigger for "Activity Recognition" that can determine if the phone is moving or still -BUT- there is not an Action or a Constraint.

Help!
 

Dm114

Well-known member
I am trying to write a MacroDroid (or Tasker) macro that alerts me when the power goes off when I am sleeping.

At night I put my phone on a charging pad. If the charging pad loses power (Power Disconnected) I NEED the macro to alert me (wake me up) by speaking the text, "ATTENTION... Power has been lost." I will then start my generator to keep the food in my refrigerator from spoiling, etc, etc.

I am also trying to avoid false positive alerts -- like when I take the phone off the charging pad in the morning. I think I need to add a Constraint to the Power Disconnected trigger that ensures the phone is still motionless (still on the charging pad and not moving). To summarize, if the phone's power becomes disconnected -AND- the phone remains motionless THEN, and ONLY THEN, speak the alert.

There is a MacroDroid trigger for "Activity Recognition" that can determine if the phone is moving or still -BUT- there is not an Action or a Constraint.

Help!
I'm afraid Activity recognition won't help you (even using a variable as a constraint) because it's not accurate enough: it will never recognize if you pick your phone up for a while without walking a consequent distance...

I would suggest something like:
1⁰) when power is off (disconnected), ask whether you have your phone in hand or not ;
2⁰) in case of no answer within a few seconds, you can assume that there is a real lose of power ;
3⁰) if answer comes before the specified delay, deactivate the macro ;
4⁰) activate the macro again when putting it on its stand or manually when going to sleep.
 

mdman2021

New member
Dm114,

First, thank-you for your reply.

Secondly, within MacroDroid, exactly HOW do I "ask whether you have your phone in hand or not"? In other words, what is the TRIGGER, ACTION, or CONSTRAINT in MacroDroid to ask whether you have your phone in hand or not? Or do I need to call Tasker (from within MacroDroid) to determine if my phone is in my hand or not (aka moving)?
 

Endercraft

Moderator (& bug finder :D)
It may not work properly depending on how you hold your phone but you can try the proximity sensor constraint.

You could also try a shake trigger with some stopwatch to let you shake your device as confirmation you're awake in a certain delay.
 

Dm114

Well-known member
Dm114,

First, thank-you for your reply.

Secondly, within MacroDroid, exactly HOW do I "ask whether you have your phone in hand or not"? In other words, what is the TRIGGER, ACTION, or CONSTRAINT in MacroDroid to ask whether you have your phone in hand or not? Or do I need to call Tasker (from within MacroDroid) to determine if my phone is in my hand or not (aka moving)?
You could, very simply, use an Option dialog box with some 10 seconds timeout.
 
Top