Posts: 720
Threads: 124
Joined: May 2019
I wanted to know if anyone has come up with a way to do a timed, slow dimming of lights. I have a scheduled event that dims certain lights to a certain set point at a certain time of the evening. What I would like to have happen is that they dim as it gets darker outside. My initial reaction is to just set a time from, 4 hours for example, from sunset to dim point 0%, and then calculate how many minutes that is. Then, in my scheduled dim action, dim the lights X%, pause, dim the lights X%, pause, and so on until they reach 0%.
any thoughts?
Posts: 40,483
Threads: 491
Joined: Aug 2002
04-10-2020, 12:04 PM
(This post was last modified: 04-10-2020, 12:06 PM by Dean Roddey.)
You shouldn't do events that run a long time like that.
It would be better to have it run every X minutes, calculate a dimming level based on how close to the final time it is, and set that level if the light isn't already at that level. I think you can get the time relative to sunset, but I'd have to check. If so, you take that as a float, divide by the number of total time as a float and multiply by 100, then convert that to an unsigned value. 100 minus that would be the target dimming percentage. Of course do nothing until it gets within the desired time, or just do nothing if it comes out larger than 100.
It'll probably require a CML macro to do it.
Dean Roddey
Explorans limites defectum
Posts: 720
Threads: 124
Joined: May 2019
(04-10-2020, 12:04 PM)Dean Roddey Wrote: You shouldn't do events that run a long time like that.
It would be better to have it run every X minutes, calculate a dimming level based on how close to the final time it is, and set that level if the light isn't already at that level. I think you can get the time relative to sunset, but I'd have to check. If so, you take that as a float, divide by the number of total time as a float and multiply by 100, then convert that to an unsigned value. 100 minus that would be the target dimming percentage. Of course do nothing until it gets within the desired time, or just do nothing if it comes out larger than 100.
It'll probably require a CML macro to do it.
Thanks. Good feedback.