Author Topic: WeatherCat Scripts *BETA* of 2012-04-26  (Read 11849 times)

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
WeatherCat Scripts *BETA* of 2012-04-26
« on: April 26, 2012, 10:59:44 PM »
Dear WeatherCat AppleScript fans,

Randall bravely became the second guinea pig to install the "WeatherCat-ized" versions of my AppleScripts.  He was able to make them work without too much pain, so the time has come to let them loose upon you'all.  Now they work fine in three places but they are still *BETA* - don't get confused by how well Stu manages to keep bugs away from us.  I try really hard but am not nearly as well equipped to hunt bugs.

The collection has a new (admittedly uninspired) name of WeatherCat Scripts.  You can download the collection here:

http://www.canebas.org/WeatherCat/AppleScripts/WeatherCat%20Scripts%202012-04-26.zip

There are functionally the same but you will immediately notice some big changes. 

First, everything is stored in one large and busy folder.  The advantage of this is now they can be placed anywhere on your hard drive - even in your Applications folder.  I have been using the ~/Applications folder (i.e. the one inside your home folder) simply because it is less crowded and somehow scripts don't feel "lofty" enough to me to be in the main Applications folder.  However, there is a cost to this - the arrangement inside this folder must be left alone.  The scripts rely on finding things within the WeatherCat Scripts folder as they are presently arranged.  So don't rearrange stuff inside the WeatherCat Scripts folder.

Second, each script now as a separate preference file.  These are mini AppleScript files that the main scripts load to get their settings.  They are stored in: 

WeatherCat Scripts/WeatherCat Script Library/WeatherCat Script Prefs

The format is slightly different, so look at the Quickstart file for details.  So to use these new scripts, you'll need to transfer your setting that were inside of the the old LWC AppleScript Applications into these AppleScript preference files.  There are two big advantages.  First, you don't have to worry about every fussing with saving Applications that was such a pain.  Second, you won't ever have to copy the preferences over for an upgrade.  To upgrade, simply replace the AppleScript Application file with the newer one.  It will read the same preferences file.  So this is the last time of cuttin' 'n' pastin' settings to upgrade.  These AppleScript applications should run as is on anyone's system.  Just launch them as you would launch any Mac Application.

Third, every script that has some sort of state to save, saves that data in a separate file.  So from now on, you won't lose any data by upgrading, restarting, rebooting or any sort of crash (sort of a hard drive crash.)  Most scripts save periodically with a minimum save period of 10 minutes and some as frequently as every minute.

Four, you'll see some significant improvements.  It is now possible to use the venerable command-line browser lynx instead of curl to submit data to UK Met Office WoW, PWS-Weather, and WeatherBug.  This allows for shorter and clearer error messages.  There is now a separate configuration file to handle all emailing for the scripts that use email.  In addition to using OS-X's Mail.app, you can use the included MtcMail to avoid having to run Mail all the time.  WC Storm Monitor now keeps track of local barometric pressure maximums and minimums.  WC ET Reporter will generate a spreadsheet import file of soil moisture and temperature data (if you are lucky enough to have a station with those sensors.)  Some of the psuedo web tags have changed.  There are some test programs for email and Twitter uploads.  Make sure to go through the Quickstart documentation to see all the details.

Oh, inside the busy WeatherCat Scripts folder is a folder called:

Documentation

I think you can guess what you'll find there!!  ;D
and a folder called:

Support tools and templates

That has for the moment the web templates associated with WC Zambretti Forecaster and WC Status Growler.

So, AppleScript fans, take a look and see if you can get these new and improved AppleScripts to behave on your system!   [computer]

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #1 on: April 26, 2012, 11:52:26 PM »
Thank you very much, Edouard!

I've been using all of these scripts for about a month now without any problems at all. I've had a few system crashes due to power outages, and the scripts didn't have any problems handling them.

John, here's what you need to get those pages up and running we were PMing about!

Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

jace

  • Storm
  • *****
  • Posts: 812
    • DW9675
    • ISuffolk62
    • Yoxford weather site.
  • Station Details: Davis Vantage Pro2, with Mac USB Data Logger. 2.4 GHz Intel Core 2 Duo MacBook, with 8 GB 1033 MHz DDR3 Memory, running Mac OSX Version 10.10.1 (Yosimite).
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #2 on: April 27, 2012, 02:43:31 PM »
Hi Edouard

Many thanks for all your hard work on these,  [cheers1] but don't go to sleep yet, I've got to try and get a couple of the scripts working yet !  [computer] [lol2]

Can I just say, in the documentation for the web uploader there is this instruction: The logical variable MetricUnits enables conversions from metric to inches which are expected in the upload format for all three services. This preference is not in the script.

I've got messages that growler and web data uploader have started over 30 minutes ago but nought else, so as usual I've probably broken something already :)  [lol2]

JC

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Oops!! It is a feature through! (Re: WeatherCat Scripts *BETA*)
« Reply #3 on: April 27, 2012, 07:41:13 PM »
Hi JC and WeatherCat AppleScript fans,  [cat]

Many thanks for all your hard work on these,  [cheers1] but don't go to sleep yet, I've got to try and get a couple of the scripts working yet !  [computer]

Glad you were able to get them working!!  [tup]

Can I just say, in the documentation for the web uploader there is this instruction: The logical variable MetricUnits enables conversions from metric to inches which are expected in the upload format for all three services. This preference is not in the script.

I'm afraid the documentation will be the weakest link in the package.  I revised things very quickly and as you'all know . . . they are somewhat "ponderous."  [biggrin]

However, the error is strictly in the documentation.  Thanks to WeatherCat allowing me access to the data in metric format no matter what the user has selected, I don't need this setting anymore.  The script does the right thing no matter what your display units are.

This is one of the main reasons I gave up on trying to support LWC.  It is a small change, but it really simplified the scripts.

So expect a documentation update in the not too distant future!!

Glad nothing more serious has shown up so far!

Cheers, Edouard  [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Trick to stop one Growl notification (Re: WeatherCat Scripts)
« Reply #4 on: April 27, 2012, 10:32:52 PM »
Dear WeatherCat AppleScript fans,

Randall just send me an email with a question that might be interesting to you all so I'm going answer it here:

Quote
Is there any way to stop the FTP connection failed notification I get alot of these with my Satellite Internet in the old Status Growler I figured it out but didn't want try it on the new stuff didn't want to screw it up since I have it working now ot is there a way to have the stickies remove them self after so long of a period or set sticky to false

Anyone could get in a situation where one error becomes particularly annoying for some reason.  Fortunately, Growl is pretty sophisticated.  You can not only control which applications are allowed to send growls, but even which notifications are displayed.  In this case the annoying Growl notification is: "WC FTP Problem."  If you go to the Growl preference pane, you can select any application that uses growl and control its behavior by selecting the Applications tab at the top and scrolling down until you find the application you want to tweak.  Once you select the application there is a second tab in the middle that splits between Application Settings and Notifications (see example) below.  Select Notifications and then use the pop-up menu to see all the notifications associated the application.  In this case WC Status Growler has . . . . quite a few notifications!!  ;D

Find your way to the offending notification and then uncheck the Enabled button as shown below:



From now on (and until you check that box again) that notification will no longer be displayed. 

So if you are getting an annoying notification - here is your way to learn' the varmit!

Cheers, Edouard  [cheers1]

P.S. Alternatively, you could use this to make a "sticky" notification stop "sticking."  To check that, instead change the value for Stay on Screen to the value you prefer.

jace

  • Storm
  • *****
  • Posts: 812
    • DW9675
    • ISuffolk62
    • Yoxford weather site.
  • Station Details: Davis Vantage Pro2, with Mac USB Data Logger. 2.4 GHz Intel Core 2 Duo MacBook, with 8 GB 1033 MHz DDR3 Memory, running Mac OSX Version 10.10.1 (Yosimite).
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #5 on: April 28, 2012, 07:53:36 AM »
Hi Edouard,  [bounce]

Finally worked out what I did wrong with the station status script so it's working now. Also got PWS receiving data as well as WOW, I had misspelt the station name !  [banghead]. As far as I can tell, Growler, Tags processor, Zambretti and data uploader are running ok here.

[cheers1]

JC


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Glad to hear it!! (Re: WeatherCat Scripts *BETA*)
« Reply #6 on: April 28, 2012, 04:28:11 PM »
Hi JC and WeatherCat AppleScript adventurers . . .

Finally worked out what I did wrong with the station status script so it's working now. Also got PWS receiving data as well as WOW, I had misspelt the station name !  [banghead]. As far as I can tell, Growler, Tags processor, Zambretti and data uploader are running ok here.

Glad all is working for you!!  [bounce]

There is a bit sage computer wisdom in your predicament.  It is *so* easy to make a typo in anything that is text.  I learned a long time ago, from variable names to people's names - cut'n'paste is your friend.  Don't retype anything unless you absolutely have to!

Cheers, Edouard  [cheers1]

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Dear WeatherCat AppleScript explorers,

I've bellyached about California's drought too much as it is, but yesterday's Blaney-Criddle estimate of evapotranspiration was . . .  shall we say - excessive!!



However, the calculation's seem correct.  The only problem is that my temperature probe seems to have made a quick visit to . . . the edge of the sun or something.  The high temperature used in the calculation was over 1000˚ C!!  :o

This morning things were better . . . only 267˚ C!!  I manually corrected the data in the files that store these values and so far everything looks okay.  However, a careful examination of the code and . . . . sure beats me.  The temperature comes from WeatherCat and is not transformed at all.  The high and low values are replaced when current temperature exceeds either previous extreme.  So I'm rather stumped here.

Could folks running WC ET Reporter let me know if they see anything like this?  Definitely need a little more data to understand what is happening here.

Thanks!

Cheers, Edouard  [cheers1]

Randall75

  • Storm
  • *****
  • Posts: 1332
  • CWOP-CW6734 WeatherUnderground-KOHNEWAR6
    • CW6734
    • KOHNEWAR6
    • Randy's Weather On The Hill
  • Station Details: Davis Vantage Pro 2 Plus.iMac i5 OS High Sierra 10.13.6 8GB Ram, WeatherCat 3,Logitech 9000 Pro Web Cam
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #8 on: April 28, 2012, 05:26:43 PM »
Hi Edouard
Just those gremlins playing in your weather station again  [biggrin]


 [cheers1]


All is working great here [tup]


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Need some gremlin repellant!! (Re: WeatherCat Scripts *BETA*)
« Reply #9 on: April 28, 2012, 07:42:42 PM »
Hi Randall and WeatherCat fans,

Just those gremlins playing in your weather station again  [biggrin]

I dunno' . . . . you just might be right!

Anybody got a good recommendation for gremlin repellant?
  [lol2]

All is working great here [tup]

I've only see this twice.  The first time I was fussing with the scripts so much that I figured it had to be that.  However, this time I wasn't messin' with them at all - honest!

Just to be safe, I've added a test for unreasonable temperatures and will log them.  I wonder if there could be "hiccup" in the AppleScript interface somehow.  The trouble is that if an unreasonable value ever is registered for high or low, it will definitely ruin that day's calculations.

Oh well, I'll keep an eye out for them gremlins!!

Cheers, Edouard  [cheers1]


elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
divide by 0 bug and progess report (Re: WeatherCat Scripts *BETA*)
« Reply #10 on: April 29, 2012, 09:29:09 PM »
Dear WeatherCat AppleScript fans,

Randall was "victimized" by a divide by 0 error in WC Storm Monitor.  I think the problem was caused by some older code before I swallowed my pride and implemented a signum function that AppleScript lacks. ::)  I've got the fix running now and would like to give it some time to run before releasing it.

If any of you are also victimized in this way, here it the way to get the script running again.  If it hasn't quit all by itself, make sure to quit first (force-quit if necessary.)  Next you need to "erase" any memory the script has so the error won't come back.  You can do this by deleting the file: Storm Monitor State Data.txt.  You can find it the following spot starting from WeatherCat Scripts folder.

WeatherCat Scripts/WeatherCat Script Library/WeatherCat Script Data Backups/Storm Monitor State Data.txt

Once you've deleted that file, you can start up WC Storm Monitor again.  Odds of it happening seem quite low since it never happened to me.  So it should be okay to run the script in its broken state until I issue an update which I hope to do soon.

I've fixed some of the documentation bugaboos that JC spotted.  I've got the check so that WC ET Reporter won't compute evapotranspiration for the solar corona anymore.  I finally sat down and wrote two AppleScripts to start and stop the collection.  I was wrong, it only took about 15 minutes!!  ::)

However, I've got to create some more documentation . . .  ??? and a few other things.  So it will be a couple days before the next revision becomes available for you'all to play with.

Cheers, Edouard  [cheers1]

jace

  • Storm
  • *****
  • Posts: 812
    • DW9675
    • ISuffolk62
    • Yoxford weather site.
  • Station Details: Davis Vantage Pro2, with Mac USB Data Logger. 2.4 GHz Intel Core 2 Duo MacBook, with 8 GB 1033 MHz DDR3 Memory, running Mac OSX Version 10.10.1 (Yosimite).
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #11 on: April 30, 2012, 08:34:07 AM »
Thanks for that Edouard, it shut down at midnight my time, came down to the computer to find many many Growl alerts filling the screen  [interesting]

 [cheers1]

JC

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
I'll try to get that revision out soon. (Re: WeatherCat Scripts *BETA*)
« Reply #12 on: April 30, 2012, 07:56:13 PM »
Hi JC and WeatherCat fans,

Thanks for that Edouard, it shut down at midnight my time, came down to the computer to find many many Growl alerts filling the screen  [interesting]

Sorry, it's been a busy day thus far.  Hopefully things will quiet down a bit and I'll be able finish up that revision soon.

Cheers, Edouard  [cheers1]

Steve

  • Global Moderator
  • Storm
  • *****
  • Posts: 1555
    • DW8454
    • KOHAVON11
    • Avon Weather
  • Station Details: Davis Wireless VP2 Plus w/24 hr FARS, Leaf & Soil Station, 2023 Mac mini M2 Pro, 32GB RAM, Mac OS 14, WeatherCat 3.2
Re: WeatherCat Scripts *BETA* of 2012-04-26
« Reply #13 on: May 07, 2012, 03:07:07 PM »
Edouard,

After much delay, I am up to date with the latest released AppleScripts. All are working great, and I've added the start/stop scripts to WeatherCat and removed the individual scripts from DelayedLauncher.

Thanks,
Steve
Steve - Avon, Ohio, USA


CWOP: DW8454 - WU: KOHAVON11 - AWEKAS - CoCoRaHS
PWSweather - WeatherCloud - Twitter - Facebook

elagache

  • Global Moderator
  • Storm
  • *****
  • Posts: 6494
    • DW3835
    • KCAORIND10
    • Canebas Weather
  • Station Details: Davis Vantage Pro-2, Mac mini (2018), macOS 10.14.3, WeatherCat 3
Good to hear (Re: WeatherCat Scripts 2012-04-26)
« Reply #14 on: May 07, 2012, 10:18:34 PM »
Howdy Steve and WeatherCat fans,

After much delay, I am up to date with the latest released AppleScripts. All are working great, and I've added the start/stop scripts to WeatherCat and removed the individual scripts from DelayedLauncher.

Glad to hear it!  Everything has been working fine for me.  Now I just need to find the time to make the changes so that they will work properly with Growl 1.3 . . . .  [banghead]

Oh well, grin and bear it time . . . .

Cheers, Edouard