compare temps

cdeggz
Posts: 33
Joined: Sun Nov 30, 2014 9:13 pm

compare temps

Post by cdeggz »

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).
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: compare temps

Post by DaveL17 »

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 4289 times
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: compare temps

Post by jay (support) »

In fact, you have to use Python. Custom devices (and their states) aren't available in AppleScript.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
cdeggz
Posts: 33
Joined: Sun Nov 30, 2014 9:13 pm

Re: compare temps

Post by cdeggz »

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.
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: compare temps

Post by DaveL17 »

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 and Scripts
cdeggz
Posts: 33
Joined: Sun Nov 30, 2014 9:13 pm

Re: compare temps

Post by cdeggz »

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!
User avatar
DaveL17
Posts: 7323
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: compare temps

Post by DaveL17 »

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 and Scripts
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: compare temps

Post by jay (support) »

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
Post Reply

Return to “WeatherSnoop”