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

I do this with my bathroom. You'd set the night light part using the 'enable time' to between 11 and 5, then under the night light setting set the brightness to 20%. It can be slightly overwhelming with enabling the right options but just work through the sections systematically.

1 Like

Ok so we all know how easy it is to go down rabbit holes when dealing with HA. Well only just an hour ago, i discovered what Blueprints were all about.

Didn't take me long before I found this one for exactly what I was needing for my garage lights. I had two automations to turn them on and off and even then, I'd be left in the dark most of the time. I thought adding another presence sensor (with an suv in there, it's easy to be out of the line of sight) but NOPE!

Your blueprint INSTANTLY solved everything in ONE automation!! I'm even able to have the lights go off almost instantly when I leave the area and using the bypass option lets them stay on as long as the presence sensors saw me!! THANK YOU!!!

I love options and I haven't even scratched the surface of what this can do! It might finally make my kitchen/dining/living room automation become more accurate and reliable! Had to turn those off because the wife hated being in the kitchen and the lights go off! :grimacing:

Now that I got it down, should't be long before I have the whole house set up! :clap:t5: :clap:t5: :clap:t5:

Side note: I can't seem to use my Meross Smart Garage opener as a trigger. It only shows the "problem" entity which obviously isn't what I want.
Just realized that the Garage opener is considered a cover class. Would it be possible to add this or can I just create a helper to trigger it?

@jrm523

Yeah this is a light thing not the blueprint. The automation ask for the light to be turned ON at a lower brightness lets say 5% but last time the light was ON it was 100%. So the light goes 100% to 5%. I think light manufactures like to do this so when you tun the light OFF and then back ON it resumes it's last brightness state.

All not lost though. In the light control option you can opt to select the Dim Before OFF Option. You then dim the light/s to your night light value say 5% and can use like a 1 to 2 second Dim Before OFF - Time Delay so it will just look like the light is turning OFF normally. Now when the lights turn back ON at night they will go to 5% first and you wont get that flash.

Let us know how you go.

Blacky :grinning_face:

@harryfine

Hi Harry, hope your doing well.

First

Claude is wrong, it is triggered instantly always on the trigger, no cooldown no blocking. I don't know these sensors but normally the timeout is the once the sensor stops detecting motion it will wait for that time normally seconds in this case before it will report a clear state.

If you like me to look at your automation then please send the YAML of your settings. 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.

Blacky :grinning_face:

@mbanse

  1. You just add the script to Lights - Switches - Scenes - Scripts make sure you add a Scenes & Scripts - Toggle Helper and a Scenes - Scripts To Turn OFF.
  2. You can set your lights in light control as long as all you light will be the same. Use scripts if you want more control to what happens (like time of day = X) or scenes if you want your lights all different colours.

Blacky :grinning_face:

@goldriver

You can use it but the blueprint pulls everything apart and makes lists of Lights - Switches - Scenes - Scripts so all the actions will be for the domain. So if you like to turn ON a input_boolean make a scene that has it ON and a scene that has it OFF.

Now if you are turning on any Lights - Switches - Scenes - Scripts already and you would just like to turn ON one input_boolean then you can add that into Scenes & Scripts - Toggle Helper. If your only using a Scenes - Scripts then you need to add a toggle helper into Scenes & Scripts - Toggle Helper.

Hope this helps you.

Blacky :grinning_face:

@noloboy

The bypass must have an ON / OFF state as the automation looks at it throughout the code. Buttons don't have an ON / OFF state and they normally just fire an event therefor there is no way for the automation to reference (know) if the button is ON or OFF. If you like to use a button you need to have the button produce a state. Some manufactures will do this in their settings (make a button change state) and some don't. If yours doesn't do this then you need to make your button toggle a toggle helper and then use that toggle helper as the bypass.

Blacky :grinning_face:

@allflame

If you are using night lights and or glow lights then you need to add your light in the input. It should not be empty. If your just using the glow light option then add your glow light to night lights and set the same glow brightness. You should never have none and it will work.

Blacky :grinning_face:

@Sushibomba

You have a few options that will stop it.

  1. You have enabled Sun Elevation. This must be true before it can turn ON a light.
  2. Ambient You have selected YES - My Ambient Light Sensor is affected by the Lights this means that your high lux at 120 is disabled. Once the light is ON it will disregard your ambient sensor and wont turn OFF if your lux goes above 120. If you like to use the high 120 then select NO - My Ambient Light Sensor is not affected by the Lights. If you do this then once your lights are ON have a look at your lux sensor and see what value it is when it is dark outside. Then set your high lux value a bit higher to keep your light ON.
  3. You are using Device Tracker option. One of the people must be in the zone for it can turn a light ON.

Just because your ambient is below 100 it doesn't mean your light will turn ON. Sun elevation and device tracker must be true (ON) for it to tour ON. All 3 conditions being Sun elevation, ambient and device tracker must be true (ON) for it to tour ON.

To test this, disable sun elevation and device tracker and then only ambient needs to be below 100 for the lights to turn ON.

Hope this helps you.

Edit: Can you let us know how you go and if you got it working now. Thanks for your help.

Blacky :grinning_face:

@fixer

Thanks for reaching out.

I am currently on 2026.4.4 and it works perfectly, just tested it again.

Blacky :grinning_face:

@ryanmccullough

I will have a look into this. Thanks for doing all the testing and reporting well :+1:

EDIT: I have tested this and confirmed it is correct. There will be a new release with this patch applied. Thanks for your help.

Edit 2: I have also had to update more of the code as the brightness value would not be correct when this happens.

Edit 3: I have now completed the testing and although your code pointed me in the direction of the problem is also caused another problem with brightness. I have updated the code now that is clean and should resolve the bug.

Blacky :grinning_face:

@Bu66as

Thanks for confirming you have the same issue. I am looking at this issue.

Edit: This has now been resolved and will be in the next release. The code suggested worked but broke brightness so please update to my next release so you won't have problems.

Blacky :grinning_face:

@Siggi1

You would have to do that in a separate automation.

Blacky

@MaxLa

Why not just use this one automation and use the night glow to turn your light ON at 30% at sunset and back OFF at sunrise.

  1. Enable night light and set the **Night Lights Conditions ** to Enable sun elevation option.
  2. Enter in you light into Night Lights and set the brightness to 30%.
  3. Enable Night Glow set up your lights again and to 30%.

Now you have one automation that will turn your light ON to 30% at sundown and OFF at sunrise but will work throughout the day according to your normal lights.

Blacky :grinning_face:

@bateremps
So what happens when someone comes home. Does your boolean turn ON and stay ON.

Maybe look at my :on: Switch - Turn ON & OFF Entities blueprint. The switch is your boolean and the Main entity is your lights. Then set the Main Entity - Time Delay OFF.

Blacky :grinning_face:

@AndyMUK

You could look at my :on: Switch - Turn ON & OFF Entities blueprint but it may be quicker to just do an custom automation.

Blacky :grinning_face:

@johntdyer

You need my Closet, Pantry, and Cupboard Lighting blueprint. It is designed for this and use the motion sensor option.

You can also have night lights.

Blacky :grinning_face:

@mariomaz87

The state control is a condition.

I am assuming you want the light ON so you have some time to get into bed and then the light turns OFF. You need to look at the bypass but when the bypass is ON the automation will be disabled and when OFF it will be enabled. Bypass option 2 has an additional option so when you turn the bypass ON you have a Bypass - Time Delay this delay will keep the light ON for X (time you set) before it turns the light OFF and disables the automation. I think this is what your looking for.

Blacky :grinning_face:

@Sushibomba

I think I just answered this today.... sorry for the delay I have been so busy lately.

Blacky :grinning_face:

@jrdee

This would probably be a script for **Lights - Switches - Scenes - Scripts **. The scrip would be if TV is ON the light OFF else light ON. Then when night lights are activated and your lights are OFF it will turn them ON regardless.c

Blacky :grinning_face:

1 Like