Your welcome, glad you got it working.
Enjoy
Blacky
You will need to use my Sensor Light blueprint. Set up the trigger, your lights and use the Ambient condition, enter in your sensor and adjust your settings. No need for night light.
Tip: If you like to take it to the next level your could set up a template sensor that has auto OFF so when you open / close the door the light will be ON for X amount of time and then turn OFF so the light isn’t always ON when the door is open, then you also use a motion sensor in the garage that will turn the light back ON or keep it ON if you are in the garage. You then use the template sensor and your motion sensor in a sensor group in the trigger. Link to the Ho To for the template sensor click here.
Blacky
Hello Blacky,
I’m using the Smart Light blueprint to turn the outdoor lights on and off based on the sun position, with brightness set to 25%.
The same lights should also be triggered by a motion sensor. When motion is detected, brightness should go up to 75% for a duration of 2 minutes. For this, I’m using the Sensor Light blueprint.
After that, the lights should return to 25% brightness.
Each blueprint works individually, but when I activate both, the lights turn off completely after 2 minutes.
I need some help with this. Thanks in advance!
Welcome to the community.
This is something on my list to do in the sensor light blueprint.
Until then because you already have 2 automations set up, in the sensor light blueprint automation create a scene with your lights at 25%… then add that scene into Scenes - Scripts To Turn OFF. Try that and and see if that works. If you see a light flicker when it goes from 100% to 25% then you may need to create another scene with your lights at 100% and add it into Lights - Switches - Scenes - Scripts (no light entities only the scene). If you do that then create a toggle helper and add it into Scenes & Scripts - Toggle Helper.
To create a scene go to settings > automation & scenes > scenes tab at top, then and add scene. Add your light entities in, then click on them and set them how you would like them and save the scene.
Let us know if that works for you as I haven’t tested it.
Blacky
Sensor Light Blueprint is specifically designed for dynamic triggers like binary sensors (e.g., motion sensors, presence sensors, etc.). It includes a wide range of conditions such as sun elevation, ambient light, time-based options, and device tracking to control when the automation will activate. This makes it ideal for areas where lighting should respond to real-time, unpredictable triggers, such as motion or presence sensors that can change state at any moment.
Smart Light Blueprint is built for fixed triggers such as entity states, sun elevation, ambient light, and time-based options to turn lights on or off. Apart from the entity state trigger, all other triggers in this blueprint are based on fixed schedules instead of dynamic conditions. This means they activate lights based on predictable, scheduled events like sunrise/sunset, ambient light thresholds, or specific times. It’s best suited for scheduled, consistent lighting needs and is not designed for use with motion sensors or other dynamic triggers.
Sensor Light Blueprint is designed for dynamic triggers, which are typically binary sensors like motion sensors or presence sensors. These sensors can change state at any moment, making the lighting responsive to real-time events.
Smart Light Blueprint is intended for fixed triggers, such as entity states (on/off), sun elevation, ambient light levels, and specific times. These triggers are usually more predictable and occur on a fixed schedule.
Sensor Light Blueprint offers a variety of conditions to control when the automation is allowed to run, including:
Smart Light Blueprint, on the other hand, only has Weekdays as a condition to control when the automation is allowed to run, allowing you to specify the day of the week. As you can see, the conditions in the Sensor Light Blueprint (such as sun elevation, ambient light, and time) are essentially used as triggers in the Smart Light Blueprint.
Both blueprints support Dynamic Lighting, where brightness and color temperature can be automatically adjusted based on lux levels or sun position.
The Sensor Light Blueprint also allows fine-tuning of Dynamic Lighting based on sun elevation and lux, as these are added conditions that can further control how lighting behaves.
The Sensor Light Blueprint is best suited for environments where lighting needs to react to real-time, dynamic changes, such as motion or presence detection. It’s ideal for scenarios where you need flexibility and immediate response to unpredictable events.
Example: Walk into a room and the light turns ON. When you leave, the light will turn OFF with a delay. Open a door and the light turns ON, with the light turning OFF with a delay when the door is closed.
The Smart Light Blueprint, on the other hand, is designed for more predictable, scheduled lighting setups. It’s perfect for automations based on fixed events like specific times of the day, sun elevation, or ambient light levels, without the need for dynamic triggers. This blueprint offers a more consistent, scheduled lighting experience, where triggers occur based on fixed schedules rather than changing conditions.
Example: Turn the light ON when the sun sets and turn it OFF at a set time, such as 11pm. Open a door and the light turns ON, close the door and the light turns OFF (no delay).
Enjoy
Blacky
Back to FAQ: Click Here
Hello Blacky, Is there a way to delay the night lights from going back to normal lighting effects right after for example the motion sensor clears motion or door closes. I’m using a helper atm with an automation timer. Maybe I’m missing something. In sensor light we can set a delay to turn the lights off.
I can see that would be a good option when crossing over from night lights to normal lights. I will put it on the list to do.
Also have a look at the sensor light blueprint as it now has a night glow.
Blacky
Thanks Blacky
Dear all,
I am trying this blueprint in order to switch on some lights depending on the value of an illumination sensor. But the trigger doesn’t seem to fire. I tried to debug it by using trace, but can’t see any reason why it doesn’t.
I also was under the impression that when you run the automation and it is dark (sensor reporting 0 lux) it should switch the light on, shouldn’t it?
I by the way also use the CCA blueprint which works when it comes to timing, but doesn’t when it comes for illumination sensor; maybe the same issue.
Find here the yaml code for the blueprint parameters:
id: '1733137666873'
alias: Smart Light Stern Arbeitszimmer
description: ''
use_blueprint:
path: Blackshome/smart-light.yaml
input:
include_ambient:
- ambient_low
- ambient_high
ambient_light_sensor: sensor.hm_sen_li_o_peq1447533_lux
include_time: []
light_switch:
entity_id: switch.sw_02_none
ambient_light_value: 40
ambient_light_value_off: 50
include_weekdays: weekday_disabled
weekday_options: []
include_bypass: []
bypass_lights_on: []
bypass_lights_off: []
Thanks for any hint, even if it is only a hint how to debug that stuff. The trace visual editor is not really my preferred choice :-).
BR,
Carsten.
Thanks for your YAML. I tested it here with your settings and it worked perfectly.
This is how I tested it.
You can’t use the run in the automation to test it. The sensor must go from high to low and then from low to high. All your setting are good.
Blacky
Good Morning Blacky,
first of all: thanks for your wonderful blueprints and for testing my YAML. In fact most of the automations also worked in my home this morning as a nice surprise!
I started already to understand what went wrong when I went to bed after 4 hours of testing yesterday. You know I am coming from FHEM with what is called a DOIF. It will permanently check whether the values of e.g. the light sensor are fitting the requirements or we are still in a certain time range.
I now know that HA is working different here: it will need the event’s transition to fire. Running the automation will not check that the light sensor is still underneath the value.
Hence it worked, as it did for my shutter control blueprint. I am very happy now!
Best Regards,
Carsten.
Your welcome Carsten, glad you got it working and thanks for letting us know.
Enjoy
Blacky
could you add the option to make the lights work only when someone is home? like in the other blueprints
Thanks
First let me say how much your work has made my life easier! I was ready to pull my hair out until i found your automations
One issue im having, my lights arent transitioning colors/brightness on a new time.
Example
Lights on 4pm - white 100%
Lights on 9pm - blue 50%
At 9pm they are staying white 100% and not switching. Pretty much if the lights are on, they wont transition at all.
Edit this is for a couple govee bulbs and a hue strip
Hopefully ive added what you need. This is day 5 of me learning HA lol.
alias: Test
description: “”
use_blueprint:
path: Blackshome/smart-light.yaml
input:
include_time:
- time_on
after_time: “15:00:00”
light_switch:
entity_id:
- light.living_room_lamp
- light.kitchen_under_cabinet
include_light_control:
- use_brightness
- use_transition
include_weekdays: weekday_enabled
include_light_colour_control: use_rgb_colour
light_rgb_colour:
- 255
- 0
- 0
I am assuming you are going to turn the lights OFF manually.
This will turn your lights ON at 4pm white at 100% and then at 9pm they will switch to blue at 50%. At 8am they will go back to white at 100% if you don’t turn them OFF. Notice how I have used night lights, we only need to use weekday if you only what it to run a a few days but if it is everyday then we don’t need to enable this option.
Copy the code below and paste it into your automation. TIP: When you paste code into this forum if you use the </> in the editor and then paste your code into there it will keep the format it should be, like below.
alias: Test
description: ""
use_blueprint:
path: Blackshome/smart-light.yaml
input:
include_time:
- time_on
after_time: "16:00:00"
light_switch:
entity_id:
- light.living_room_lamp
- light.kitchen_under_cabinet
include_light_control:
- use_brightness
- use_transition
include_night_lights: night_lights_enabled
night_lights_conditions:
- time_enabled
night_lights_after_time: "21:00:00"
night_lights_before_time: "08:00:00"
night_lights:
entity_id:
- light.living_room_lamp
- light.kitchen_under_cabinet
include_night_light_control:
- use_brightness
- use_transition
- if_lights_are_on_adjust_when_crossing_over
night_light_brightness: 50
include_light_colour_control: use_rgb_colour
include_night_light_colour_control: use_rgb_colour
night_light_rgb_colour:
- 0
- 0
- 255
Let us know how you go.
Blacky
Smart Lighting: Your Lights, Your Way - Take Control and Customize it to Perfection!
New Feature
Maintenance
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
OK heres the 2 automations, Looks like its not working the way it should on my end. I do have an off time, but still none of the lights are switching colors and brightness at the times they are supposed to.
alias: Main Lights 5-8PM
description: ""
use_blueprint:
path: Blackshome/smart-light.yaml
input:
after_time: "16:25:00"
before_time: "20:01:00"
light_switch:
entity_id:
- light.bonus_room_lamp
- light.living_room_lamp
- light.kitchen_under_cabinet
- light.basement_lamp
include_light_control:
- use_brightness
include_night_light_control: []
include_light_colour_control: use_colour_temperature
include_time:
- time_on
include_weekdays: weekday_enabled
light_brightness: 90
include_sun: []
alias: Main Lights Low 8-10
description: ""
use_blueprint:
path: Blackshome/smart-light.yaml
input:
after_time: "20:00:00"
before_time: "22:00:00"
light_switch:
entity_id:
- light.bonus_room_lamp
- light.living_room_lamp
- light.kitchen_under_cabinet
- light.basement_lamp
include_light_control:
- use_brightness
light_brightness: 17
light_transition_on: 5
light_transition_off: 30
include_light_colour_control: use_rgb_colour
light_rgb_colour:
- 54
- 128
- 247
include_time:
- time_on
- time_off
include_weekdays: weekday_enabled
Ive also tried the Test code you provided, switched the time, and re tested. Lights did not change at all. The only time they seem to want to cooperate is when they are OFF completely and then triggered.
If they are already on then they stay the same state. This goes for both govee and my hue.
Hi Blacky! Thanks so much for your awesome blueprints, I think they all deserve to be in the standard installation of HA!
One feature request for this blueprint, I use separate automations to switch on lights always plus some lights which I only switch on/off when someone is home. Could you include a trigger for zone/home 0 or above zero?