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: 105
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: 14402
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: 2
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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests