Checking a return value from Ping in RM

I am trying to check if LAN device (Hubduino) is powered on and on line by using RM Ping.
Rule has a local variable Ping_Status which I am trying to assign a returned %value%


This is not working and generates an error:

What is wrong and how to actually check a returned value in %value% ?

I don't claim to know why, as Ping isn't a Rule Machine function I've used previously, but I do appreciate the idea. Thanks!

I always get a value of 0 when I ping, however for the reason of simply checking for a ping response, you can simply send the text result from the log for packet loss. A device online should have 0 or at least less than 100% packet loss and the log will indicate this.

I tested this and it successfully notifies me on my phone that my Insteon hub is online when I run the rule actions with it plugged in, and when I unplug my Insteon hub, it notifies me that it's offline when I run the rule actions.

To log the value, create a hub variable and the create a connector so you can retrieve it with a conditional action in your rule.

Thank you for the idea, I may try it.
But it must be a simpler way how to check packet loss value after ping is complete.
Now for some reason I cannot find any description for built-in RM Ping (@bertabcd1234 ?)
but I did see it at some point. If I am not mistaken %value% returns packet loss percentage.
For some reason I cannot extract this %value% for comparison.

UPDATE
I am all set.
Set local variable to %value% absolutely must be right after the ping action.
If something is in between %value% becomes invalid.

1 Like