Checking Android Tablet activity with Ping

I need to check if my Android Tablet is actually in use.
I don't want to install any extra app on a tablet and trying to use Ping as activity detector.
It happens to be Ping response average is well above 100mS when Tablet is sleeping and goes below 100mS when Tablet is actively used.
The RM has a Ping action. Variable %value% returns average of packet lost percentage.
I cannot find a related doc for this RM Ping function to check if it returns average response value as well (most likely it does not).
I found a Hubitat Ping driver developed by @thebearmay installed it but I have a trouble how to
use this driver in RM.
To begin with, my local variable is not updated in my simple test:
image
Device avg variable has a valid value but my local variable was not updated.
What i am doing wrong?
And instead of WAIT statement I would like to use responseReady device variable:
image
but cannot figure out hot to use it in RM.
Please advice how to use Hubitat Ping driver in RM.

Guessing that you may be trying to set the variable before the response is ready. Best way to use the responseReady is to separate your rule into two - the first does the Ping, the second uses responseReady changes to 'true' as a trigger and then sets your variable.

No, I added a 20 sec delay between Ping and Set Variable actions:
image

Local variable is/was actually updated but not on a first attempt.
So, I am all set with this action.
I really want to use responceReady instead of a delay but in a single rule.
"Wait for expression" or "Wait for event" is preferable vs separate rule with
responceReady used as a Trigger. But I cannot assign my Boolean local
variable to the responceReady Is it any way how to do this?

Try changing the variable to a string and see if that fixes it.

Yes, this did a trick. Thank you.

1 Like