How do I dim lots of lights without loads of tasks?
Posted: Fri Nov 28, 2003 8:13 am
I have a number of standard wall mounted light dimmers. On my theme I have four buttons for each one - Off Dim Bright On
The On and Off ones are easy, they just change the property of the device directly.
The Dim and Bright ones are doing my head in! I can't set the dim level absolutely, it needs to be relative. So for example, each time the Dim is pressed, it runs a task that has a single command to change the composite property of my X10 contoller to A;3;Dim 2. This works fine, apart from the fact that each dim or bright button needs its own task.
I have thought of replacing the On and Off buttons with tasks that issue say 10 brights or 10 dims and keep a record of the state to help with knowing what the lighting level is. But this would mean another two tasks per device!
I have been round the houses of trying to do it with each button setting a flag and then having a task that is continually polling the flags and issuing the relevant commands based on which flag is set. - At least this way it is a single file that I'm editing and can just cut and paste when extra devices are added. Unfortunately, the whole processes of the task detecting the change and then sending the code out is far too slow and produces very 'jerky' dimming.
I've tried doing it externally with scripts, but still need to trigger the script and either need a lot of scripts or a similar approach to above. It would be good if I could chnage two properties on the script device i.e. set its state to running and also pass it a parameter - the device ID for example.
So..... do I have to live with loads of tasks / scripts or out of all of you out there has someone done this in a far more sensible way?
Cheers,
P.S. I know multi-tasking is good, but I don't think this is what they mean
The On and Off ones are easy, they just change the property of the device directly.
The Dim and Bright ones are doing my head in! I can't set the dim level absolutely, it needs to be relative. So for example, each time the Dim is pressed, it runs a task that has a single command to change the composite property of my X10 contoller to A;3;Dim 2. This works fine, apart from the fact that each dim or bright button needs its own task.
I have thought of replacing the On and Off buttons with tasks that issue say 10 brights or 10 dims and keep a record of the state to help with knowing what the lighting level is. But this would mean another two tasks per device!
I have been round the houses of trying to do it with each button setting a flag and then having a task that is continually polling the flags and issuing the relevant commands based on which flag is set. - At least this way it is a single file that I'm editing and can just cut and paste when extra devices are added. Unfortunately, the whole processes of the task detecting the change and then sending the code out is far too slow and produces very 'jerky' dimming.
I've tried doing it externally with scripts, but still need to trigger the script and either need a lot of scripts or a similar approach to above. It would be good if I could chnage two properties on the script device i.e. set its state to running and also pass it a parameter - the device ID for example.
So..... do I have to live with loads of tasks / scripts or out of all of you out there has someone done this in a far more sensible way?
Cheers,
P.S. I know multi-tasking is good, but I don't think this is what they mean