Page 1 of 1

Dimming System Attachment Script

PostPosted: Mon Nov 06, 2006 8:20 pm
by gregss
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.

Re: Dimming System Attachment Script

PostPosted: Fri Feb 02, 2007 10:55 am
by matt (support)
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

error in dimming script

PostPosted: Sun Oct 21, 2007 3:27 pm
by echiehackett
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 :)

PostPosted: Sun Oct 21, 2007 3:36 pm
by gregss
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

PostPosted: Sun Oct 21, 2007 4:12 pm
by echiehackett
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()


PostPosted: Sun Oct 21, 2007 4:15 pm
by echiehackett
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 :)

PostPosted: Sun Oct 21, 2007 5:32 pm
by gregss
Glad you got it figured out!

PostPosted: Fri Feb 22, 2008 11:52 pm
by morps
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?

Things to Try

PostPosted: Sat Feb 23, 2008 6:31 am
by gregss
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

PostPosted: Sat Feb 23, 2008 5:23 pm
by morps
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!

Re: Dimming System Attachment Script

PostPosted: Sun Feb 13, 2011 11:21 pm
by artpics
Great Script works nice for my new aquarium

Re: Dimming System Attachment Script

PostPosted: Fri Feb 18, 2011 11:07 pm
by teejay6
Very Cool! Worked right out of the box. Thanks for the script.

Re: Dimming System Attachment Script

PostPosted: Mon Jul 18, 2011 7:54 am
by GoBecky
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!

Re: Dimming System Attachment Script

PostPosted: Mon Jul 18, 2011 9:14 am
by jay (support)
Greg posted it in the File Library (I also changed the link in the OP).