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

Hi, this is my first post in this community.

I use and like this blueprint and have a question about the trigger blocker. Could it be possible to switch (invert) the block state. I mean that the off state block the trigger.

With multiple motion sensors, are the lights turned off after just one is cleared, or after all are cleared?


Hi Detlef, firstly welcome to the community :+1:.

You can but it would be better to keep this format. All will be reviled in a day or two. On how to set up a by-pass see our FAQ: Click Here

If you would still like to do this you can use a template sensor like this,

In the code below to suit you;

  • Change the name of your “trigger_blocker_sensor”
  • Change the friendly name “Trigger Blocker Sensorr”
  • Enter your Trigger Blocker Sensor into here “binary_sensor.your_trigger_blocker_sensor_here”
  • Change the icon if you like.
  • Change the device class if you like.
  - platform: template
        friendly_name: "Trigger Blocker Sensor"
        device_class: occupancy
        icon_template: mdi:lightbulb-alert-outline
        value_template: >-
          {{ is_state('binary_sensor.your_trigger_blocker_sensor_here', 'off') }}

Then enter this into your by-pass and it will be inverted.

EDIT: This code goes in your “configuration.yaml” file. And you must restart HA.

Blacky :grinning:


Hi Chris

Yes, maybe & no. It is a bit technical but when you have multiple motion sensors it is best to group them. This way they will act like one sensor and the automation will work perfectly.

For more information on how to set up group sensors please Click Here.

Blacky :grinning:

1 Like

Hi Blacky,
thank you for the answer and possible solution. I will try to create a template Sensor to invert my Bypass.

detlefh :relaxed:

1 Like

I have release a new blueprint that is an add on to this sensor light blueprint. Make sure you check it out and let us know what you think. Below is the link to it.

Hope you like it.

Blacky :smiley:

Sensor Light Add On - Media & Movie - House Alarm - Fire Alarm + More

Initial release 1.0

New blueprint :partying_face: Hope you like it :neutral_face:

This is an add on for my other blueprints. It can also be used as a stand alone blueprint if you prefer. If I have missed any “States” for the trigger or anything else then make sure you let us know and I will add them in.

Below are some use cases.

  • Media - Cinema Room - Turn ON different lights when watching a movie.
  • House Alarm - Turn ON lights when your house alarm has been activated.
  • Smoke Detector - Turn on lights and exhaust fans when smoke detector has been activated.

The Automation Link Option is done through the by-passes that you will find in my other blueprints so you can take control of your lights if you are watching a movie etc. It then will return to normal once you stopped watching the movie.

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:

1 Like

Is it possible to ad a dim option when the time is running out (no motion detected)?

A lot of times I am in a room and all of the sudden the lights turn of. I would love to seen a option to dim the lights by 50% for 10 seconds (or so) before the lights really turn off. In that case I know I have to move in front of the sensor to get the light up again.


Would the “Transition - OFF” work. It will slowly dim your lights so you know they are going OFF.

Blacky :grinning:

Thanks, I will give that a try!

Hi is there or would it be possible to turn off the lights if the lux level rises above a threshold when the lights have been triggered on but there’s still motion?

I think this is already the case for my light sensors that are not affected by lights.

1 Like


Hi, thanks for asking the question :+1:

Yes, currently it will do this. It will turn your lights ON and OFF with a lux value if the trigger is ON. If you would like the lux level to turn your lights OFF you can’t select “YES - My Ambient Light Sensor is affected by the Lights” in “Ambient Light Sensor - Site Conditions” because this option disregards your lux value once your lights are ON.

For what you are trying to do your selections should be something like this.

Let us know if this works for you.

Blacky :smiley:

Love the BP! I’d like a little tweak to the night ‘sun’ option. I want night mode to always start at a specific time, but use the sun option for the end time. Is that possible?


Thanks for your kind words :smiling_face_with_three_hearts:

Are you asking for it to turn ON and OFF regardless of a trigger? Currently the automation must be active (triggered ON) for this to work.

Example: If normal lights are ON and you have enable sun and time for night lights then the following will work.

Step 1: Normal light must be ON, then if the sun goes is below night setting (Sun Elevation say that happens at 7pm) normal lights still ON, and the time is set to 9pm… when it crosses over at 9pm then the night lights will turn ON.

Step 2: Night lights are ON, then if the sun goes above the night setting (Sun Elevation, say that happens at 6am) and your time setting is set to 10am… then when the sun crosses over at 6am the night lights go OFF and your normal lights go ON.

Yea there is a lot happing in this automation… this is just two scenario and there are so many options… :nerd_face:

Your thoughts?

Blacky :smiley:

Amazingly useful blueprint. Wondering how i would most easily adapt this to return lights to their previous state. I’ve seen the comment regarding bypassing if the light is on as a way of achieving this, however i want to return the light to the original dim state (use case is a front porch light that brightens on movement using this blueprint, and returns to either a dimmed state or fully off, depending on what state the light was in in the first place. The dimmed state is managed with a schedule.


Hi Adam

Thanks for your kind words.

Currently there is no option for this.

I am not sure of what you are trying to do exactly so it this is a bit of a hit and miss… “Dimmed state managed with a schedule” so there is a automation that turns the lights ON to a set brightness and then OFF again (automation 1). Amusing this is at 7pm (ON @ 30% brightness) to 11pm (OFF).

Now we would like to turn the lights on to a higher brightness when motion is detected between 7pm to 11pm and back to 30% brightness.

We will need to create another automation for this (automation 2). Automation 2 uses time from 7:01 pm to 10:49 pm. Note if your delay time is 5 min then set the 10:49 to 10:44. Set the light to 100% brightness or what every you like then create a scene with your lights at 30% brightness and put that scene in “Scenes to turn OFF” Now you lights will go to 100% when triggered and then back to 30% when OFF.

Automation 1 will turn your light OFF at 11pm.

Now if you need something else then you will need to create another automation (automation 3). Automation 3 is set to time and sun. Time is 11pm (or 10:44, you will have to test this) to say 10am and using sun. Set the sun elevation to anything you like. Now this automation will only run from 11 pm to when the sun rises say at 7 am. The 10am is just to make sure it is after the sun rises. You then can have this turn ON and OFF your light.

I know it is a lot but this will do many things.

Not sure if this is what your after but let us know if this works for you.

Blacky :smiley:

I’m proud to be the 600th comment but embarrassed that I still can’t quite understand some of the timing settings.

I have a motion sensor in the shower that both turns on the shower light to 100% and turns on the exhaust fan through a Shelly relay completing the circuit of a low voltage ERV putting it into exhaust mode. I have one automation for that function. When I get out of the shower, it turns the light off after 30 seconds and the shower exhaust Shelly relay off after 5 minutes. Works great

I have another sensor in the main part of the bathroom which normally turns on the main bathroom light when I walk in. However I only run that from 6:01 a.m. to midnight using the time option. Seems to work great.

From 12:01am until 6:00 a.m., I use that main bathroom sensor to turn on just the shower light dimmer switch to 20%, not the exhaust fan, so that if I walk in to go to the bathroom in the middle of the night the shower light comes on nice and dim and is not in my eyes.

So my confusion on the separate shower night light automation is whether I simply use the night light settings, or do I use the global timing settings since no other part of that automation controls any lights.

Last night I set an alarm for myself so that I could see if the automation was working at 3:00 in the morning. Walking to the bathroom, I was surprised to see that the night light was on without me walking into the bathroom.

Any idea?

I think your solution will work for me, after posting I’d been thinking of an approach something along those lines but thought i was possibly making something complex to solve an apparently simple problem. Thanks!!

1 Like

Anyone have an answer?


Normally I check in every day just depends but I try and answer everyone.

All good, better to ask the question as sometime it gives me ideas. Wow we are at 600 :+1: But we only have 90 likes. Maybe we need more people hitting the like :heart: in the top post :blush:

Love your question, realy easy to understand :+1:

So all good here.

We will need to have another automation to do the rest. So you will have 2 in total. 1 for your shower and fan and the other one as shown below. To set this up try this.

  1. Have you sensor in the main part of the bathroom as the trigger.
  2. Select your main bathroom light in “Lights - Switches - Scenes”
  3. Set up any light control you like.
  4. Note: Do not use the time options here as we would like the automation to run 24 / 7.
  5. Now in night lights we will need to enable it.
  6. Enter your shower light in “Night Lights”.
  7. In the “Night Lights - Use The Light Control Options” select brightness and set the “Night Lights - Brightness” level to 20%
  8. In “Night Lights Conditions” enable time.
  9. Set your start time to 12:00 am and your end time to 6:00 am.
  10. Save the automation.

Your all done it should work for you :wink: :+1:

That seems strange. I have a very similar set up here and it has been working. If you would like to test it during the day then try changing the night light time. So say it is 5pm now and your delay is 2 min. For the test change the delays to 1 min (both delays) then set the night lights start time to 5:05pm and the end time to 5:10pm. Now walk in and out at 5:01pm and your main light should go ON and OFF (test 1). Then wait until 5:06pm then walk in and out and your shower light should come ON and go to 20% and then OFF (test 2). Then again walk in and out at 5:11pm and you main light should come ON and OFF. If it all works then you all good. Now just change back your settings. :+1:

Let us know how you go.

Blacky :smiley:

1 Like