Applescript and WeatherCat

Posted on
Wed Dec 14, 2016 3:50 am
Matt offline
Posts: 406
Joined: Aug 13, 2006
Location: Northern Idaho

Applescript and WeatherCat

Does anyone have any scripts to move WeatherCat data over to Indigo vairiables?

I was using the following script, but I keep getting the "application is not running. 600" error.

Code: Select all
tell application "WeatherCat"
   set wnowInsideTemp to InternalTempDelta1
   set wnowOutsideTemp to ExternalTempDelta1Unconverted
   set wnowInsideHumidity to InternalRHDelta1
   set wnowOutsideHumidity to ExternalRHDelta1
   try
      set wnowRainToday to text 1 thru 4 of (PrecipitationDaily as text)
   on error
      set wnowRainToday to PrecipitationDaily
   end try
   try
      set wnowRainRate to text 1 thru 4 of (PrecipitationPerHourDelta1Unconverted as text)
   on error
      set wnowRainRate to PrecipitationPerHourDelta1Unconverted
   end try
   set wnowForecast to CurrentConditions
   set WorkingChannel to 58
   
   try
      set annualRain to text 1 thru 5 of ((WorkingChannelValue / 25.4) as text)
   on error
      set annualRain to WorkingChannelValue / 25.4
   end try
end tell

tell application "IndigoServer"
   --set value of variable "wnow_LastUpdate" to wnowTimeStamp
   set value of variable "LWC_GarageTemp" to wnowInsideTemp as integer
   set value of variable "LWC_OutsideTemp" to wnowOutsideTemp as integer
   set value of variable "LWC_GarageHumidity" to wnowInsideHumidity as integer
   set value of variable "LWC_OutsideHumidity" to wnowOutsideHumidity as integer
   set value of variable "LWC_RainToday" to wnowRainToday as real
   --set value of variable "LWC_Forecast_raw" to wnowForecast
   set value of variable "LWC_RainRate" to wnowRainRate as real
   set value of variable "LWC_AnnualRain" to annualRain as real
end tell

Image

Posted on
Wed Dec 14, 2016 9:52 am
automaton offline
Posts: 88
Joined: May 23, 2008

Re: Applescript and WeatherCat

I use an old indigo plugin called LWC (the old weathercat was lightfoot weather center "LWC"). I'm not sure is there are copies around anymore. Puts everything in Indigo variables automatically, and updates them on whatever frequency you would like.

Posted on
Wed Dec 14, 2016 10:29 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript and WeatherCat

Matt wrote:
I was using the following script, but I keep getting the "application is not running. 600" error.


viewtopic.php?f=4&t=12857

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Dec 19, 2016 4:26 am
Matt offline
Posts: 406
Joined: Aug 13, 2006
Location: Northern Idaho

Re: Applescript and WeatherCat

Thanks, Jay. I looked at that thread before I posted. Still no luck getting the script to run.

Image

Posted on
Mon Dec 19, 2016 7:43 am
Matt offline
Posts: 406
Joined: Aug 13, 2006
Location: Northern Idaho

Re: Applescript and WeatherCat

This is weird, but it fixed things. I had to set a variable to another variable before Indigo would recognize it. After that it began updating all the other variable.

Here's the new script (The change is underlined):

Code: Select all

tell application "WeatherCat"
   set wnowInsideTemp to InternalTemp
   set wnowOutsideTemp to ExternalTemp
   set wnowInsideHumidity to InternalRH
   set wnowOutsideHumidity to ExternalRH
   try
      set wnowRainToday to text 1 thru 4 of (PrecipitationDaily as text)
   on error
      set wnowRainToday to PrecipitationDaily
   end try
   try
      set wnowRainRate to text 1 thru 4 of (PrecipitationPerHour as text)
   on error
      set wnowRainRate to PrecipitationPerHour
   end try
   set wnowForecast to CurrentConditions
   set WorkingChannel to 58
   try
      set annualRain to text 1 thru 5 of ((WorkingChannelValue / 25.4) as text)
   on error
      set annualRain to WorkingChannelValue / 25.4
   end try
   
   using terms from application "IndigoServer"
      [size=150][u]set LWC_GarageTemp to round (wnowInsideTemp)[/u][/size]
      --set value of variable "LWC_GarageTemp" to LWC_GarageTemp
   end using terms from
end tell
tell application "IndigoServer"
   --set value of variable "wnow_LastUpdate" to wnowTimeStamp
   set value of variable "LWC_GarageTemp" to LWC_GarageTemp
   set value of variable "LWC_OutsideTemp" to wnowOutsideTemp as integer
   set value of variable "LWC_GarageHumidity" to wnowInsideHumidity as integer
   set value of variable "LWC_OutsideHumidity" to wnowOutsideHumidity as integer
   set value of variable "LWC_RainToday" to wnowRainToday as real
   set value of variable "LWC_Forecast_raw" to wnowForecast
   set value of variable "LWC_RainRate" to wnowRainRate as real
   set value of variable "LWC_AnnualRain" to annualRain as real
end tell

Image

Posted on
Sun Aug 12, 2018 7:34 am
RWBUMP offline
Posts: 5
Joined: Jun 25, 2016

Re: Applescript and WeatherCat

I use the WeatherCat plugin from GitHub. It was written for Indigo 6.1 but most of the time runs fine on Indigo 7.

https://github.com/psevigny/weathercat

Posted on
Wed Oct 24, 2018 7:52 am
jenkins007 offline
Posts: 113
Joined: Nov 08, 2006
Location: Seguin, TX

Re: Applescript and WeatherCat

I've been using WeatherCat for many years and an AppleScript to bring populate many Indigo variables. Since 7.2 and updating to a new computer (running 10.14), the AppleScript started getting errors and stopped updating. So last week I converted the AppleScript to python. It's running well, I am happy to share both the XML template and the python script, but not sure where to post it.

WeatherCat uses a template to create populate an XML file. The python script reads the XML file and parses the data into Indigo variables. The weather values update using an Indigo schedule to execute the python script.

Thanks,
Matthew

Posted on
Wed Oct 24, 2018 8:39 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript and WeatherCat

jenkins007 wrote:
I've been using WeatherCat for many years and an AppleScript to bring populate many Indigo variables. Since 7.2 and updating to a new computer (running 10.14), the AppleScript started getting errors and stopped updating. So last week I converted the AppleScript to python. It's running well, I am happy to share both the XML template and the python script, but not sure where to post it.

WeatherCat uses a template to create populate an XML file. The python script reads the XML file and parses the data into Indigo variables. The weather values update using an Indigo schedule to execute the python script.


Feel free to zip up the files and add it to the File Library. Then post a pointer in the Integrating Services/Applications forum.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 26, 2018 4:46 pm
daveHawk offline
Posts: 27
Joined: Feb 11, 2017

Re: Applescript and WeatherCat

Unfortunately even though the contribution seems to have been posted, clicking on download results in "File Not Found"

Posted on
Mon Nov 26, 2018 6:26 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Applescript and WeatherCat

daveHawk wrote:
Unfortunately even though the contribution seems to have been posted, clicking on download results in "File Not Found"


Yeah, it looks like the file attached to it is just an XML file, so maybe something went wrong when saving the file? I'd recommend zipping up both the xml file and the python script, then putting the zip file in the File Library entry.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests