Announcement

Collapse
No announcement yet.

Canadian Weather Script Discussion

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

    #16
    Hi Paul,

    One more suggestion [img]/infopop/emoticons/icon_wink.gif[/img]

    Would it be possible to separate the actual condition/icon and the "Current Weather in Some City: Observed on: Feb. 10, 2002 at 18:00 UTC" portion into separate HomeSeer devices?

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

    Comment


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

      One more suggestion [img]/infopop/emoticons/icon_wink.gif[/img]

      Would it be possible to separate the actual condition/icon and the "Current Weather in Some City: Observed on: Feb. 10, 2002 at 18:00 UTC" portion into separate HomeSeer devices?

      Thanks
      Al<HR></BLOCKQUOTE>

      I'm not 100% sure I follow you Al. Are you asking to have the update_time and current_weather split into seperate devices? If so, then no problem. If not, I'm confused [img]/infopop/emoticons/icon_confused.gif[/img].

      Some other things I am thinking about adding:

      - Definitely doing a fire_once subroutine that will be called when weather warnings are first detected so people can easily add custom stuff (email, beeper, light flashing etc.).
      - Maybe implementing Rising and Falling pressure by tracking it with script. Issues with damping minor oscillations in pressure readings here.

      I'm reinstalling win2k on my main machine today (thanks to an HP scanner that is giving me grief) so the updates might not be today.

      Paul

      Comment


        #18
        Hi Paul,

        That's what I meant.

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

        Comment


          #19
          I just uploaded version 1.5 with the following changes:

          Added comment on icon installation path.
          Beefed up explanation of FORECAST START STRING TAG determination,
          Added error handling mechanism and description to header comments,
          Added BORDER config. parameter to enable/disable icon borders,
          Adapted warning logic to Env. Canada changes,
          Split up "Current Weather" and "Weather Last Observed" items,
          Cleaned up the icon link logic for no icons.

          You can find it in the usual place (see above).

          I broke one of my work rules today: "Never do a SW release when you don't have to and especialy when you are tired". Let's see how it goes. I tested all of the sample locations but I'm so bagged I may have missed something. Hence the "sleepy" moniker for this release.

          For a nap I go now so I have a chance of keeping my eyes open through my indoor soccer game tonight. It's going to be great day at work tomorrow [img]/infopop/emoticons/icon_wink.gif[/img] .

          Cheers,
          Paul

          Comment


            #20
            Hi Paul,

            Works great!!! Thanks for soing those updates.

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

            Comment


              #21
              Here's an email response I just received from Env. Canada in response to some weirdness I'd noticed (only took them a month to reply). If any of you see this, try and get a screenshot or a snapshot of the page's source and send it to the guy below (or send it to me if you don't want to deal with the Gov't ;-) and I'll pass it on).

              The script handles the bug in the algorithm of whether to display the windchill/dewpoint or humidex but not the issue of the weird windchill display format.

              Cheers,
              Paul

              Dear Paul Rimmer:

              This is in reply to your query to Environment Canada's Internet site for
              weather information.

              I had never realized that before, but when the wind chill (or the humidex)
              appears, the dew point disappears because there is only room for six fields
              in the current observations. This is why dew point was not longer available.
              You can still see the dew point by clicking on the Past 24 hours button,
              though.

              I do note another problem in the observation you sent: there should be only
              one value for wind chill (the one without a degree), not two as you have in
              the copy you include (-8 is the correct value for this wind and
              temperature). I have never been able to see this phenomenon myself (even
              though it's been reported several times), which makes it hard for me to
              investigate how it could have happened. Moreover, wind chill in this case
              should not even have been included due to the low wind speed value. We'll
              have to take a second look at the computer code to ensure this happens.

              If you see this again, I would appreciate a screen copy, if possible. I'd
              like to know if there's at all a pattern for this problem.

              Thank you for visiting Environment Canada's Internet site for weather and
              related services.

              Pierre Tourigny
              Service météorologique du Canada /
              Meteorological Service of Canada
              Environment Canada / Environnement Canada
              4905 Dufferin Street
              Toronto ON M3H 5T4
              Tél. (416) 739-4973; fax/télec (416) 739-4967
              e-mail / courriel : Pierre.Tourigny@ec.gc.ca

              -----Original Message-----
              To: meteo@ec.gc.ca
              From: Paul Rimmer &lt;paul.rimmer@shaw.spamoff.ca&gt;
              Subject: Tech.Natl
              On Thu Jan 24 18:12:27 2002,
              The following information was submitted:
              By: Paul Rimmer
              Browser Info: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461)
              Referring Document:

              Comments: There appears to be a problem with the Windchill/Dewpoint/Humidex
              field. Right now for Prince George it is displaying:

              Prince George

              Currently

              Observed on: Jan. 25, 2002 at 01:00 UTC.

              Mainly Clear
              Temp.: -5°C
              Pressure: 100.4 kPa
              Visibility: 24 km
              Humidity: 75%
              WindChill: -6°C (-8)
              Wind: S 7 km/h

              A temp of -5 and a wind speed of 7km/h should result in a dewpoint being
              displayed right?

              That is based on the following from the FAQ:

              Q. Why is wind chill not always indicated in the current conditions or in
              the forecast?
              A. Wind chill is indicated in current conditions only when the temperature
              is 0°C or lower, with a wind speed greater than 10 km/h.

              Also, the windchill is displaying weird (compared to normal). For a
              windchill of -7 it would normally show:

              Windchill: -7

              Currently it is showing:

              WindChill: -6°C (-8)

              This goes against the following FAQ entry:

              Q. You don't add a degree sign (or any other unit) after the number used
              for wind chill or for the humidex. Why is that?
              A. This is because the wind chill and the humidex are indices and not
              physical quantities.

              I browsed around and it appears many cities have this problem. I noticed as
              I have a VB script that parses the Env. Canada website for my local weather
              and have it spoken to me when I get up in the morning.

              Thanks for the great service!

              Cheers,

              Paul

              Comment


                #22
                Whoops. Just noticed I'd messed up the icons in the version 1.4 and 1.5 zip files. That's what I get for having the same name. For example 16.gif is the name of the temp icon at 16 deg C as well as the cloudy icon. Both 16.gif's in the zip file were actually the temp icon.

                I re-uploaded version 1.5 with the correct icons.

                Paul

                Comment


                  #23
                  Paul:
                  I downloaded your Canadian weather and it worked great the first time. A fantastic piece of work.
                  I wish I would have the same luck in coordinating my bathroom motion detector in maintaining a dim command while Jacuzzi is occupied. Could you help me with this.

                  Just for trivia I live in Medicine Hat. email is gerric@monarch.net

                  Comment


                    #24
                    I loaded the Weather script (thanks - I am really looking forward to having it work)

                    but, I am having some problems. Simple ones I hope!

                    1) how do you get it to do a city other than Calgary? Where do you input the city you want to use?

                    2) my web will display the info, but how do you get it to 'speak'?

                    thanks

                    Comment


                      #25
                      Jeff,

                      The short answer is to open up the script file and read the header at the top of the file. It contains detailed instructions on configuring and using the script. I've included the relevant sections below but recommend you read the "manual" at the top of the script.

                      Cheers,
                      Paul

                      To set the location to other than Calgary:

                      USER CONFIGURATION STEPS:

                      Place Canada_Weather.txt in Homeseer scripts directory and all images in either
                      \html\envcanadaicons or \html\envcanadaicons\temp directories (look at zip paths
                      to see which are which) under Homeseer directory (zip includes default file
                      locations).

                      Your location must be supported by Env. Canada. Start here to determine your
                      locations info: http://weatheroffice.ec.gc.ca/canada_e.html. When you get to
                      the webpage for your location record the last 3 characters of the URL. For
                      example Calgary's location webpage is:

                      http://www.weatheroffice.ec.gc.ca/sc...CDN_e&city=YYC

                      LOCATION
                      Name of place to be spoken and displayed by Homeseer (need not match Env
                      Canada webpage, ex: "Calgary").

                      LOCATION CODE
                      last 3 chars. of URL (for Calgary example above would be "YYC")

                      FORECAST START STRING TAG
                      This tells the script what string on the webpage delineates the start of the
                      locations weather forecast. Look at the line below the "Text Forecast" heading
                      and copy from the start of the line up to and including the semicolon. For the
                      Calgary webpage example, the tag is "City of Calgary:".

                      Examples for the above 3 user configuration constants are provided below.

                      '*********************************************************** ***********************************
                      '*
                      '* Start of Configuration Variables: User must verify these. Some examples provided.
                      '*
                      '* Go here and zoom in to get your location code and forecast start string tag:
                      '* http://weatheroffice.ec.gc.ca/canada_e.html
                      '*
                      '*********************************************************** ***********************************

                      'Const LOCATION = "Nanaimo"
                      'Const LOCATION_CODE = "ycd"
                      'Const FORECAST_START_STRING_TAG = "East Vancouver Island:"

                      'Const LOCATION = "Creston"
                      'Const LOCATION_CODE = "wjr"
                      'Const FORECAST_START_STRING_TAG = "Kootenay Lake:"

                      'Const LOCATION = "Banff"
                      'Const LOCATION_CODE = "wzg"
                      'Const FORECAST_START_STRING_TAG = "Banff National Park:"

                      'Const LOCATION = "Waterton Park"
                      'Const LOCATION_CODE = "wgm"
                      'Const FORECAST_START_STRING_TAG = "Crowsnest including Pincher Creek Claresholm Waterton:"

                      Const LOCATION = "Calgary"
                      Const LOCATION_CODE = "yyc"
                      Const FORECAST_START_STRING_TAG = "City of Calgary:"

                      'Const LOCATION = "Fort McMurray"
                      'Const LOCATION_CODE = "ymm"
                      'Const FORECAST_START_STRING_TAG = "Fort McMurray including Fort Mackay highway 63:"

                      'Const LOCATION = "Regina"
                      'Const LOCATION_CODE = "yqr"
                      'Const FORECAST_START_STRING_TAG = "City of Regina:"

                      'Const LOCATION = "Brochet"
                      'Const LOCATION_CODE = "ybt"
                      'Const FORECAST_START_STRING_TAG = "Town of Brochet:"

                      'Const LOCATION = "Mississauga"
                      'Const LOCATION_CODE = "ON-24"
                      'Const FORECAST_START_STRING_TAG = "Halton Peel:"

                      'Const LOCATION = "Toronto"
                      'Const LOCATION_CODE = "yyz"
                      'Const FORECAST_START_STRING_TAG = "Toronto:"

                      'Const LOCATION = "St John's"
                      'Const LOCATION_CODE = "yyt"
                      'Const FORECAST_START_STRING_TAG = "St Johns:"

                      To make it speak:

                      SPEAK
                      If the user wishes to have the script speak the weather every time it runs, set
                      this value to TRUE otherwise leave it as FALSE.

                      USAGE FROM EXTERNAL SCRIPTS:

                      All weather variables are stored as Global Vars. They are referenced by the
                      weather house code (default "w") and units 1 - 15. Individual "Speak_"
                      subroutines are provided to speak every weather variable (normals and yesterday
                      are gouped in 1 subroutine each). For example lets say you want an event to
                      speak just the Forecast, the following script would suffice:

                      #include Canada_Weather.txt

                      Sub Main()

                      Call Speak_Forecast()

                      End Sub

                      Available routines are: Speak_Current
                      Speak_Temperature
                      Speak_Pressure
                      Speak_Wind
                      Speak_Humidity
                      Speak_Visibility
                      Speak_Variable
                      Speak_Normals
                      Speak_Yesterday
                      Speak_Forecast
                      Speak_Warning
                      Speak_All

                      Speak_Variable speaks either the Windchill, Dewpoint or Humidex depending on
                      which is available.

                      Comment


                        #26
                        I tried emailing this to you directly but the last email address I had of yours was no good.

                        These script additions will return the 5 day forecast as displayed on the web page with the icons as follows:



                        Here are the additions:

                        ______________________________
                        CyberA

                        HAM - Home Automation Messenger

                        Comment


                          #27
                          Thanks Alain,

                          I'll put this in a new release.

                          Paul

                          Comment


                            #28
                            I found my problem!....I didn't notice the comment tag at the front of the line I was expecting to execute!....boy - feel stupid!

                            thanks for your help!

                            Comment


                              #29
                              Here's my log with Debug on.

                              29/03/2002 9:53:23 PM~!~Event Trigger~!~Trigger from menu (Canadian Weather)
                              29/03/2002 9:53:23 PM~!~Weather Debug~!~Retrieving weather from environment Canada for Calgary from http//www.weatheroffice.ec.gc.ca/scripts/citygen.pl?client=ECCDN_e&city=yyc
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current 0
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~ Yesterday
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~ Normals
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~ Forecast 0
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Weather Warning
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Weather Update Time
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: Length: 5
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Weather
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 8 Length: -8
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Temperature
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 6 Length: -6
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Pressure
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Visibility
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 11 Length: -11
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Wind
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 5 Length: -5
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Variable Weather Item Not Available
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Current Humidity
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Yesterday High
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Yesterday Low
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Yesterday Precip
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 13 Length: -13
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Normal High
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Normal Low
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 9 Length: -9
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Normal Mean
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 10 Length: -10
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Forecast
                              29/03/2002 9:53:43 PM~!~Weather Debug~!~Position: 4 Length: -4
                              29/03/2002 9:53:43 PM~!~WEATHER DEBUG~!~ERROR: 5 Microsoft VBScript runtime error Invalid procedure call or argument
                              29/03/2002 9:53:43 PM~!~WEATHER DEBUG~!~Check the following for correctness:
                              29/03/2002 9:53:43 PM~!~WEATHER DEBUG~!~Location Start Tag: City of Calgary:
                              29/03/2002 9:53:43 PM~!~WEATHER DEBUG~!~Location Code: yyc
                              29/03/2002 9:53:43 PM~!~WEATHER DEBUG~!~Web Page Contents:

                              Comment


                                #30
                                [QUOTE]Originally posted by Neil Hansen:
                                Here's my log with Debug on.

                                29/03/2002 9:53:23 PM~!~Event Trigger~!~Trigger from menu (Canadian Weather)
                                29/03/2002 9:53:23 PM~!~Weather Debug~!~Retrieving weather from environment Canada for Calgary from http//www.weatheroffice.ec.gc.ca/scripts/citygen.pl?client=ECCDN_e&city=yyc
                                &lt;SNIP&gt;

                                Neil,

                                Sorry about the delay I spent the long weekend in the Kootenay valley (near Creston, BC) building a deck at my folks place.

                                Are you still having this problem? I use Calgary and am having no issues. Occasionally Env. Canada has a snafu and the script will report errors. I've never seen them them last more than a couple of hours and I've boilerplated the script in a few spots to protect it from foobars.

                                Anyways, hopefully all is well for you now. Let me know if you are still having issues and we'll work through the config.

                                Cheers,
                                Paul

                                Comment

                                Working...
                                X