Purpose
This Blueprint allows you to select 1+ lights/light groups and their default brightness and color temperature. It also work for bulbs that only have brightness and do not have a color temperature option.
Why
This is useful for lights that do not have a default brightness/color temperature for when they turn on (like Sengled zigbee bulbs) and instead turn on to the state they were when they were turned off. So, if you set your lights at 10% in the evening then turned them off, they will be at 10% when you turn them on in the morning instead of 100% like you prefer.
Although Home Assistantâs Default Turn-on Value supports brightness and x/y color it does not support color temperature. In addition, for lights that do have a Default Turn-on Value they sometimes do not quickly check for brightness when they are first physically powered on versus turned on by automation, UI, or smart switch.
blueprint:
name: Default turn-on brightness and color temperature for light(s)
author: noblewolf
description: Resets bulb(s)'s color and brightness when it turns on. Although Home
Assistant has a Default Turn-on Value (https://www.home-assistant.io/integrations/light/#default-turn-on-values)
for lights it does not support color temperature, and some bulbs (zigbee) do not
quickly check when they are first physically powered on versus turned on by
automation, UI, or smart switch.
domain: automation
input:
target_lights:
name: Lights
description: 'The light(s) you want to auto reset to your default settings when
they turn on.'
selector:
entity:
domain:
- light
multiple: true
light_color_temperature:
name: Color Temperature
description: 'Choose the color temperature. Examples: Cool White: 154; Daylight
White: 181; White: 250; Soft White: 370; Warm White: 454'
default: 370
selector:
number:
min: 154.0
max: 500.0
unit_of_measurement: mireds
mode: slider
step: 1.0
light_brightness:
name: Brightness
description: Choose the brightness.
default: 255
selector:
number:
min: 1.0
max: 255.0
mode: slider
step: 1.0
alias: Bulb toggle set to default (Soft White) (BP)
description: 'When a bulb goes from off to on (usually toggling the physical switch)
it sends a light.turn_on to force the light to go to its default state, because
physical toggle does not trigger the default state unless the light power is off
for ~30 sec. (It does go to default instantly if toggled via software.
This is useful when the bulb''s previous/current state is not what you want as default.'
trigger:
platform: state
entity_id: !input 'target_lights'
condition: []
action:
choose:
- conditions:
- condition: template
value_template: '{{ trigger.from_state.state == ''off'' }}'
sequence:
- service: light.turn_on
data:
color_temp: !input 'light_color_temperature'
brightness: !input 'light_brightness'
entity_id: '{{ trigger.entity_id }}'
default: []
mode: parallel
max: 100
It shouldnât matter how the lights turn on as long as they are smart lights. The automation is triggered by the smart bulbs turning on then it sets the brightness/temperature.
Some of my bulbs turn on my smart switch, some by the regular light switch, and another by automation.
Iâd be happy to modify or duplicate this blueprint for RGBW bulbs, but first I want to make sure this ability doesnât already exist. Also, I donât have an RGBW bulb so youâll have to help answer this question.
Home Assistant has Default Turn-on Value which allows you to set brightness and color (using the xy_color option). This blueprint imitates that for color_temperature.
Does the white_value get set correctly in the xy_color choice or is the white_value completely independent from the white LED pixel(s)?
To test you can create a file called âlight_profiles.csvâ in your config folder. Mine looks like this:
The white_value is independent. Find below 2 examples for whites, one using xy and the other one by using dedicated white leds. Not sure if this is what you meant. Let me know if you need anything else and I will be ready to help
Thank you. This worked perfect for me. I like that I can have 1 automation to set the defaults for all my bulbs where required. Very simple, very elegant. No need for a csv file like before. Add new bulbs, just edit the automation to include them.
hello @Noblewolf and thanks for this. It works great but i have one issue and you might be able to help.
I have various scenes that are linked to some lights. When I activate one of the scenes the brightness level is automatically adjusted to the brightness level that has been specified in the blue print instead of applying the brightness that it has been specified on the scene.
Example: Scene-Bed time
Office Lights: OFF
Dinning Lights: OFF
Living room Lights: OFF
Bedroom Lights: 10% Brightness
Kitchen Spotlight: 10% Brightness
TV: OFF
HiFi: OFF
When I activate the scene all it executes but instead of 10% brightness for âBedroom Lightsâ and âKitchen Spotlightâ it has something like 45% brightness, which is what i have set as the the default turn on value in the blueprint for each light entity indivitually.
I will appreciate it a lot if you can help me a bit here.
This is a great blueprint, thank you! After creating the automation from the blueprint, everything appears to work fine. However, after I turn off a light included within the automation, it will randomly turn back on. Sometimes within seconds, sometimes a bit later. When looking at what is turning it on, it shows turned on by service light.turn_on. Thoughts?
That is odd, but I donât think it would be caused by this blueprint. It is only triggered by a light turning on and had no delay or wait conditions.
Many things could cause it. Could be a delay in a smart remote, another automation, script, cosmic radiation, gremlins, etc.
light.turn_on is the generic turn on command for lights that can be fired by anything that wants to turn a light on.
I just set this up and it works well, but one slight issue. When i try and activate a scene (for instance one that sets my bulb to coloured and turn on), this seems to override it and set it to white again. So my scenes only work when the light is already powered on.
Thanks for sharing this. Iâve got a couple of Shelly Dimmer2 modules controlling LED downlights but when I set this running via an automation, on one dimmer the lights turn on then immediately off again when I press the switch, but if I press the button two or three more times they then do stay on at the automation set brightness. With the other dimmer it seems to have no effect at all, no flashing but no effect on the turned on dimming level. Anything I can try?
Look at previous comments. This is a known issue that canât currently be handled in a blueprint that I know of.
Maybe you could have a action after you turn on a scene to stop this automation, but Iâve not found a good way to do it.
That is quite unusual. Since the problem is with one switch and not others Iâd say it doesnât have to so with this blueprint. Also, there is no turn off command in the blueprint so Iâd investigate elsewhere.
Iâve tested a bit more and its not working correctly with any of my four Shelly Dimmer2 switches.
The one I mentioned above turns the lights on at the correctly set dimming level by the automation but often turns them straight back off (or dims to zero within a second or so, not sure which), and the other three dimmers seem to ignore the automation entirely and just retain previous dim level as they would by default. Iâve compared configs of a dimmer that does nothing and the one that turns off when the automation is enabled and theyâre identical so not sure what to look for. As soon as I turn off the automation the ones that donât react to the automation obviously carry on as they were, and the other one starts working perfectly again from the wall switch, the Shelly app and from HA.
Setting turn-on brightness isnât something I desperately need at the moment but happy to try things if you can suggest any troubleshooting steps.