No announcement yet. not working

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

    Yes, the redirect will handle this case, as it has to since we will be moving to a load sharing server arrangement so your HS system may be connected to any server but your request service may issue a request through a different server.

    Originally posted by zwolfpack View Post

    The 'geo thing' works by posting to, which it does correctly.

    Does the 'redirect thing' address the situation where the HS3 application remains connected to the non-active, as shown in post #26 above?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products


      Yes, we moved over to a new server, but moved over all the traffic so you should not see any issue. Should be testing the redirect this week. I will post to this thread when we start the test since many may be monitoring and can post if they see an issue.

      Originally posted by zwolfpack View Post
      MyHS switched over to an alternate server today @12:38 PST.
      Jan-03 12:38:44 Info System connected to MyHS Service successfully with license ID xxxxx.
      Jan-03 12:38:44 Info System connected to MyHS Service, waiting for acknowledge...
      Jan-03 12:38:33 Warning Have not heard from MyHS in over 3 minutes, disconnecting for re-connection. is currently resolving to Prior to that was resolving to

      Services are working properly, since the HS3 backend reconnect logged above was established to the 'primary', connected33.

      Will continue to monitor. In the 12/31 evening failure, connected2 resolution switched back to connected22, but the backend connection remained to connected33. connected33 would have to drop the backend in this case to get things back on track.
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products


        I've put together a script to monitor the MyHS connection and report it's status. This may become OBE once this 'redirection' enhancement goes live, but there hasn't been news on that front, and occasional issues are still being reported on the forum.

        Some background ... There are currently two servers handling MyHS traffic is aliased to; Traffic Manager being a Microsoft Azure service. TrafficManager in turn aliases this to one of the two connected22 or connected33 servers, and provided the ability to switch to the alternate, based on health rules set by the provider (HomeSeer).


        The images show an event that runs the script, and another to send notification upon status changes. Next, the device display when things are normal (now), and one from a couple of weeks ago when the internet was down.

        It's usually quiet but there was a flurry of activity this morning, as evident from the Pushover display. There was another page before that, starting at 8:40AM PST. Nothing since 10:33 AM.

        ' MyHS "Backend" Connection Monitor
        ' @zwolfpack 1/2020
        ' This routine reports if the MyHS "backend" connection is active and if the   
        ' remote host matches that of the "frontend" server.
        ' status set in specified device
        '  0: Normal (frontend and backend IP's match)
        '  1: Offline (DNS lookup of frontend [] failed)
        '  2: Not Connected (no backend connection found)
        '  3: Mismatch (frontend and backend IP's differ)
        ' USAGE: 
        ' set device name to update in script 'Parameters' field, 
        ' or leave blank for default "MyHS Connection Status".
        ' device will be created if necessary. 
        Dim debug As Integer
        Dim logName As String
        Sub Main(param As String)
            ' Parse optional parameters
            Dim pa As String() = Split(param, ",")
            ' 1st parameter: device name
            Dim dvName As String = "MyHS Connection Status"
            If pa(0) <> "" Then dvName = pa(0)
            LogName = dvName
            ' 2nd parameter: debug level (0-3)
            debug = 0
            If pa.Length > 1 AndAlso IsNumeric(pa(1)) Then debug = CInt(pa(1))
            ' icon source folder & size
            Const iconFolder As String = "images/HomeSeer/status" ' underneath HS3 html folder
            Const iconSize As Integer = 32
            Dim dvRef As Integer = hs.GetDeviceRefByName(dvName)
            If dvRef <= 0 Then dvRef = hs.NewDeviceRef(dvName)  ' create device if necessary
            ' lookup remote frontend address
            Dim cname As String = ""
            Dim frontendAddr As String = nslookup(cname)
            If debug > 0 Then hs.WriteLog(logName, cname & " => " & frontendAddr)
            ' scan netstat info for backend connection
            Const svcportno As Integer = 10300
            Dim backendAddr As String = svclookup(svcportno)
            If debug > 0 Then hs.WriteLog(logName, "backend => " & backendAddr)
            Dim dvVal As Integer
            Dim icon As String
            If frontendAddr = "" Then
                dvVal = 1
                frontendAddr = "<font color=""red"">Not Resolved</font>"
                icon = "unknown.png"
            ElseIf backendAddr = "" Then
                dvVal = 2
                icon = "alarm.png"
                backendAddr = "<font color=""orange"">Not Connected</font>"
            ElseIf backendAddr <> frontendAddr Then
                dvVal = 3
                icon = "alarm.png"
                backendAddr = "<font color=""orange"">" & backendAddr & "</font>"
                frontendAddr = "<font color=""orange"">" & frontendAddr & "</font>"
                dvVal = 0
                icon = "ok.png"
            End If
            icon = iconFolder & "/" & icon
            Dim dvStr As String = _
                "<table class=""device_status_image_table""><tbody><tr><td>" & _
                "<img align=""absmiddle"" src=""" & icon & """ width=""" & iconSize & """></td><td style=""padding-left:5px"">" & _
                "Frontend: " & frontendAddr & "<br>" & _
                "Backend: " & backendAddr & _
            hs.SetDeviceValueByRef(dvRef, dvVal, True)
            hs.SetDeviceString(dvRef, dvStr, True)
        End Sub
        ' DNS Lookup
        Private Function nslookup(name As String) As String
            Dim addr As String = ""
            Dim errmsg As String
            For ii As Integer = 1 To 3  ' try up to three times
                    errmsg = ""
                    addr = System.Net.Dns.GetHostEntry(name).AddressList(0).ToString()
                    If addr <> "" Then
                        return addr
                    End If
                Catch ex As Exception
                    'Error trapping
                    errmsg = ex.Message
                End Try
                System.Threading.Thread.Sleep(5000)  ' delay (ms) between tries
            If errmsg <> "" Then hs.WriteLogEx(logName, errmsg, "#ff0000")
            return addr
        End Function
        ' Service Port Connection Lookup (similar to netstat)
        Private Function svclookup(svcport As Integer) As String
            Dim ipProps As System.Net.NetworkInformation.IPGlobalProperties = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties()
            For Each connection As System.Net.NetworkInformation.TcpConnectionInformation In ipProps.GetActiveTcpConnections
                If connection.state.ToString = "Established" Then
                    Dim ii, rport As Integer
                    Dim remoteEndPoint, raddr As String
                    remoteEndPoint = connection.RemoteEndPoint.ToString
                    If debug > 1 Then hs.WriteLog(logName, RemoteEndPoint.ToString)
                    ii = InStrRev(remoteEndPoint, ":")
                    If ii > 0 Then
                        raddr = Left(remoteEndPoint, ii - 1)
                        rport = CInt(Mid(remoteEndPoint, ii + 1))
                        If debug > 2 Then hs.WriteLog(logName, "raddr=" & raddr & " rport=" & rport)
                        If (rport = svcport) Then
                            return raddr
                        End If
                    End If
                End If
            return ""   ' no match
        End Function
        Attached Files


          rjh This problem is happening again. If i use connected2 it doesn't work. If I use connected33 it works.


            Right now, connected2 is pointing to connected22, but my system "backend" connection is to connected33. The backend connection changed from connected22 to connected33 at 9:44AM PST.

            I can remotely connect via Safari; after authenticating with it kicks over to connected33. But neither HS3Touch nor HS Mobile apps will connect.

            oops, 11:47 PST got a pushover that the backend switched back to connected22. That hosed my Safari session so trying to reestablish that. Running much slower that usual. Neither HS3touch nor Mobile are responding yet.

            HS3touch stuck at "Connecting..."

            Mobile stuck at login page.


              Yeah connected 33 just stopped working also. Tried connected2 and got nothing then tried connected22 and now its working again.


                HS3Touch & Mobile just started working.


                  Originally posted by zwolfpack View Post
                  HS3Touch & Mobile just started working.
                  Just retested connected2 and its back working.


                    connected2 down!

                    Monitoring with zwolfpack's excellent script.


                      I confirm, no MyHS connection:

                      HTTP/1.1 200 OK Accept-Ranges: bytes Content-Length: 211 Cannot connect to system, might be offline.
                      Redirecting to Log In page...
                      Error from log:

                      mar-07 18:26:34 
                      Creating connection to MyHS service, there may be a problem with the server or the Internet connection. The connection will be attempted again shortly.
                      System is online, internet connection is OK.


                        myhs seems to be back up again.


                          Originally posted by mbuettner View Post
                          myhs seems to be back up again.
                          Yes, up again.


                            Try now as a fix was put in recently.
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products


                              Originally posted by Rupp View Post
                              Try now as a fix was put in recently.
                              Thanks Rupp. My Google Home has never felt more responsive than now. Near instant response, all the way from Vietnam. Hope it stays that way.


                                Between 9:49 and 10:02 AM PDT, DNS for twice switched from connected22 to connected33 and back.

                                At 9:52, my system reported 'have not heard from MyHS in over 3 minutes, disconnecting for reconnection', at which point it reconnected (to connected33, was connected22).

                                Once all the switching was finished, my system is connected to connected33 but connected2 is pointing to connected22.

                                MyHS is broken (can't connect).

                                The situation can be fixed by restarting HS, or by disable/enable MyHS on Setting->Network tab.

                                But I shouldn't have to do this...

                                rjh - why does the inactive MyHS server not drop its active backend connections? What about the touted 'redirect'?