Skip to content

Is it possible to implement an Internet connection check? #17195

Answered by barbudor
skyvladik asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, you have choice of using WebQuery or Ping to find out if a server outside is out of reach, if so POWER OFF the relay (having Pulsetime and PowerOnState 5 will help to have the power switched back automatically after X seconds)

Exemple with ping

Pulsetime 50
PowerOnState 5
Rule1 on Time#Minute|5 do backlog var1 0;ping4 8.8.8.8;ping4 1.1.1.1;ping4 208.67.222.222; RuleTimer1 60 endon
          on Ping#8.8.8.8#Reachable=true do var1 1 endon 
          on Ping#1.1.1.1#Reachable=true do var1 1 endon 
          on Ping#208.67.222.222#Reachable=true do var1 1 endon 
          on Rules#Timer=1 do Power %var1% endon
Rule1 1

The rule has been splitted on multiple lines for readability but o…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
8 replies
@andypnz
Comment options

@sfromis
Comment options

@andypnz
Comment options

@mikeymileos
Comment options

@mikeymileos
Comment options

Answer selected by Jason2866
Comment options

You must be logged in to vote
2 replies
@sfromis
Comment options

@skyvladik
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants