Announcement

Collapse
No announcement yet.

Internet Down Warning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Internet Down Warning

    Hi all,

    I note that there is an intrinsic function in HomeSeer to alert me if the interFACE goes down; but I don't see anything to warn me when the InterNET goes down - which it does quite often here in Gomerville, USA. So I assume there is a simple script that can handle this? Can anyone point me to such a script, so I don't have to educate myself on the vagaries of scripting in HS3? (I seem to recall it was so much easier in HS2...)


    Jim Speiser
    38-year veteran of Home Automation
    Still don't know squat

    #2
    Here's one thread on the subject:
    https://board.homeseer.com/showthread.php?t=170330
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      I run a simple script once an hour. It could be run more frequently, and you could have it send a text message or make an announcement rather than just write a log message. That was my intent, but we lose internet so rarely it has never been an issue.
      Code:
          Public Sub Main(ByVal Parms As Object)
      
              Dim strName  As String = "8.8.8.8"
              Dim intR As Integer
      
          intR = hs.Ping(strName)
      
          If intR = 0 Then 
               hs.WriteLog ("Internet", "OK")
          Else
               hs.WriteLog ("Internet", "??")
          End If
      
          End Sub
      Mike____________________________________________________________ __________________
      HS3 Pro Edition 3.0.0.548, NUC i3

      HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

      Comment


        #4
        I thank you for that. (Out of curiosity, what site is 8.8.8.8? Is that a fortune cookie factory? )


        Jim Speiser
        38-year veteran of Home Automation
        Still don't know squat

        Comment


          #5
          Originally posted by Uncle Michael View Post
          I run a simple script once an hour. It could be run more frequently, and you could have it send a text message or make an announcement rather than just write a log message. That was my intent, but we lose internet so rarely it has never been an issue.
          Code:
              Public Sub Main(ByVal Parms As Object)
          
                  Dim strName  As String = "8.8.8.8"
                  Dim intR As Integer
          
              intR = hs.Ping(strName)
          
              If intR = 0 Then 
                   hs.WriteLog ("Internet", "OK")
              Else
                   hs.WriteLog ("Internet", "??")
              End If
          
              End Sub
          Can this pass the value of intR back to the event? Or do I have to handle the error condition within the script code...I want to Speak Something, Send an Email, etc. I suppose I'll have to learn at least that much scripting...


          Jim Speiser
          38-year veteran of Home Automation
          Still don't know squat

          Comment


            #6
            Originally posted by JimSpy View Post
            I thank you for that. (Out of curiosity, what site is 8.8.8.8? Is that a fortune cookie factory? )
            One of Googles recursive name servers. The other is 8.8.4.4. They are the most reliable addresses for a ping to determine Internet connectivity.
            HS4 Pro, 4.2.19.0 Windows 10 pro, Supermicro LP Xeon

            Comment


              #7
              Originally posted by JimSpy View Post
              I thank you for that. (Out of curiosity, what site is 8.8.8.8? Is that a fortune cookie factory? )
              I originally thought I'd ping a few sites rather than just one, and I'd substitute the name of the site in each pass, but my simple test script did the job and I never when back to change 'strName' to 'Google'. I think I'll do that now, though, because, "Why not?"
              Mike____________________________________________________________ __________________
              HS3 Pro Edition 3.0.0.548, NUC i3

              HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

              Comment


                #8
                Originally posted by JimSpy View Post
                Can this pass the value of intR back to the event? Or do I have to handle the error condition within the script code...I want to Speak Something, Send an Email, etc. I suppose I'll have to learn at least that much scripting...
                I'm not sure what you are asking, but if you want to use the value of the return variable from the ping function in other events, I think the easiest way would be to assign it to a virtual device.
                hs.SetDeviceValueByRef(nnn, intR, True), where nnn is the RefID of the device.
                Mike____________________________________________________________ __________________
                HS3 Pro Edition 3.0.0.548, NUC i3

                HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

                Comment


                  #9
                  WAN IP Checker

                  Pretty sure Jon00 has a WAN IP Checker if you don't want to go the scripting route.
                  Peter

                  Comment

                  Working...
                  X