Using Ping in RM to toggle an outlet

This is a bit tricky to figure out, but the 2.2.9.137 release notes have the clue you'll need:

Rule 5.1: Added Ping action. This pings an IP address 3 times, and returns a string with the results. The string is in %text%. It also places the packetLoss value in %value% (100 means no response).

So, the easiest thing to do is probably something like:

Rule 5.1 with Ping, Set pingValue to %value% as integer, IF (pingValue = 100) THEN do stuff END-IF

(Be sure to create a local or hub variable; mine is called pingValue. This is necessary since you can't use the built-in %value% variable in this way without assigning it to a "real" variable first, which I'm doing like this:

)

You'll also need some trigger, which I didn't include above. A periodic trigger with whatever interval (a couple times an hour or whatever?) sounds like it might do the trick for you.

5 Likes