💡 Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

Hi Blacky,

Thanks for your response, this is the code. I selected the entity just from the list in the gui.

alias: AUTOfficeLight
description: Automation Office Light
  path: Blackshome/sensor-light.yaml
      - binary_sensor.motion_fib_office_motion_detection
      area_id: office

When I go look under traces I also don’t see anything happen.



I have tested your yaml and it all works. Note you are using an ‘Automation’ for your bypass so it will be the toggle for the automation (enable / disable). The other thing to note is you are using the same automation as the bypass for option 1 & 2. You can’t do that as there is a conflict because when you turn ON the bypass what should it do?.. turn ON or turn OFF the lights… it cant do both.

You log show the automation enabled and not disabled. Try checking it again making sure the automation is disabled and remove one automation entity from option 1 or option 2. If there is no entities in the bypass when you remove one make sure you disable it including the auto OFF.

Also note you have a scene in ‘Scenes - Scripts To Turn OFF’ but you are using a light entity. You can have a scene there as it may be turning on a scene but I thought I would just ask / point that out.

Blacky :smiley:


You are using an area in ‘Lights - Switches - Scenes - Scripts’. You can’t do that as it only works with entities. You will need to expand it down to entities (all green not orange or blue).

This FAQ shows you how to do that Click Here.

Blacky :smiley:

Hey @Blacky i did the changes Yeah the bypass for options 1 & 2 was a stupid mistake from my side but still, i don’t think there is anything wrong with the config below funny part is that if i comment all the bypass things it will work
maybe I don’t understand what bypass does because what I want to achieve is pretty simple pause the automation for let’s say 20minutes keep the light on and after 20 minutes resume the automation I could do it outside of the blueprint but I think that’s what the bypass is for, still I don’t understand why it isn’t working at all motion is detected ofc there is less lx than I set the minimum nothing happens if I press the button I’m lost :smiley: here is a full tracklog maybe you will see something https://pastebin.com/wjUXg287

alias: Korytarz2
description: ""
  path: Blackshome/sensor-light.yaml
      - binary_sensor.senorruchukorytarz2_occupancy
      entity_id: light.yeelink_colorb_e50e_light
      - scene.korytarz2off
    time_delay: 1
      - use_brightness
    include_dynamic_lighting: disable_dynamic_lighting
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.senorruchukorytarz2_illuminance_lux
    ambient_light_options: ambient_light_option_disabled
    ambient_light_high_value: 370
    include_night_lights: night_lights_enabled
    night_time_delay: 0.5
      - use_brightness
      - time_enabled
    night_lights_after_time: "23:00:00"
    night_lights_before_time: "07:00:00"
    light_brightness: 80
    ambient_light_value: 10
    dynamic_lighting_min_lux: 10
      entity_id: light.yeelink_colorb_e50e_light
      - bypass_enabled_turn_on
      - automation.korytarz2helper
      - bypass_auto_off_enabled_on
    bypass_time_delay: 10


Yep that what it will do.

I have checked it here again replacing your trigger, light and the bypass with an automation. All worked perfectly.

So lets look at a few things.

  1. We know the light is good.

  2. We know using an automation works, as long as you are toggling it ON and OFF (Enable / Disable).

  3. The trigger… the automation needs this trigger to work. Lets look at this. Can you create a toggle helper and add the toggle helper as the trigger only so copy the toggle helper ID go into the YAML and replace your “binary_sensor.senorruchukorytarz2_occupancy” id with the toggle helper ID and click save. You should only have the toggle helper in the trigger. Now test it again. If it works then we need to look at your “binary_sensor.senorruchukorytarz2_occupancy”.

  4. If that still doesn’t work then put back your “binary_sensor.senorruchukorytarz2_occupancy” removing the toggle helper and then use the toggle helper in the bypass. Toggle it ON and see what happens, toggle it OFF and see what happens. You may want to reduce both the bypass minutes to “0.1” for speed of testing.

Blacky :smiley:

New update 6.8

Your lighting experience, your way – take control and customize it to perfection! :bulb::sparkles:

In this update, we focused exclusively on dynamic lighting bugs. Below are the changes we have made. Hope you like it :smiley:


  • New Input Option :new:

    • Dynamic Lighting - Toggle Helper: If you have chosen a brightness level of 0%, then it’s essential to create an independent toggle helper and enter into dynamic lighting. This toggle helper can also address issues if the automation doesn’t behave as expected due to the occasional unavailability of light entities. While it may not always be necessary, if you’re open to creating toggle helpers, it’s highly recommended to utilize this option to ensure proper functionality of the automation.
  • Bugs Fixed :bug:

    • Fixed bugs in option 8.
    • Fixed bugs when using options 1, 2, 4, 5, 6, 7 or 8 and setting a brightness level of 0%. Dynamic lighting would stop and not come back ON. There is now a new toggle helper that is required when setting a a brightness level of 0%.

If you like this blueprint? Consider hitting the :heart: button in the top post :+1:

If you like my blueprints, and would like to show your support or just say thank you? Click Here :smiling_face_with_three_hearts:


Blacky :grinning:

Can you elaborate a bit more on toggle helpers?


When you set up dynamic lighting with a brightness level of 0%, the light will turn off. Dynamic lighting relies on the state of the lights being “ON” to function correctly. If the lights are not detected as “ON,” dynamic lighting stops, which is not desired. By using a toggle helper, dynamic lighting will monitor the toggle helper’s state instead, ensuring it continues to run. This is why the toggle helper is necessary only when setting a brightness level of 0%. Toggle helpers in Home Assistant are reliable and don’t get lost on the network. If a light drops off momentarily when dynamic lighting checks the state, it can cause dynamic lighting to stop. Using a toggle helper ensures consistent functionality without relying on network connections.

Blacky :smiley:

That’s a pretty cool change. Thanks again so much Blacky. I had my minimum light brightness go down to 10% under Dynamic Lighting - Min Brightness Value. I am using option 4. Is there a benefit to lowering that to zero and adding the toggle helper?

I would urge everyone here to make a small donation. The support for this popular blueprint is second to none. Please support Blacky at:

Blacky’s Donation Link

And Blacky, I see they finally created the ability to collapse Blueprint sections. that will be great for Sensor Light as it has so much packed into it. I assume that we will have that new version soon after 2024.6 is released. :slight_smile:


Hi Harry,

Your welcome.

No, it will change the way DL works, and that might not be what you’re looking for. If you set it to 0%, then your light will/can turn OFF. Setting it at 10% means that it will be the lowest brightness value the light will have when your trigger is activated.

Because you have set it to 10%, you don’t need to use the toggle helper for DL to work. I have written the code this way so you don’t have to add a toggle helper, and it won’t break what you had before updating the BP.

If you have chosen to use a brightness value of 0% because you want the light to turn OFF, you must use a toggle helper for DL to work correctly.

I am fully aware of this. This is why we love Home Assistant: they listen to us :+1:. When I say “us,” I mean the whole community. Once the new HA is released, I will implement it here. I will then go through it in detail, test it, and report any bugs to HA. This could take some time if we find any bugs. A big shout-out to @karwosts for developing this :kissing_heart: THANKS!

I prefer to wait and allow everyone time to update their HA, as it will break the Blueprint if you are not on the latest version of Home Assistant. We want to avoid that if we can, trying to be responsible. Hopefully, when it is released, it will be a smooth transition for all and a pleasant experience.

Thanks for your patience.

Blacky :smiley:

Thanks Blacky ! I changed it to a specific light and that worked out ! I thought it was only applicable for the trigger to be an entitiy and not for the target :blush:

Thanks a lot for this great blueprint !

@Blacky I don’t know what to say i went fresh and deleted all the automation that I’ve made from blueprint imported 6.8 and it just worked… something somewhere was not happy about the setup :smiley: Thank you keep up the amazing work


Nice one :+1: thanks for letting us know.


That’s good news I am glad you finally got it working :+1:


Blacky :smiley:

@Blacky Hi and thanks so much for the excellent blueprint!!!
Im on 6.8 with a very basic setup and seeing some very strange night light behavior, hoping you can help…
I have a single mmwave presence sensor as a single trigger.
I have 3 smart bulbs in a HA helper light group (all entities - on)
Normal automation is mmwave triggers the group including color temp+brightness, .5 delay (this all works perfectly)

Nigh light is triggered by time+entity state (same mmwave) → a single smart bulb from the group of 3 mentioned above including color temp+brightness, .5 delay

The problem is, when the night light is triggered, it works as expected until the .5 delay ends. Instead of turning off, the other 2 bulbs turn on, then there is another .5 delay, and then they all turn off.

This same setup worked in 6.3. Also I did already try deleting and recreating from scratch.

No scripts/scenes/or any other features of the blueprint are being used, very basic config.

Any assistance would be greatly appreciated!

Thanks in advance,


Hi Sam, and welcome to the community.

Thanks for reaching out. Without seeing your YAML it is a bit tricky to resolve but I give it a shot.

This part concerns me. Do you have your mmWave (your trigger) also included in your night light state? If so, please remove your mmWave sensor from the night lights and disable the night light state condition and just use the time condition. Your trigger for the automation works for both normal lights and night lights.

TIP: When grouping lights, using just one light from that group in night lights can cause a flicker problem if you are using the “If lights are ON, adjust the lights when crossing over” option in night light control. While you can use light groups, I recommend entering all three lights separately. This way, you don’t need to group them, and it will work as designed.

What happens is when it transitions from normal lights to night lights (and vice versa), the automation checks which light you are using for normal lights and which for night lights. It then knows what to do and only turns OFF the lights that are required. When you group them, it sees the group as one unit, so it will turn OFF the single light you are using for night lights because it is in the group, then turn it back ON instantly, causing the flicker.

The BP does so many things, and the idea is that you never notice.

If your still having a problem then could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.

Let us know how you go.

Blacky :smiley:

Hi @Blacky ,

first of all thanks again for your blueprints, they are amazing and I am using three of them for a couple of month now. Amongst others, I use the Sensor Lights blueprint in my bedroom, i.e. controlling my bedroom‘s ceiling light with a Hue motion sensor, while the ambient lux option enabled. Works as it should, so far so awesome! Even my wife does not want to miss the home automation anymore :smiley:

Now, I wanted to take the automation to the next level and also turn on the ceiling light, when I open any of my three wardrobe doors. I installed contact sensors on each of them and created three separate Sensor Light automations for each wardrobe door which turn the ceiling light on when the respective door is opened and off when it gets closed.

Unfortunately, when two doors are open at the same time and I close one of them, the ceiling light turns off. That is of course not what I intended and can be really annoying. As you can imagine, I want to keep the light on as long as any of the three doors is open.

TO achieve this, I thought I could add all three contact sensors to my regular Sensor Light automation (the one that only was setup to work with the motion sensor) and also setup a toggle helper “wardrobe open” and add it as an entity to the Sensor Light automation so that the helper gets toggled on whenever I open any of the three doors but the blueprint does not let me add helper entities to be turned on under “Lights - Swtiches - Scenes - Scripts”.

Do you (or any other member) have any hint on how I could set up the automation to achieve my goal of a turned on ceiling light as long as any of the doors are open?

Thanks and helpis so much appreciated!


Your welcome glad you both like it.

What you need to do is create a group helper with all your door sensors and use that as the trigger. If any door is open it will be ON and all have to be closed for it to go OFF. Click Here on how to create a group helper.

I do have a question… is the ceiling light the same light you use in your regular sensor light?

Also have you had a look at this blueprint? :door: Closet, Pantry, and Cupboard Lighting

Blacky :smiley:

@Blacky thanks so much for the warm welcome and the extremely quick response!!!

Yes, you are correct, I did have the mmwave trigger in both the parent automation and the night light subsection. I have removed mmwave from night light leaving only the time trigger. I apologize for bugging you with a silly mistake! I work in IT for many years and did try to be self sufficient :slight_smile: I did make an effort to read both your how to docs and FAQ but apologies it was not clear to me that night light inherited any triggers in it’s parent.

Also, thanks for the tip about grouping! I’m currently using a separate automation to sync the state of some wall switches to the state of the lights and that requires my grouping to creatively get it all to work. I do have plans to start playing around with your bypass functions tied to those switches instead, but I was working on night light stuff first.

Thanks again for the help!! :smiley:

Thanks for the quick answer :slight_smile:

I have not seen the fairly “new” blueprint :door: Closet, Pantry, and Cupboard Lighting but wow, it is almost what I need! Just tried it and it works like a charm, so that could work in general.

However, to answer your question: the ceiling light is the same that turns on via the regular Sensor Light automation as soon as the motion sensor is triggered. I am using the ambient lux option and also set a toggle helper “bedtime” as Bypass Switch - Turn lights OFF so the lights will not turn on while I am asleep.

Now, I would love to have my ceiling light in the bedroom behave in the following way including the wardrobe doors:

  • light does turn on when motion is detected and the ambient lux is below the threshold and the other way around (works via Sensor Light)
  • light does not turn on, when I am asleep, i.e. bedtime helper is active (works via Sensor Light)
  • light does turn on when I open any of the three wardrobe doors but ambient lux is above threshold and “bedtime” helper is off
  • light does not turn off when it has been turned on by motion an I close any of the wardrobe doors
  • light does turn on to 20% brightness when bedtime helper is active

Now that I am writing this, I guess I would only need a night option in your :door: Closet, Pantry, and Cupboard Lighting blueprint and use the bedtime helper as the trigger to activate the automation’s night mode?

BTW: Using a group helper and adding it as the trigger to the regular Sensor Light automation did not work during the day. I guess because of the ambient lux threshold…?



Thanks for letting us know. Glad you are up and running and I am more then happy to help.

Your welcome.