Getting Weathersnoop values via Applescript

Posted on
Sat Jan 05, 2013 7:21 am
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Getting Weathersnoop values via Applescript

I am using Weathersnoop with Indigo v5.1.6, and it's working well.

Now I'd like to get some of the Weathersnoop device attributes into Applescript to use them in some if/then statements.

Code: Select all
set outsideTemperature to heatIndexF of device "WeatherSnoop"

... compiles fine, but it says it can't find the "heatIndexF" in the device. I've tried with and without quotes around "heatIndexF", and I've tried other attributes, but still no luck.

I have a feeling the answer is is something very simple. Any clues?

Thanks,

Dave

Dave

Posted on
Sat Jan 05, 2013 1:35 pm
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting Weathersnoop values via Applescript

You can't get access to custom device states via AppleScript - you have to use Python. The example would be:

Code: Select all
weathersnoopDevice = indigo.devices[DEVICEID]
outsideTemperature = weathersnoopDevice.states["heatIndexF"]


If you're uncomfortable using Python, then you can create a trigger that watches for the heatIndexF state of the device to change and use the "Variable Actions->Insert Device State into Variable" action to insert the heat index into a variable. You can then use that variable in an AppleScript.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jan 05, 2013 2:10 pm
dstrickler offline
User avatar
Posts: 340
Joined: Oct 08, 2010
Location: Boston, MA

Re: Getting Weathersnoop values via Applescript

Well that explains it ;-)

Thanks for the tip. And no, I haven't learned Python yet. It's on the "I know I need to do this, but no time for it now" list. I think when Indigo drops support for Applescript I'll dive into it!

For the moment I used the trigger to write the variables as you suggested. That's an easy solution and works great for this simple instance.

Thanks!

Dave

Dave

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 23 guests