It sounds like youâre working with a presence sensor. One solution is to adjust its positioning or detection area to prevent it from detecting incidental motion as you walk by. Another option is to configure a delay before the sensor activates, which is ideally handled directly within the sensorâs settings.
If thatâs not possible, you could create a template binary sensor with a delay_on parameter. The goal here is to avoid triggering an automation when you walk by briefly by introducing a delay before the sensor turns ON. However, this requires careful consideration of timing: for example, if the presence sensor takes 4 seconds to clear but your template binary sensor has an ON delay of only 3 seconds, the binary sensor will always turn ON alongside the presence sensor. In this case, you might need to set a longer ON delay, like 5 seconds. However, keep in mind that a longer delay could result in noticeable lag when entering the room, delaying the light from turning ON when you need it.
Ultimately, the best approach is to refine the motion sensorâs placement and detection area to ensure it only triggers when and where you want it to.
Thats the point. This is an area with a bathtub only. I do not want any lights on during night mode. In fact, if any lights are on, I want them to turn off. I do want them on during the use of the bathtub, which is why I have a separate motion detector and also have a bypass.
Or if your TV bypass is turing the light ON and you would like it OFF then you would use a light in night lights and set the brightness to 0 like this, code below.
Your lighting experience, your way â take control and customize it to perfection!
New Feature
Night Glow - This feature activates a low-level light when no trigger is detected, creating a subtle ambient glow perfect for nighttime use. When a trigger, such as a motion sensor, is detected, the light gradually increases to the night lightâs brightness level, providing enhanced visibility and functionality without abrupt changes in lighting. You can also customize the lightâs colour temperature or RGB colour for added personalization.
Maintenance
Just some code clean up.
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
Amazing thank you for the night glow feature! Quick question, what does this feature use for determining when it is night? Is it the settings from Night Lights (which has separate device/entity selection though). Whatâs also a little bit confusing is you select devices/entities for Lights, Night Lights and Night Glow - what is the difference between all of these for the same automation?
EDIT: with a number of the settings Iâm actually struggling a bit with what seems like should be two simple use cases: the first is I just want lights that turn on at night (e.g. with sun elevation) and stay on until day (e.g. âtraditionalâ night lights with no trigger just on at night), and then lights that use the lower âglowâ level at night and an occupancy trigger (which works if I just keep things simple to just a trigger only) to go up to a higher level. I seem to keep ending up with lights that never turn on at all, turn off entirely after a few minutes or that seem to stay on the entire time and donât seem to use the glow feature at all. Canât entirely figure out the interplay of the various options between trigger (or no trigger if I just want them on at a single level like a classic night light for the night), lights, light control, night light settings, night lights, and night glow to either have all night long night lights or all night long âglowâ lights that increase with occupancy. Iâm also trying to go through the FAQ and guides but havenât sorted this out yet - but perhaps just two examples would really help of these cases.
Looks like you would just like to turn ON some lights at sunset and OFF at sunrise. To do this you will need this blueprint Smart Light. Just set your Trigger - Sun Elevation to Sun Elevation Falling - ON and Sun Elevation Rising - OFF, then adjust the elevation. Then add your lights in and any light control option.
That will turn it ON and OFF at night.
Now if you would like to increase the brightens when motion is detected use night lights. Select Enable entity state option and add your motion sensor to Night Lights - Entity State. Then set the night lights and any night lights control options. Make sure you select If lights are ON, adjust the lights when crossing over in Night Light Control
Now you light will come ON and OFF at night. When motion is detected it will activate night lights and the night lights settings.
@Blacky
Yup, already tested it. For some reason when my phone is on DND the blueprint doesnât register it correctly? I have my bathroom lights using my DND as a bypass and that works fine.
Found this gem and have a question. I understand the trigger, but there are times where I may only want the trigger to turn on one entity, while other times I may want multiple like time of day. I can achieve this with scripts correct? Also based on time of day, I may want additional switches that were turned on manually to turn off. Is this possible?
Example trigger turns on light 1, no motion after 5 mins turn off light 1 and light 2. Light 2 may have been turned on manually and now I want to turn off, but I also donât want to turn it on automatically.
Thanks John, lets go through a few things as we know your DND works in HA because it works in the bypass.
Your trigger has 3 entities, lets try and group these entities into one group. In the blueprint it has a link on how to group them in the description of the trigger. Once you group them just add the group entity into the trigger.
Next just enable the state option in night lights.
It should turn OFF your light once the motion sensor is cleared. Cameras can be tricky, just make sure it clears and then wait for the light to turn OFF. Sometimes when lights turn OFF the camera thinks it is motion so camera settings is critical.
If you are still having issues 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.
Please check it before you post your YAML as the blueprint works and is used by many people.
If we look at this setup you would like⌠add your light 1 in so it turn ON and OFF with a 5 min delay. With light 2, create a script that has this logic, if light 2 is ON then turn OFF. Then add that script into the Scenes - Scripts To Turn OFF in the Lights section. If you find it hard to make this script then you could create a scene with light 2 OFF and add the scene in instead of the script.
Sorry to bother, but could you maybe have a short look at my question. I still did not figure out how to set it up so that lights that have been on before donât get effected by the motion sensor (no changing of the light as well as no turning off).
Thanks a lot!
Sorry I donât know how to quote, so here is my last entry:
Blockquote
Hello, thanks for the great blueprint!
I have a question and I am sorry in case it was asked already.
Is there a way to bypass the automation when some lights are on already? In this case the motion sensor would not turn on or off any of the lights and leave them in their current state. I tried to set the lights as bypass switch (option 3) but as I understand thatâs not how itâs intended and it also didnât fully work.
I want the light to come on between the hours noted, when motion detected and then turn off again after 2 minutes of no motion. Camera is Blink door bell, light is Phillips Hue through a Bridge.
Hi, thank your for your great work on this automation. Every time I look at the traces I thank my lucky stars I didnât have to set all that up
I have an issue where two occupancy sensors control the same lights, through two different automation instances of this blueprint, since one is for when Iâm sitting at the dining table and one is for when Iâm on the sofa, and I want different lighting for both. I tried using the bypass feature to keep current lights when the other sensor is active in both automations, but that only seems to trigger both automations when one sensor detects movement. Am I doing something wrong or is this not the right approach to solve my issue? All I really want is for the light to not turn off if the other sensor is active, since otherwise the other automation activates due to the sensor detecting occupancy, and then the first sensor clears, causing the automation to turn off the lights.
Thanks again for responding. I attempted a script but itâs not working the way I want. Basically the blueprint turns on light A when motion is detected in the room and turn off after 5 mins of no motion. I attempted to write a script that said if light A is on, using the same motion sensor, wait 30 mins without motion to turn off light B.What is actually happening is only light A is turning off and B remains on. Should the script work with this logic? Iâm sure I have something configured incorrectly. In this scenario, B is being turned on manually by someone. Code below and this is tied to the blueprint under Scenes-Scripts to turn off. Do I need to use helpers to make this work correctly?