Hey friends!
As almost everyone here, I automated my lights. Having dimmers in the rooms, I would like to smoothly bring in the lights, when it gets darker and reduce it when it gets lighter again - also on dark days.
The goal is to always have a sane lighting in the room so I can work there. But if it is a bright sunny day, I don’t want the synthetic lights on and enjoy the sun instead. I see three ways here:
-
Measure the outside luminance and map it to the light level percentage:
100% Lights when outside luminance 40 Lux or below
0% Lights when outside luminance 200 Lux or above
Linear interpolation between those points -
Measure the inside room luminance and map it to the light level percentage:
100% Lights when room luminance below 100 Lux
0% Lights when room luminance over 140 Lux
Linear interpolation between those points -
Measure the inside room luminance using a PID Controller to slowly adapt the light level percentage until the desired luminance is reached
The first solution is pretty easy. It gets dark outside and the lights will turn on. Not as instantanously as with a switch but smooth. The downside is, that I can not assure that it will not get too light or dark in the room, as the outside luminance is completely decoupled from the real room luminance. So there might be some undesired breaks in the lighting curve.
The second solution is very hard to use, because after turning the light on, the room gets so light, that it will turn down again, causing it to turn it up again. It works when changing the lighting really really slowly (over 2 minutes or something). But this feels weird and does not ensure the room luminance. It just compresses the dynamics of the light. So it’s never fully dark and never fully bright.
The third solution is the most complex one, but very promising. By choosing the right values for P, I and D great differences between the desired and the actual state will be changed fast, while smaller differences get only very slight changes. Also the Dimmer percentage is completely decoupled from what the luminance is. A PID Controller will just tune the dimmer until the luminance is like desired.
As I am very unhappy with the seconds solution, I move to the first one now. The perfect solution would be the PID Controller, but I have no idea how to implement this in openHAB.
How do you solve your lighting? Are you trying to achieve similar goals or is my goal to iver-engineered?
I’m looking forward to your thoughts and hints!