Dimming System Attachment Script

Posted on
Mon Nov 06, 2006 8:20 pm
gregss offline
Posts: 88
Joined: Sep 21, 2006
Location: Atlanta, GA

Dimming System Attachment Script

The attached script was originally posted in the Software Help forum. Now that I've updated it, I felt that it was more appropriate to post here.

This Attachment Script will allow you to set up soft-fade dimming scenes with just a few simple AppleScript commands. Using the methods in the attachment script, you can easily start dimming:
Code: Select all
InitializeDim of "1st Floor - Family Room - Track Lights" to 0 given steps:30, rate:1, completionAction:"Dim Completion"
InitializeDim of "1st Floor - Family Room - Front Soffit Lights" to 0 given steps:10, rate:2, completionAction:""

ExecuteDimming()


Or, stop dimming for a device:
Code: Select all
CancelDim for "1st Floor - Family Room - Track Lights"


Using script commands, you control how fast dimming should take place. You can event specify that an action group should be automatically executed when dimming is complete (if, for example, you want to take some sort of clean-up action or start up another dimmer).

And, because you would expect a dimmer to stop dimming if you tap the switch, this script also monitors INSTEON and X10 commands. If someone pushes the switch, dimming for all devices in the scene will stop. (Unfortunately, you may encounter a brief flicker as the levels update; due to queuing of commands by the interface controller, there isn't a whole lot you can do if a dimming command has already been readied for transmission.)

Follow the comments at the top of the script for set-up instructions.

Disclaimer: I've tested it with several dimmers in my INSTEON-enabled house with good results. I'll probably make a few changes here and there, and will be happy to re-post if there is any interest. I don't have any X10 devices to work with, though in theory, there is nothing to prevent this from working for X10.

The script is in the file library.

Posted on
Fri Feb 02, 2007 10:55 am
matt (support) offline
Site Admin
User avatar
Posts: 18918
Joined: Jan 27, 2003
Location: Texas

Re: Dimming System Attachment Script

Greg --

Thanks for the terrific script.

Everyone else --

Be sure and check this one out of if you have any need for slow (over several seconds, minutes, or hours) dimming or brightening.

Regards,
Matt

Posted on
Sun Oct 21, 2007 3:27 pm
echiehackett offline
Posts: 12
Joined: Mar 23, 2007
Location: Victoria, BC, CANADA

error in dimming script

Code: Select all
  Dimming System     Beginning to adjust on level of device 'Office-Desk Lamp 1' from 100 to 20.
  Sent INSTEON       "Office-Desk Lamp 1" on to 96
  Error              FindElem() failed to find action group elem
  Time/Date Action   _delayed_action_2
  Error              FindElem() failed to find action group elem


running 10.4.10 - go to run script and get the following error - and it just pauses at that point - it does the first "step" but doesn't repeat - when i go to run it again, i have to cancel it first then can run it again to get the second step

main file is in attachments and is set to run on startup - running indigo 2.0.9

thanks for any insight :)

Posted on
Sun Oct 21, 2007 3:36 pm
gregss offline
Posts: 88
Joined: Sep 21, 2006
Location: Atlanta, GA

(No subject)

Echiehackett,

Have you manually modified the script? FindElem() isn't a function used in the original version of the script.

A couple more questions for you: Is your device INSTEON or X10? And can you post the code snippet you're using to initialize the dimming operation?

Thanks,
-Greg

Posted on
Sun Oct 21, 2007 4:12 pm
echiehackett offline
Posts: 12
Joined: Mar 23, 2007
Location: Victoria, BC, CANADA

(No subject)

gregss wrote:
Echiehackett,

Have you manually modified the script? FindElem() isn't a function used in the original version of the script.

A couple more questions for you: Is your device INSTEON or X10? And can you post the code snippet you're using to initialize the dimming operation?

Thanks,
-Greg


haven't modified the script other than to set the delay between repeats from 2 seconds to 1 second (just downloaded a fresh script from the site) and left all as defaults

Insteon only is running on the network

Create a new trigger action or action group with the following code

Code: Select all
InitializeDim of "Office-Desk Lamp 1" to 20 given steps:5, rate:4, completionAction:""
ExecuteDimming()


Posted on
Sun Oct 21, 2007 4:15 pm
echiehackett offline
Posts: 12
Joined: Mar 23, 2007
Location: Victoria, BC, CANADA

(No subject)

echiehackett wrote:
gregss wrote:
Echiehackett,

Have you manually modified the script? FindElem() isn't a function used in the original version of the script.

A couple more questions for you: Is your device INSTEON or X10? And can you post the code snippet you're using to initialize the dimming operation?

Thanks,
-Greg


ok - so here's the solution - read the directions - i was executing the file instead of the line "InitializeDimmingSystem()"

got it :)

Posted on
Sun Oct 21, 2007 5:32 pm
gregss offline
Posts: 88
Joined: Sep 21, 2006
Location: Atlanta, GA

(No subject)

Glad you got it figured out!

Posted on
Fri Feb 22, 2008 11:52 pm
morps offline
Posts: 122
Joined: Nov 01, 2003

(No subject)

After upgrading from 10.4 to 10.5, I am now running into the following error with the dimming system script:

Code: Select all
 Error              script error: The Dimming System could not create or update the action group required to support dimming commands. Device dimming is not currently available through the Dimming System.



I experienced this error with 2.09 as well as beta 17 of 2.5. Any ideas?

Posted on
Sat Feb 23, 2008 6:31 am
gregss offline
Posts: 88
Joined: Sep 21, 2006
Location: Atlanta, GA

Things to Try

Morps,

Can you check a couple of things for me? First of all, in the log, do you see an entry labeled:

Dimming System
The Dimming System has been initialized.


If you do see this, then it's possible there are somehow multiple copies of the script. If not, have a look in your action groups to see if there is one labeled:

Dimming: Execute Dimming

If there is, everything should be ready to go, and I'm not sure why the script would complain. You have it in your attachments directory? Just for kicks, you could try a Scripts>Reload Attachments command and try again.

If all else fails, you can modify the script (as long as the action group above is installed). Find the line that has this on a line by itself:
Code: Select all
_AddDimmingActionGroup()

(It's in the on _InitializeDimmingSystem() function.) You could comment out that line by adding two dashes (--) in front of it and reload your script attachments.

Hope this helps!
-Greg

Posted on
Sat Feb 23, 2008 5:23 pm
morps offline
Posts: 122
Joined: Nov 01, 2003

(No subject)

Gregss,

Thanks for the reply. it looks like all is well again... it appears that I was running into the 10.5.1 bug where embedded scripts were not compiling. As a result, all actions that were using Applescript were going south on me. After updating to Matt's latest beta, I seem to be in a much better place. I rebooted a second time after installing 2.5 b17 and that seems to have done the trick. Weird little demons musta been lurking :)

Thanks again!

Posted on
Sun Feb 13, 2011 11:21 pm
artpics offline
Posts: 232
Joined: Feb 24, 2009
Location: Calabasas CA

Re: Dimming System Attachment Script

Great Script works nice for my new aquarium

Posted on
Fri Feb 18, 2011 11:07 pm
teejay6 offline
Posts: 35
Joined: Jan 31, 2011
Location: Menlo Park, CA

Re: Dimming System Attachment Script

Very Cool! Worked right out of the box. Thanks for the script.

Posted on
Mon Jul 18, 2011 7:54 am
GoBecky offline
User avatar
Posts: 49
Joined: Jan 29, 2011
Location: Tampa, FL

Re: Dimming System Attachment Script

Does this script still exist somewhere out there? Am getting a 404 when I attempt to download. Having installed my first dimmers this weekend, would love to have this sort of functionality!

I'm a wheelchair user & use Indigo to make my home & office accessible & safe without the expense of ECU's: door openers, emergency alerts, & even buttons my service dog can push to activate triggers! Feel free to PM fo info/advice.

Posted on
Mon Jul 18, 2011 9:14 am
jay (support) offline
Site Admin
User avatar
Posts: 15153
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Dimming System Attachment Script

Greg posted it in the File Library (I also changed the link in the OP).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest