I have bulbs for which the brightness and color temperature can be controlled. I’ve bought some four-button switches to control brightness and temperature independently, but it feels too complicated to be magic. I want a way to control both brightness and temp – in an intelligent way. By control I mean increment/decrement at the same time so that I could use a two-button switch (like the RODRET).
I understand that Philips has a line of (non-smart?) bulbs that does this. I can’t find any HA blueprints that do this, or any discussion.
I’m happy building it myself, but I don’t know where to start (algorithm-wise).
Let’s convert the brightness scale (e.g., 0-255) to % and the color temp scale (e.g., 2700 - 5500) to % to keep things simple. It doesn’t seem like “matching” the two attributes would feel the best. E.g. when you’re at 10% brightness you’re at 10% color (2980 in my example) and when you’re at 100% brightness you’re at 100% color (e.g., 5500).
My inclination is that if I want reduced brightness then I want a warmer temp. Also warm temps just don’t “feel” bright. So with my 4-button remote I’ve found that I tend to increase the brightness to max, and then need “more light” so then start increasing the temp.
Instead it feels like you should slowly ramp up the color when you’re ramping up the brightness then when you’re at, say, 80% brightness then you ramp the color up more quickly, and then keep increasing the color after you get to 100% brightness.
E.g., As you go from 0% - 70% brightness you ramp up the color from 0% to 30%. From 70% to 100% brightness you ramp up the color from 30% to 70%. Then you keep ramping up.
Has anybody thought through this? Does anybody know how the Philips bulbs do it?
I’ve honestly never seen anyone change the Kelvin temperature of their lighting along with the brightness. I have the Kelvin for my lighting set based on the room the lighting is in or by the what the light is being used for. I also have some of them set to a slightly lower Kelvin after the sun goes down. I can’t remember ever having a need to change the Kelvin settings after I initially set them.
I’ve never actually seen any non-smart bulbs that automatically change Kelvin based on the brightness level as you suggested the Phillips do. However, I do know they exist but they don’t function quite like you suggested. I think they call them warm dim lights and they decrease in Kelvin as the brightness is lowered but even at full brightness these light are already at a low Kelvin setting. For example, at full brightness they’re probably around 2700-3000K and when dimmed they drop to around 1800K.
No, if you want reduced brightness then you should only have to change the brightness level. Yes, warm temps don’t feel bright because they’re not.
1800-2700K is used in low-light areas where ambient lighting is needed.
2700-3000K is that warm light that you’re most familiar with and is used in a bedroom, living room, and dining room.
3000-4000K is that neutral or cool white light that you would want in your kitchen or your bathroom where you have more of a functional need for the light.
4000-5000K is that bright crisp white light and is used for an office, garage, or work areas where you would really depend on the light for what you’re doing.
Based on the above Kelvin levels I only see a need to change the brightness level. For example, if you lowered the brightness of the light in the garage what would the benefit be of lowering the Kelvin? Or in the bedroom or living room you would want that lower Kelvin level so you get that warm and comfortable feeling. The only time those rooms might be at full brightness is if you’re trying to find something you lost or maybe cleaning so I don’t see a benefit in trying to increase the Kelvin.
However, if you have your mind set on doing both then it’s just a matter of creating the automation or script for it. My light switches are setup so they turn on at a set Kelvin and previous brightness level. Then as I tap the dimmer paddle up or down the brightness changes. You would do it the same way but you would follow each brightness change with a template that checks the brightness and then changes the Kelvin temperature based on the brightness level. I wouldn’t worry about trying to change the Kelvin for all 100 different percentage points. Instead I’d write the template so that if the brightness level is > 0 but < 10 the Kelvin is set to 2300K. Then when the brightness is >= 10 but < 20 then the Kelvin is set yo 2700K. There’s several different ways to set it up but without knowing how many lights, rooms, switches, etc. you have I can’t really make any suggestions.
The idea is that these can mimic the shifting color temperature of an incandescent light bulb as it’s dimmed.
I know I’m old fashioned, but this is exactly the kind of thing I want my light bulbs to do. … A dimmer switch would cause the light output of a tungsten lamp to shift downward from it’s 2,700 / 3,000 K to a warmer looking color as its brightness was reduced. This happened because the filament was, in fact, getting cooler.
So, yeah, they do exist, but are only at the low K setting, as you say.
For example, at full brightness they’re probably around 2700-3000K and when dimmed they drop to around 1800K.
With that being said, that particular range and behavior was only because it was trying to mimic a legacy incandescent bulb, so there might be some anachromorphism / skeuomorphism in there, and having a wider range might not be a bad idea.
Based on the above Kelvin levels I only see a need to change the brightness level. For example, if you lowered the brightness of the light in the garage what would the benefit be of lowering the Kelvin?
I find that in multi-use rooms (like the living room, or a bedroom+office) then having a 2700K-3000K light during midday feels weird, which is why I use the Adaptive Lighting integration.
Then as nighttime comes the integration switches to, say, 2300K. But as “nighttime” is getting earlier and earlier these days, and I want to do something more active (like, say, a board game with friends), then I turn the brightness all the way up and it just doesn’t feel bright and “active” enough to me. That’s when I use the color-temp button and bump up the K a few notches to ~4000K. Maybe my fundamental problem is that I don’t have enough bulbs, and I’d be happy with 2300K if I had twice the lumens?
For example, if you lowered the brightness of the light in the garage what would the benefit be of lowering the Kelvin
Because if I’m lowering the brightness in the garage to, say, 20% then there’s a reason I want low brightness in the garage. I’m probably not cutting wood. Also, let’s say I’m just walking to-and-form my car. Experiencing high-temp lights at night is bad for sleep, and (Adaptive Lighting aside) one intuitive way to tell HA that the color should be warmer is to use the dimmer.
I wouldn’t worry about trying to change the Kelvin for all 100 different percentage points. Instead I’d write the template so that if the brightness level is > 0 but < 10 the Kelvin is set to 2300K. Then when the brightness is >= 10 but < 20 then the Kelvin is set yo 2700K.
That’s the type of algorithm I was looking for. The automation part is easy. But maybe the “math” is as simple as you describe. Essentially two points and a step function, and only using the lower end of the K spectrum…
Based on your reply, then yes I could see why you would want to lower the Kelvin. If you were just walking through the garage you would want the light to function as more of a night light which makes sense.
Yes, the amount of bulbs you have could also have a significant impact on the overall lighting of the environment. Another thing to consider is the type of bulb you’re using. So is it a bulb screwed into a floor lamp or are you using ceiling downlights? I use several smart downlights in all of my rooms for normal lighting but I also have smart floor lamps for ambient lighting or more direct lighting when needed.
Yes, the “algorithm” is just simple math. It can be either detailed or basic, it just depends on how extreme you want to go.
I personally combine automations with scripts to minimize the amount of coding I use. For example, I have a separate automation for all of my switches which triggers when a button on the switch is pressed. All of those automations then run the same script to handle the light options.
The script functions as a general template for all of my lighting. The automation passes two variables to the script. One variable identifies the entity id of the light the switch is controlling and the other variable identifies the button that was pressed on the switch (I use scene controllers which I’ll explain at the end.) The script uses a “choose” statement with a template for the button variable to sort out which action needs to take place and then uses the light variable to send that action to the correct light. I think this cleans things up and makes things easier to change, especially if your lighting follows the same type of configuration.
Below is an example of a portion of my lighting script. If the button pressed is what i consider the “dimmer up” button then the light.turn_on action is called and the target parameter uses the light variable that i passed to get the entity id and increase the brightness by 20%. If the button pressed is what i consider the “dimmer down” button then the light.turn_on action is called and the target parameter uses the light variable that i passed to get the entity id but decreases the brightness by 20%. You’ll also see an additional “choose” statement included within the dimmer which I use to prevent shutting the light completely off. Without it, the brightness will decrease until it is 0%. Since 20% of a 255 total brightness level is 51 I have a condition check to make sure the brightness state is above that before reducing it 20%. If the brightness state is 51 or less then I just set the brightness to 5% instead of decreasing it by a percentage which avoids the light turning off. Actually, to avoid the light dimming to 1% to 4% which might barely be noticable, I should probably use 63.75 which would stop decreasing the brightness if the result was less than 5%.
To counter the changing time of sunrise and sunset I include the following two conditions in my script for that. Based on my location it determines where the sun is and if it’s above horizon I use a higher Kelvin or if it’s below horizon I use a lower Kelvin. I understand that this doesn’t solve your board game scenario but by adding other conditions it could. It’s all a matter of using the “choose” or “if-then” functions to provide the correct outcome for all of your lighting scenarios.
- condition: state
entity_id: sun.sun
state: above_horizon
- condition: state
entity_id: sun.sun
state: below_horizon
Something else that I ran into that you might want to take into consideration is the type of switch or outlet that you have the smart light connected to. I failed to think of this prior to installing all of the downlights but using the wall switch or the lamp switch turns off all of the power to the smart light. This obviously renders the smart light useless. Then when switched back on the smart light has to reconnect to everything which could cause issues.
To prevent this there’s a couple of companies that make smart switches designed for smart lights. I use wall switches like this which have a relay inside of them which can be used like normal to control power or disabled so that constant power is provided for the smart light. The up/down paddle or buttons on the switch perform as triggers and send events for 1x-5x, hold, and release button presses. I used to use them from a company called Zooz but switched to a company called Inovelli. I don’t have their newest switches but they look amazing. You might want to check them out because they’ll give you a lot more options for controlling your lights.