[ANSWERED]: Example AppleScript to turn device on and off

Posted on
Wed Mar 10, 2010 6:34 pm
miousic offline
Posts: 30
Joined: Jun 15, 2008

Re: Example AppleScript to turn device on and off

Jay, if I use my licence number on the client, is it gonna work either?

Posted on
Wed Mar 10, 2010 7:11 pm
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example AppleScript to turn device on and off

You're only licensed to run one IndigoServer at a time. You can run as many clients as you want. I'm not sure what your question is but hopefully that answers it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Jul 24, 2014 9:47 pm
thomasw offline
Posts: 135
Joined: Feb 13, 2011

Re: Example AppleScript to turn device on and (off after 5 m

Hi guys,
I need an applescript to tell the Venstar (T-1900) thermostat to turn "on" the fan every 20 minutes, and run for 5 minutes, then turn the fan "off".
I tried to just create a new schedule to do this, but it will only allow me to have the Actions/control thermostat/device=thermostat/Set Fan Mode/Fan Always On.
There isn't a way to have it shut the fan off after 5 minutes? So, I thought that I could just have it run an applescript that tells the Venstar thermostat to
turn the fan on every 20 min, and shut fan off after 5 minutes.
NOTE: I'm still running Indigo V: 5.1.6 (I have to move everything to a new iMac running Mt. Lion when I get time, then I will upgrade Indigo to V:6).
Thanks,
-Tom

Posted on
Thu Jul 24, 2014 11:41 pm
macpro offline
User avatar
Posts: 765
Joined: Dec 29, 2005
Location: Third byte on the right

Re: Example AppleScript to turn device on and off

Take a look at timers. Indigo has support for "Timers and Pesters" and I wrote a timer script a couple of years ago.
Just start your device as needed and then set a timer for 5 minutes. When it reaches 0, let it fire a triger that turns the device off.

With my timers script, you can do all of that without writing any AppleScript code.
The Indigo solution with "Timers and Pesters" requires coding in Python if I'm correct.

Posted on
Fri Jul 25, 2014 9:18 am
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Example AppleScript to turn device on and off

Timers are only available in Indigo 6, though it would be a good solution actually and wouldn't require any scripting:

  1. Create a timer that has a default value of 5 minutes.
  2. Create a trigger that watches for the timer to expire and sets the fan mode to auto on
  3. Create a schedule that runs every 20 minutes that sets the fan mode to always on (the only way to force the fan on) and starts the timer.

In English: every 20 minutes the fan is turned on and the 5 minute timer is started. After 5 minutes, the timer expires and the trigger fires to turn the fan back to auto (there is no off for hvac fans).

In Indigo 5 you'd need a script. Make sure to create the script as a file and not an embedded script since the script has to sleep and if it's embedded it will hang up the Indigo server:

Code: Select all
tell application "IndigoServer"
  set fan mode of device "Your Thermostat Name Here" to fanAlwaysOn
  delay 300  #seconds
  set fan mode of device "Your Thermostat Name Here" to fanAutoOn
end tell


Untested but it should be close. Then create your schedule that runs every 20 minutes and executes the script file.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Sep 07, 2014 9:29 am
Manuelpl offline
Posts: 7
Joined: Dec 08, 2013
Location: CA

Re: Example AppleScript to turn device on and off

I've looked around I can't seem to get the correct AppleScript code to turn on my ezflora.

Please help

Posted on
Sun Sep 07, 2014 11:28 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Example AppleScript to turn device on and off

To turn on zone 3 you would do:
Code: Select all
tell application "IndigoServer"
   set sprinkler zone of device "MyEzFloraDevName" to 3
end tell

To turn if off you would set it to zone 0.

If you want to execute an entire sprinkler schedule, then I would create an Action Group in Indigo that executes whatever action(s) you want, then execute it via:
Code: Select all
tell application "IndigoServer"
   execute group "MyActionGroupName"
end tell

However, I would recommend executing an embedded Python script if possible, since it gives you more direct control over sprinkler devices:

Code: Select all
dev = indigo.devices[idOfYourSprinklerDevHere]

indigo.sprinkler.setActiveZone(dev, index=3)
indigo.sprinkler.stop(dev)

indigo.sprinkler.run(dev, schedule=[6.1, 7.2, 8.3, 0, 0, 0, 3, 4])
indigo.sprinkler.nextZone(dev)
indigo.sprinkler.previousZone(dev)
indigo.sprinkler.pause(dev)
indigo.sprinkler.resume(dev)
indigo.sprinkler.stop(dev)

Image

Posted on
Sun Sep 07, 2014 11:03 pm
Manuelpl offline
Posts: 7
Joined: Dec 08, 2013
Location: CA

Re: [ANSWERED]: Example AppleScript to turn device on and of

Perfect thank you.

Posted on
Mon Sep 08, 2014 8:35 am
Manuelpl offline
Posts: 7
Joined: Dec 08, 2013
Location: CA

Re: [ANSWERED]: Example AppleScript to turn device on and of

This great exactly how I wanted. : ) Where could I find the commands I could pass through indigo , using Apple Script?

Thanks
Manny

Posted on
Mon Sep 08, 2014 8:41 am
Manuelpl offline
Posts: 7
Joined: Dec 08, 2013
Location: CA

Re: [ANSWERED]: Example AppleScript to turn device on and of

Never Mind found them , thank you

Who is online

Users browsing this forum: No registered users and 4 guests

cron