compare temps

Posted on
Sun Jul 05, 2015 12:18 am
cdeggz offline
Posts: 33
Joined: Nov 30, 2014

compare temps

Trying to get indigo setup to do some commands when the outside temperature is colder than inside (shut off ac, start fan).

Looks like I can easily trigger with a weather snoop temperature changes above some set constant

Looks like I can also trigger based off the inside temperature relative to some content

Not sure how to trigger from one (nest plugin) to the other (weather snoop plugin)

I assume I could just do this with an Applescript. Is there an easy way to dig through all the available property names? I'm a beginner to AppleScript language (but have done a lot of programming).

Posted on
Sun Jul 05, 2015 4:27 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: compare temps

For custom plugin devices, you can see a list of all of the custom states directly below the device details window. Select the plugin device, and then right-click on the custom state and select the information you want. There's not a "Copy AppleScript Reference" option, but you should be able to infer pretty easily from the information that's there.

I'd strongly encourage you to use Python over AppleScript--especially if you are still learning--It's not that much harder to pick up, and it's a much better option IMO.

Dave
Attachments
Screen Shot 2015-07-05 at 5.23.25 AM.png
Screen Shot 2015-07-05 at 5.23.25 AM.png (31.44 KiB) Viewed 3423 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Jul 05, 2015 10:23 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: compare temps

In fact, you have to use Python. Custom devices (and their states) aren't available in AppleScript.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jul 05, 2015 11:06 am
cdeggz offline
Posts: 33
Joined: Nov 30, 2014

Re: compare temps

In fact, you have to use Python. Custom devices (and their states) aren't available in AppleScript.


Thanks! That makes me feel better about myself after failing to get it to work with AppleScript for 3 hours last night!!

I'd strongly encourage you to use Python over AppleScript--especially if you are still learning--It's not that much harder to pick up, and it's a much better option IMO.


Python looked a lot more familiar to me. I have done a lot of JavaScript work. I actually wrote it in Python first, but later learned I can't just dump my python work into script box for a conditional trigger, correct?

I'll go do some more reading on Python/Indigo 101.

Posted on
Sun Jul 05, 2015 12:32 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: compare temps

Python looked a lot more familiar to me. I have done a lot of JavaScript work. I actually wrote it in Python first, but later learned I can't just dump my python work into script box for a conditional trigger, correct?

If I'm understanding your question correctly, sure you can. Set up your trigger and conditions, then:

    Actions tab
    Server Actions
    Script and File Actions
    Execute Script (embedded script or from a file.)

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Jul 05, 2015 1:13 pm
cdeggz offline
Posts: 33
Joined: Nov 30, 2014

Re: compare temps

Ahh, so I ignore the conditions tab, execute the action and then just do conditions in the python script. I should have thought of that!

Thanks for all your help. This will open a world of possibilities!

Posted on
Sun Jul 05, 2015 1:26 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: compare temps

cdeggz wrote:
Ahh, so I ignore the conditions tab, execute the action and then just do conditions in the python script. I should have thought of that!

Thanks for all your help. This will open a world of possibilities!

You can still use Indigo conditions if you'd like, but scripting them will obviously work too.

I use scripting conditions with my climate control automation. I have conditions within the script to check for weekday/weekend, home/away, etc. to determine set points.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Jul 06, 2015 9:02 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: compare temps

cdeggz wrote:
I actually wrote it in Python first, but later learned I can't just dump my python work into script box for a conditional trigger, correct?


Correct - the embedded script box on the Conditions tab is only for AppleScript. As someone else suggested, just write your script in an Execute Script action and manually execute the appropriate actions (most easily through Action Groups) if your conditional logic warrants it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron