Announcement

Collapse
No announcement yet.

WeatherXML on line 1590 Subscript out of range

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

    WeatherXML on line 1590 Subscript out of range

    Geez... finally got mcsTemperature working with WeatherXML (am copying the XML file from its default location to the one mcsTemp expects) for a couple of days and now I get this error in the logs once a minute: mcsTemperature, WeatherXML on line 1590 Subscript out of range.

    Help, please?


    Perhaps along the same lines, could someone point me to how I might either re-aim mcsTemp at the standard location for the weathercom.xml file (which seems to be "C:\Program Files\HomeSeer\data\weathercom_xml\weathercom.xml") versus where mcsTemp expects it to be (which seems to be "C:\Program Files\HomeSeer\data\weathercom.xml")?

    Thank you!

    #2
    two way for using weatherxml

    weathercom.xml only need for
    mcstemperature-forecast-Get From WeatherXML file is checked

    The another way checked Get From WeatherXML site use the mcsForecast.ini keys

    [WeatherXML]
    CodeArea=xxx
    PartnerID=aaa
    License=bbb
    Units=s
    mintime=30

    Comment


      #3
      When WeatherXML was originally published the location was directly in the \Data folder. I also have some plugins where the location has changed over time to better follow the desired convention.

      I posted 4.36.2 which has the expected location at \Data\Weather_xml\

      The error is based upon content in the xml file. The code segment where the error show up is below. Look at the XML file where the forecast day information is contained.

      1440 Set oNodeList = xmlfile.getElementsByTagName("day")
      1450 For x = 1 To oNodeList.length
      1460 Set oNode = oNodeList.nextNode
      1470 sTemp = CStr(oNode.selectSingleNode("hi").Text)
      1480 If x = 1 Then
      1490 If IsNumeric(sTemp) Then
      1500 sDailyHigh = MakeNumber(sTemp)
      1510 If bMetricTemp And MetricTemp Then
      1520 sDailyHigh = CStr(CSng(val(sDailyHigh)) * 1.8 + 32)
      1530 End If
      1540 foretemp(x, 1) = sDailyHigh
      1550 Else
      1560 foretemp(x, 1) = sDailyHigh
      1570 End If
      1580 Else
      1590 foretemp(x, 1) = MakeNumber(sTemp)
      1600 If bMetricTemp And MetricTemp Then
      1610 foretemp(x, 1) = CStr(CSng(val(foretemp(x, 1))) * 1.8 + 32)
      1620 End If
      1630 End If

      Comment


        #4
        Beauty. 4.36.2 is looking in the right folder. Excellent! Thanks!

        So... looking at your snip, it looks like I should be looking for an oddity in the "Daily High" forecast section of the weathercom.xml file, right?

        Is it possible that the mcsTemperature is not prepared to deal with a "N/A" in that field of the xml? I can see where a "MakeNumber" function might not like that. I found one of those. I changed it to a number. Same problem.

        The XML file is posted here if that might help figure it out.

        Thanks!

        Comment


          #5
          Gregory can you disable the links tag input?...

          this my xml (working) with N/A
          Attached Files

          Comment


            #6
            Same issue...

            I have the error "1590 Subscript out of range" and I cannot figure out how to fix it. I've tried a few things based on what I thought this thread was recommending.

            Can anyone help me with more specific steps on how to fix my forecast for mcsTemperature?
            Last edited by jasv; August 2, 2005, 09:20 AM.
            James

            Running HS 3 on Win10 .

            Comment


              #7
              I added a check to prevent the error, but what it means is that more than an 8 day forecast was provided which means the data was probably invalid. It is posted at V4.37.8. Note that V4.37.7 is in the updater so if you have not recently updated to the message board contents it may be best to first update with the updater to get other files that may have changed.

              Comment


                #8
                I applied the latest vesion...

                I applied the latest version and the error is gone but I still do not get a forecast. I have the weathercom.xml plugin and it seems to be working fine. I can see the forcast and it updates fine based on the event I enabled.

                On mcsTemperature I have both the "file" and "site" checked but I still don't see a forecast. Not an emergency since I have the weathercom.xml forecast but It is nagging at me that I can't figure out where I've gone wrong. The forecast is set to only grab 5 days.

                Let me know if there is anything you recommed to try.
                James

                Running HS 3 on Win10 .

                Comment


                  #9
                  Do either file or site, but not both. If you are running the script then your only viable choice is file since there is a 30 minute minimum wait between site accesses.

                  Comment


                    #10
                    I did both only because..

                    I did both only because I could not get one to work.

                    Now I am getting the following error.
                    8/2/2005 8:31:40 PM~!~mcsTemperature~!~ GetWeather2 C:\Program Files\HomeSeer\mcsTemperature.mdb Forecast, SQL=SELECT * FROM Forecast WHERE v_LastUp = #2005-08-02 7:55:00 PM# DB=Provider = Microsoft.Jet.OLEDB.4.0; Data Source= Item cannot be found in the collection corresponding to the requested name or ordinal. on line 1420
                    As an FYI the mcsTemperature is working fine in every other way including tracking my temp05 data, some external data and producing really cool charts.
                    James

                    Running HS 3 on Win10 .

                    Comment


                      #11
                      The error is generated because it could not find F1MAX, F1MIN, F2MAX...F5MIN in the forecast table in the database. These new fields were added quite awhile ago and logic in the plugin tries to handle the transition. If you have Access then take a look at the table to confrm. I suspect you have no useful data in your Forecast table. You can try to delete that table when HS is not running and then let the plugin create it from scratch.

                      Comment


                        #12
                        That was it.

                        That took care of it. Thanks for you patience. It seems to be working perfectly now.
                        James

                        Running HS 3 on Win10 .

                        Comment

                        Working...
                        X