Announcement

Collapse
No announcement yet.

Canadian Weather Script Discussion

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

    Canadian Weather Script Discussion

    I just uploaded version 1.1 which has a new function Speak_All() that speaks every weather parameter.

    Download Canadian Weather Script here.

    Needed it for my RF_Remote script that I'm playing with now.

    Cheers,
    Paul

    #2
    Just uploaded version 1.2. Download from above link. Changes are:

    1.2 - Added formatting to forecast display to make it more readable,
    Changed tabs to spaces to make script more text editor friendly,
    Added highlighting of weather warning string via <marquee> or <blink>.

    Next release will include icons for temperatures, pressure and humidity.

    Cheers,
    Paul

    Comment


      #3
      Hi Paul

      I just downloaded the the newest version. The forecast is looking gooood. It is easier to read now. Great job. I have also change my system to update the weather every 15 minutes now as well.

      Great stuff.

      Keep on the Home Automation trail.

      [img]/infopop/emoticons/icon_cool.gif[/img]

      Ken

      "Make it So"

      Comment


        #4
        Hi Paul:

        Great script.

        I tested using Toronto, YYZ and all worked well. I then wanted to get the report a little closer to home so I used:
        Const LOCATION = "Mississauga"
        Const LOCATION_CODE = "ON-24"
        Const FORECAST_START_STRING_TAG = "Halton-Peel:"

        When I run the script I get the following:

        01/02/2002 2:02:57 PM~!~Weather Debug~!~Retrieving weather from environment Canada for Mississauga from http//www.weatheroffice.ec.gc.ca/scripts/citygen.pl?client=ECCDN_e&city=ON-24
        01/02/2002 2:03:10 PM~!~Info~!~ Script Error, File: Canada_Weather.txt: 5:Invalid procedure call or argument: 'Instr' in line 294

        I haven't been able to figure out as yet what is happening, Hopefully you may be able to point me in the right direction.

        Thanks;
        Paul Miller

        Comment


          #5
          Thanks for the info Paul. I've never seen that page before that has no current info just:
          "Current Conditions Not Available at this time".

          I'll make changes to the script to handle it and post it this weekend hopefully.

          With help like this we'll be able to find all of the quirky things Env Canada does and I can modify the script to adapt to them without barfing.

          Cheers,
          Paul

          Comment


            #6
            Just posted version 1.3 of this script at above URL. Changes include:

            Added temperature and humidity icons,
            Added comment to add recurring event to Homeseer to run script.
            Added ability to enable or disable icons.
            Added handling of "Current Conditions Not Available at this time" pages

            Cheers,
            Paul

            Comment


              #7
              Excellent script!

              Extremely well documented and works great!


              CyberA

              Comment


                #8
                Just posted version 1.4 of this script at above URL. Changes include:

                Added flashing icon for active weather warnings,
                Added handling of "Forecast not available",
                Added handling of issued and continued weather warnings,
                Moved weather warning to top of weather icons for visibility,
                Added location's link to Env. Canada page on weather icon,
                Added "Observed on:" info to current weather,
                Added missing Speak_Current_Weather to Speak_All,
                Added Env. Canada trend links to temp. ,wind ,humidity and variable item icons.

                Cheers,
                Paul

                Comment


                  #9
                  Paul,

                  Great script!

                  If I may be so bold, a couple of suggestions ...

                  1. A comment in your header that temperature icons go in a sub-directory. I got caught when I simply dragged the icons from the zip folder.

                  2. A bit of debug code to catch if people set their city wrong or Environment Canada changes it. I added the following around line 404:

                  [b]
                  if iForecast_Start_Position = 0 then
                  hs.writelog "Error","Canada_Weather.txt forecast missing. Verify FORECAST_START_STRING_TAG & LOCATION_CODE"
                  exit sub
                  end if
                  [\b]

                  Once again, thanks for the great script. You've obviously put a lot of work into this.

                  dp

                  Comment


                    #10
                    Hi Paul,

                    Just trying out your script. I've changed the location variables to the following:

                    Const LOCATION = "Fort McMurray"
                    Const LOCATION_CODE = "ymm"
                    Const FORECAST_START_STRING_TAG = "Fort McMurray:"

                    When I run the script I get the following in the log (when debug is turned on):

                    10/02/02 10:33:25 AM~!~Weather Debug~!~Retrieving weather from environment Canada for Fort McMurray from http//www.weatheroffice.ec.gc.ca/scripts/citygen.pl?client=ECCDN_e&city=ymm
                    10/02/02 10:33:28 AM~!~Weather Debug~!~771 802 836 858
                    10/02/02 10:33:28 AM~!~Weather Debug~!~874 893 910
                    10/02/02 10:33:28 AM~!~Weather Debug~!~0 0 923 937
                    10/02/02 10:33:28 AM~!~Weather Debug~!~983
                    10/02/02 10:33:28 AM~!~Weather Debug~!~ Yesterday 983 997 1027 1057 1086
                    10/02/02 10:33:28 AM~!~Weather Debug~!~ Normals 1086 1097 1126 1156 1183
                    10/02/02 10:33:28 AM~!~Info~!~ Script Error, File: Canada_Weather.txt: 5:Invalid procedure call or argument: 'Instr' in line 404

                    When I try it for Calgary, it does work correctly. Any ideas on what's going on?

                    Thanks
                    Al
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #11
                      Hi Paul,

                      Attached is a zip file that contains the Environment Canada icons with a transparent background. Also, would it be possible to create a "border" variable for all the images? I normally like to set the border to "0" so that images with a hyperlink don't have a colored border.

                      Thanks
                      Al
                      Attached Files
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #12
                        <BLOCKQUOTE><font size="-1">quote:</font><HR>Originally posted by Sparkman:
                        Hi Paul,

                        Just trying out your script. I've changed the location variables to the following:

                        Const LOCATION = "Fort McMurray"
                        Const LOCATION_CODE = "ymm"
                        Const FORECAST_START_STRING_TAG = "Fort McMurray:"
                        <HR></BLOCKQUOTE>

                        Al,

                        Your FORECAST_START_STRING_TAG for Fort Mc. is wrong. It should read ""Fort McMurray including Fort Mackay highway 63:". I'll try and beef up the explanation on how to correctly extract this info.

                        Paul

                        Comment


                          #13
                          <BLOCKQUOTE><font size="-1">quote:</font><HR>Originally posted by Sparkman:
                          Hi Paul,

                          Attached is a zip file that contains the Environment Canada icons with a transparent background. Also, would it be possible to create a "border" variable for all the images? I normally like to set the border to "0" so that images with a hyperlink don't have a colored border.

                          Thanks
                          Al<HR></BLOCKQUOTE>

                          Thanks for the updated icons Al! I'll pack these in with the next release. I'll also add a BORDER config. item to the script.

                          Cheers,
                          Paul

                          Comment


                            #14
                            <BLOCKQUOTE><font size="-1">quote:</font><HR>Originally posted by dpriest:
                            Paul,

                            Great script!

                            If I may be so bold, a couple of suggestions ...

                            1. A comment in your header that temperature icons go in a sub-directory. I got caught when I simply dragged the icons from the zip folder.

                            2. A bit of debug code to catch if people set their city wrong or Environment Canada changes it. I added the following around line 404:

                            [b]
                            if iForecast_Start_Position = 0 then
                            hs.writelog "Error","Canada_Weather.txt forecast missing. Verify FORECAST_START_STRING_TAG & LOCATION_CODE"
                            exit sub
                            end if
                            [\b]

                            Once again, thanks for the great script. You've obviously put a lot of work into this.

                            dp<HR></BLOCKQUOTE>

                            Thanks for the feedback dp.

                            That's a great idea as right now the only issue most people are having is with getting their FORECAST_START_STRING_TAG correct (See Al's Fort Mac. post above).

                            It'll be in the next rev, and I've already changed the comment about the temp icon install location.

                            Cheers,
                            Paul

                            After some investigation, I've added an exception handler to expand on dp's idea. Since there are situations were a valid LOCATION_CODE and START_TAG can give a iForecast_Start_Position of 0 this should work well (I hope . [img]/infopop/emoticons/icon_wink.gif[/img] ).

                            Paul

                            [This message was edited by paulrimmer on Sunday, 10 February 2002 at 04:50 PM.]

                            Comment


                              #15
                              <BLOCKQUOTE><font size="-1">quote:</font><HR>Originally posted by paulrimmer:
                              Al,

                              Your FORECAST_START_STRING_TAG for Fort Mc. is wrong. It should read ""Fort McMurray including Fort Mackay highway 63:". I'll try and beef up the explanation on how to correctly extract this info.

                              Paul<HR></BLOCKQUOTE>

                              Hi Paul,

                              That did the trick! Thanks for a great script!

                              Cheers
                              Al
                              HS 4.2.8.0: 2134 Devices 1252 Events
                              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                              Comment

                              Working...
                              X