Announcement

Collapse
No announcement yet.

Environment Canada Weather/Weather Warnings

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

  • Originally posted by Dhuras View Post
    Thanks very much for this ... the code you provided basically works, however, I was getting an array out of bounds for this statement:

    WindSpeed = WindArr(1)

    when, I changed it to WindArr(0), I end up with the windspeed in MyWindDevice

    ...seems strange to me as I thought the directional would be (0)...
    I've just been doing a little work on the EnvCan Script to accommodate some functionality I need for HSTouch.

    The Wind Speed value, it seems, should have been available in the Device Value all along. I've fixed this.

    I'll want to test everything with real data before I post an update. It shouldn't be long.
    Last edited by Wadenut; November 13th, 2017, 12:28 PM.
    Real courage is not securing your Wi-Fi network.

    Comment


    • Hi Wadenut,

      Does this scripts works in linux ? I'm running Debian with mono 5.0.1.1
      AMD 2700x 16gb - Ubuntu 18.10 Server -
      • HS3 Pro 3.0.0.507
        AirplaySpeak - APCUPSD - Big5 - BLGData - CPS Links - CPS Tags - DeviceHistory - EasyTrigger - JowiHue - Kodi - LutronCaseta - McsMQTT - MediaController - MeiHarmonyHub - PHLocation2 - Pushover - SceneMaster - SqueezeBox - UltraLog3 - Z-Wave - Jon00 stuff - HTTP calls
      • Openhab 2.5 Milestone 1 AmazonEchoControl - Plex - SystemInfo
      • Home Assistant 0.87 Plex - Roku
      • Node-red 19.5
      • Deconz 2.05.59
      • Logitech Media Server 7.9.2
      • Plex Server

      Comment


      • That would be up to Homeseer itself. The script is written in Visual Basic, but I don't remember using any functions specific to Windows. I don't use Linux myself, so there won't be a version written specifically for that OS.
        Real courage is not securing your Wi-Fi network.

        Comment


        • Just an FYI. The script is currently broken as of sometime around 2PM EST yesterday. The Atom feed which is the data source has disappeared from the EC site, apparently all across the country. Hoping it's temporary.
          Real courage is not securing your Wi-Fi network.

          Comment


          • V2.07.12 updates for Security Protocol changes on the Environment Canada Weather Site

            Both HS2 and HS3 versions are included in the archive. Simply rename the appropriate version to "Environment Canada Weather.vben" and replace the existing copy in your scripts directory.

            At this point, the Warnings/Statements section has not been tested thoroughly, but I don't expect any issues with it.

            You will need to have Net 4.6 installed on your system.

            <Attachment removed>
            Real courage is not securing your Wi-Fi network.

            Comment


            • Greg,

              I have 4.6 installed on my Windows 2016 server, but get this in the log.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Unused local variable: 'Ex'.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Unused local variable: 'objCAPIControl'.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Unused local variable: 'DvRef'.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Variable 'OutString' is used before it has been assigned a value. A null reference exception could result at runtime.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Function 'SearchArray' doesn't return a value on all code paths. Are you missing a 'Return' statement?
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Variable 'WeatherStatementText' is used before it has been assigned a value. A null reference exception could result at runtime.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Namespace or type specified in the Imports 'System.ServiceModel.Web.dll' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Namespace or type 'System.Xml' has already been imported.
              Dec-08 8:48:48 PM Error Compiling script C:\Program Files (x86)\HomeSeer HS3\scripts\Environment Canada Weather.vben: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
              I just replaced the file and renamed it to Environment Canada Weather.vben

              Robert
              HS3PRO 3.0.0.435 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, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dot, WS+, WD+ ... on and on.

              Comment


              • Quite a laundry list. I don't see any of this for some reason. I suspect it's HS3? I'll have to fire that up to deal with it. Some, I think I can explain and I'll look at when there's a bit of time; others, not so much as only one line was added to reference the new security protocol.. These errors don't appear to have anything to do with that. I'll likely be using you as a guinea pig to track them down.
                Real courage is not securing your Wi-Fi network.

                Comment


                • Here. attached, is the repaired HS3 file, along with the HS2 version. Same instruction as above.
                  EDIT: The Updated file has been moved to the Scripts library.
                  Real courage is not securing your Wi-Fi network.

                  Comment


                  • Great Greg! Thanks for this. Works perfectly again!

                    Much appreciated

                    Robert
                    HS3PRO 3.0.0.435 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, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dot, WS+, WD+ ... on and on.

                    Comment


                    • Thanks for the verification Robert. I'll put together the entire package and upload the update to the library soon.
                      Real courage is not securing your Wi-Fi network.

                      Comment


                      • The package has been updated to handle the updated encryption on the Environment Canada Website.
                        Version 2.07.13 for both HS2 and HS3.

                        It will be necessary to replace both the script and configuration files. Be sure to edit EnvCanWeather.ini according to your needs before running the updated script.
                        Real courage is not securing your Wi-Fi network.

                        Comment


                        • Seeing this error in my log:
                          eb-08 2:27:01 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/Environment Canada Weather.vben
                          Feb-08 2:27:01 PM EnvCanWeather Error in Environment Canada XML data, Block ADV5 - Overload resolution failed because no accessible 'SendEmail' accepts this number of arguments.
                          Feb-08 2:27:01 PM EnvCanWeather Data save triggered: ADV5
                          Feb-08 2:27:01 PM EnvCanWeather An error has occurred in evaluating the XML data. Check the source URL or file.
                          Feb-08 2:27:01 PM EnvCanWeather Source data has been saved as: C:\Program Files (x86)\HomeSeer HS3\Data\EnvCanXML\Halton Hills - Weather - Environment Canada on-68 V2.07.13 Block ADV5 Date 201902081427PM.xml
                          any help appreciated, Thanks.

                          Comment


                          • There seems to be an issue, at least in HS3, with the email function. For now, I'd suggest turning this function off in your EnvCanWeather.ini config file, Under OPTIONS, "EmailOnAlert = " (Nothing as this would be the send to address). If it's currently blank or setting this to nothing doesn't fix this problem for you, it means HST has made some changes recently that I'm not aware of, and I may need to remove the function for the time being (Please let me know).
                            I'm busy with another project at the moment, so I'll have a look at this as soon as I have the opportunity. In any case, this really shouldn't be causing a general failure, so I'll deal with that as well. Sorry for the inconvenience.

                            Edit: And having a quick look at the settings.ini files for HS2 and HS3, I do see some differences I'll need to account for. I doubt anyone had used this function in the script until now, explaining why this had never come up until now.
                            Real courage is not securing your Wi-Fi network.

                            Comment


                            • OK, I had an hour to spare and had a look.
                              Bottom line is, the HS3 documentation clearly states that the Attachment parameter in the SendMail function is "Optional"; It quite definitely is not optional.

                              I believe I have this fixed for you but there are currently no warnings active in my area. I'll want to make sure this function does work properly before I post an update. It's winter, so I'm sure I won't need to wait long for some sort of Weather Statement to occur.
                              Real courage is not securing your Wi-Fi network.

                              Comment


                              • V2.07.14 Repairs the email function in HS3. Includes additional information on Weather Warnings/Statements in the email for both HS2 and HS3.
                                Environment Canada often updates Statements throughout the day without having modified the text. An email will be sent each time this occurs as well as when a Statement/Warning ends.
                                Real courage is not securing your Wi-Fi network.

                                Comment

                                Working...
                                X