Announcement

Collapse
No announcement yet.

Darksky stopped working

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

    #16
    False alarm...still not working

    Comment


      #17
      +1 I too have started noticing the same errors in my log. Anyone know if Jeff has been monitoring this thread?
      HS3 3.0.0.548 &HSTouch Designer 3.0.71 with 996 Devices, 547 Events
      Plugin's:
      BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
      EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
      weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave 3.0.1.252

      Comment


        #18
        Mine at least pulled some of the data and updated some data...while we may end up changing something this is clearly a server side issue. It's come and gone a couple times now with me making no changes on my end.

        Comment


          #19
          I don't understand this. I'm have not seen any issues or exceptions at all. I wonder if this is regional...
          HS3PRO 3.0.0.500 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, JowiHue, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dots, WS+, WD+ ... on and on.

          Comment


            #20
            I ran into the same error with my app. Farmer just needs to add this and he should be able to get it restored pretty quick. I had to go through the same thing when MyQ stopped working last year. Same fix works for Dark Sky API connections.

            Code:
                    System.Net.ServicePointManager.Expect100Continue = True
                    System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

            Update: Just received an email from Dark Sky explaining what we had already uncovered. It would have been nice if they would have emailed their API subscribers prior to deploying the change.

            Hi Matt,

            Apologies for the trouble here. At 5 PM Eastern Standard Time yesterday (March 4, 2020), we applied a few security updates in line with the recommendations of a recent security audit, then reverted it over the weekend and reapplied it yesterday at 5 PM EST. This has resulted in us ultimately dropping the following SSL protocols and ciphers:
            • TLS 1.0
            • TLS 1.1
            • TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
            • TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
            • TLS_RSA_WITH_AES_128_GCM_SHA256
            • TLS_RSA_WITH_AES_128_CBC_SHA256
            • TLS_RSA_WITH_AES_128_CBC_SHA
            • TLS_RSA_WITH_AES_256_GCM_SHA384
            • TLS_RSA_WITH_AES_256_CBC_SHA256
            • TLS_RSA_WITH_AES_256_CBC_SHA

            Comment


              #21
              [mention]CFGuy [/mention] Jeff, you happen to have any time to look into this issue?


              Sent from my iPad using Tapatalk
              HS3 3.0.0.548 &HSTouch Designer 3.0.71 with 996 Devices, 547 Events
              Plugin's:
              BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
              EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
              weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave 3.0.1.252

              Comment


                #22
                Great! I added
                Code:
                    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                to my script and it's updating again.

                Thanks!

                Comment


                  #23
                  I have been up as well since yesterday (no idea if it dropped out again at some time between), but after running a network team for a couple decades the guys doing the patches have my sympathy...at least to some point . My setup is purely through the plugin and I've changed nothing. For it to happen more than once over the last couple weeks probably means they have some openings on their team. I just appreciate it's still a free service!

                  Comment


                    #24
                    Originally posted by zwolfpack View Post
                    Great! I added
                    Code:
                     System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                    to my script and it's updating again.

                    Thanks!
                    I tried adding this to a script but it errors. I using an IMPORTS statement before running the script. Is this not the correct way to add this?

                    Thanks
                    Don

                    Comment


                      #25
                      Originally posted by zwolfpack View Post
                      Great! I added
                      Code:
                       System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                      to my script and it's updating again.

                      Thanks!
                      I confirm this addition has gotten my script working again. Special thanks to phuz for figuring this out and confirming w/ the folks at Dark Sky.

                      Agreed that it would have been nice for them to give their API users a heads up. But I won't complain since it is free

                      I wonder if they notified their paying customers....

                      Comment


                        #26
                        Originally posted by donstephens View Post

                        I tried adding this to a script but it errors. I using an IMPORTS statement before running the script. Is this not the correct way to add this?

                        Thanks
                        Is the statement inside the sub or function?

                        I had problems as well initially because I put the statement right after my IMPORTS statement, i.e. outside of the Main sub. After moving to inside the Main sub, it started working.

                        Comment


                          #27
                          Originally posted by teladog01 View Post

                          Is the statement inside the sub or function?

                          I had problems as well initially because I put the statement right after my IMPORTS statement, i.e. outside of the Main sub. After moving to inside the Main sub, it started working.
                          It is outside the Sub.

                          Could you show me how you are calling it inside the Main?

                          Thanks for the help
                          Don

                          Comment


                            #28
                            Full script

                            Note that main routine is named 'Current'. Either rename this to 'Main' or set 'Current' in the 'Sub or Function' field of the event action.

                            Event action 'Parameters' field is set to 'Darksky'.

                            Code:
                            Imports Newtonsoft.Json
                            
                            Dim errmsg As String
                            
                            Sub Current(p As String)
                                Dim Debug As Boolean = hs.GetINISetting("Settings", "Debug", "False", "DarkSky.ini")
                                Dim logName As String
                            
                                Dim pa As String() = Split(p, "|")
                                Dim Location As String = pa(0)
                                logName = Location
                            
                                Dim apikey As String = hs.GetINISetting("Settings", "weatherapikey", "", "DarkSky.ini")
                                If Debug Then hs.WriteLog(logName, "API key: " & apikey)
                                Dim dLatitude As Double = hs.GetINISetting("Settings", "gLatitude", "0")
                                Dim dLongitude As Double = - hs.GetINISetting("Settings", "gLongitude", "0")
                                If Debug Then hs.WriteLog(logName, "Latitude,Longitude: " & CStr(dLatitude) & "," & CStr(dLongitude))
                            
                                Dim host As String = "https://api.darksky.net"
                                Dim page As String = "/forecast/" & apikey & "/" & dLatitude & "," & dLongitude & "?exclude=alerts,flags,daily,hourly,minutely"
                                Dim strip_tags As Boolean = False
                                Dim port As Integer = 443
                            
                                System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                            
                                Try
                            '        Dim webClient As New System.Net.WebClient
                            '        Dim resp As String = webClient.DownloadString(host & page)
                            
                                    Dim resp As String = hs.GetURL(host, page, strip_tags, port)
                                    If Left(resp, 6) = "ERROR:" Then
                                        ' only report initial instance
                                        If errmsg <> resp Then hs.WriteLogEx(logName, resp, "#ff0000")
                                        errmsg = resp
                                        return
                                    End If
                                    If errmsg <> "" Then
                                        ' error cleared
                                        errmsg = ""
                                        hs.WriteLogEx(logName, "error condition cleared", "#008000")
                                    End If
                            
                                    Dim obj As Object = JsonConvert.DeserializeObject(resp)
                            
                                    Dim currently As Object = obj.Item("currently")
                            
                                    Dim cloudCover As Double = currently.Item("cloudCover") * 100
                                    If Debug Then hs.WriteLog(logName, "cloud cover: " & cloudCover)
                                    hs.SetDeviceValueByName(Location & " Cloud Cover", cloudCover)
                            
                                    Dim humidity As Double = currently.Item("humidity") * 100
                                    If Debug Then hs.WriteLog(logName, "humidity: " & humidity)
                                    hs.SetDeviceValueByName(Location & " Humidity", humidity)
                            
                                    Dim pressure As Double = currently.Item("pressure")
                                    If Debug Then hs.WriteLog(logName, "pressure: " & pressure)
                                    hs.SetDeviceValueByName(Location & " Pressure", pressure)
                            
                                    Dim temperature As Double = currently.Item("temperature")
                                    If Debug Then hs.WriteLog(logName, "temperature: " & temperature)
                                    hs.SetDeviceValueByName(Location & " Temperature", temperature)
                            
                                    Dim uvIndex As Double = currently.Item("uvIndex")
                                    If Debug Then hs.WriteLog(logName, "uvIndex: " & uvIndex)
                                    hs.SetDeviceValueByName(Location & " UV Index", uvIndex)
                            
                                    Dim visibility As Double = currently.Item("visibility")
                                    If Debug Then hs.WriteLog(logName, "visibility: " & visibility)
                                    hs.SetDeviceValueByName(Location & " Visibility", visibility)
                            
                                    Dim windBearing As Double = currently.Item("windBearing")
                                    If Debug Then hs.WriteLog(logName, "wind direction: " & windBearing)
                                    hs.SetDeviceValueByName(Location & " Wind Direction", windBearing)
                            
                                    Dim windSpeed As Double = currently.Item("windSpeed")
                                    If Debug Then hs.WriteLog(logName, "wind speed: " & windSpeed)
                                    hs.SetDeviceValueByName(Location & " Wind Speed", windSpeed)
                            
                                Catch ex As Exception
                                    'Error trapping
                                    Dim exmsg As String = ex.ToString
                                    If errmsg <> exmsg Then hs.WriteLogEx(logName, exmsg, "#ff0000")
                                    errmsg = exmsg
                                End Try
                            
                            End Sub
                            Attached Files

                            Comment


                              #29
                              Thanks. Perfect!
                              Don

                              Comment


                                #30
                                Originally posted by zwolfpack View Post
                                Full script

                                Note that main routine is named 'Current'. Either rename this to 'Main' or set 'Current' in the 'Sub or Function' field of the event action.

                                Event action 'Parameters' field is set to 'Darksky'.

                                Code:
                                Imports Newtonsoft.Json
                                
                                Dim errmsg As String
                                
                                Sub Current(p As String)
                                    Dim Debug As Boolean = hs.GetINISetting("Settings", "Debug", "False", "DarkSky.ini")
                                    Dim logName As String
                                
                                    Dim pa As String() = Split(p, "|")
                                    Dim Location As String = pa(0)
                                    logName = Location
                                
                                    Dim apikey As String = hs.GetINISetting("Settings", "weatherapikey", "", "DarkSky.ini")
                                    If Debug Then hs.WriteLog(logName, "API key: " & apikey)
                                    Dim dLatitude As Double = hs.GetINISetting("Settings", "gLatitude", "0")
                                    Dim dLongitude As Double = - hs.GetINISetting("Settings", "gLongitude", "0")
                                    If Debug Then hs.WriteLog(logName, "Latitude,Longitude: " & CStr(dLatitude) & "," & CStr(dLongitude))
                                
                                    Dim host As String = "https://api.darksky.net"
                                    Dim page As String = "/forecast/" & apikey & "/" & dLatitude & "," & dLongitude & "?exclude=alerts,flags,daily,hourly,minutely"
                                    Dim strip_tags As Boolean = False
                                    Dim port As Integer = 443
                                
                                    System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12
                                
                                    Try
                                '        Dim webClient As New System.Net.WebClient
                                '        Dim resp As String = webClient.DownloadString(host & page)
                                
                                        Dim resp As String = hs.GetURL(host, page, strip_tags, port)
                                        If Left(resp, 6) = "ERROR:" Then
                                            ' only report initial instance
                                            If errmsg  resp Then hs.WriteLogEx(logName, resp, "#ff0000")
                                            errmsg = resp
                                            return
                                        End If
                                        If errmsg  "" Then
                                            ' error cleared
                                            errmsg = ""
                                            hs.WriteLogEx(logName, "error condition cleared", "#008000")
                                        End If
                                
                                        Dim obj As Object = JsonConvert.DeserializeObject(resp)
                                
                                        Dim currently As Object = obj.Item("currently")
                                
                                        Dim cloudCover As Double = currently.Item("cloudCover") * 100
                                        If Debug Then hs.WriteLog(logName, "cloud cover: " & cloudCover)
                                        hs.SetDeviceValueByName(Location & " Cloud Cover", cloudCover)
                                
                                        Dim humidity As Double = currently.Item("humidity") * 100
                                        If Debug Then hs.WriteLog(logName, "humidity: " & humidity)
                                        hs.SetDeviceValueByName(Location & " Humidity", humidity)
                                
                                        Dim pressure As Double = currently.Item("pressure")
                                        If Debug Then hs.WriteLog(logName, "pressure: " & pressure)
                                        hs.SetDeviceValueByName(Location & " Pressure", pressure)
                                
                                        Dim temperature As Double = currently.Item("temperature")
                                        If Debug Then hs.WriteLog(logName, "temperature: " & temperature)
                                        hs.SetDeviceValueByName(Location & " Temperature", temperature)
                                
                                        Dim uvIndex As Double = currently.Item("uvIndex")
                                        If Debug Then hs.WriteLog(logName, "uvIndex: " & uvIndex)
                                        hs.SetDeviceValueByName(Location & " UV Index", uvIndex)
                                
                                        Dim visibility As Double = currently.Item("visibility")
                                        If Debug Then hs.WriteLog(logName, "visibility: " & visibility)
                                        hs.SetDeviceValueByName(Location & " Visibility", visibility)
                                
                                        Dim windBearing As Double = currently.Item("windBearing")
                                        If Debug Then hs.WriteLog(logName, "wind direction: " & windBearing)
                                        hs.SetDeviceValueByName(Location & " Wind Direction", windBearing)
                                
                                        Dim windSpeed As Double = currently.Item("windSpeed")
                                        If Debug Then hs.WriteLog(logName, "wind speed: " & windSpeed)
                                        hs.SetDeviceValueByName(Location & " Wind Speed", windSpeed)
                                
                                    Catch ex As Exception
                                        'Error trapping
                                        Dim exmsg As String = ex.ToString
                                        If errmsg  exmsg Then hs.WriteLogEx(logName, exmsg, "#ff0000")
                                        errmsg = exmsg
                                    End Try
                                
                                End Sub
                                Really sorry, I’m not understanding this fix. What script are you editing? Is this a script that is installed with the plugin? Where are you finding this file?


                                Sent from my iPad using Tapatalk
                                HS3 3.0.0.548 &HSTouch Designer 3.0.71 with 996 Devices, 547 Events
                                Plugin's:
                                BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
                                EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
                                weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave 3.0.1.252

                                Comment

                                Working...
                                X