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

did you find a solution

No. The motion component of this blueprint triggers the lights to turn on and off but the dynamic lighting doesn’t want to work.

1 Like

Hi @Blacky I have one issue with this automation, I was wondering if this setup is possible in the configuration, because just looking at the options I cannot figure it out.

I would like the automation to only turn OFF the light, when it was also turned ON by it. If the light was turned on manually with a button, or from the Home Assistant UI, then it should stay on after motion is no longer detected.

This is similar to using a bypass option, but not quite.
I’m using a desk lamp as a night light in my bedroom, but the lamp has it’s own button it can be turned on with:

The issue I have right now is that I will turn the lamp on manually when I’m at the desk, then if walk around the room (triggering a motion sensor) and sit back down, the lamp turns off.

This could be solved by having a condition added to the trigger that the lamp is off, but I don’t see a way to do that in the configuration.

Thank you ! When you say, if your remote has an independent switch, do you mean a remote that controls the room lights, but has a free/not used button ?

I must say your blueprint is amazing, and i did not explore all the possibilities yet. This saves so much time and efforts.

@mrw2828 & @Adaaks

I have tested it here and it is working. What cold be happening is your lux sensor is not reporting enough. For Dynamic lighting to work it must have data from your lux sensor. Some lux sensor report every 10 - 30 min and some report on 5% change. This will not work. See the FAQ on more information.

Q: Can you provide more information on how dynamic lighting works?

A: Please Click Here.

Could both of 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.

Blacky :smiley:

FAQ - By-pass 101

The By-pass

The bypass feature offers three options for manual control: turning lights ON, turning lights OFF, or maintaining the current state (pause). You can enable any combination of these options based on your preference.

One common question is whether a light switch can be used as a bypass. The answer is no. When the automation triggers the lights ON, it also activates the light switch. If the light switch is used as a bypass, it will disable the automation every time it’s triggered, rendering the automation ineffective.

The term “bypass” was chosen for clarity. While other terms like “Helper” or “Input Boolean” are technical, “bypass” is a common English word that’s easily understood. It’s important to note that the bypass feature isn’t limited to Input Booleans; it can be any entity with an ON/OFF state, including binary sensors.

How to Create a Bypass Without Using a Physical Switch and Add It to a Dashboard:

  1. Navigate to Settings > Devices & Services > Helpers.
  2. Click on the “Helpers” tab, then click “+ CREATE HELPER” and select “Toggle.”
  3. Enter a name for the helper, such as “Sensor Light Bypass,” and click save.
  4. Return to the automation settings.
  5. In the “Use The Bypass Options (Optional)” section, select an option you’d like to use.
  6. In the corresponding “Bypass Switch” field, search for and select the name you created earlier (e.g., “Sensor Light Bypass”).
  7. Click save to apply the changes.

How to Add a Bypass Switch to a Dashboard:

  1. Open your dashboard and click “Edit dashboard.”
  2. Click “+ ADD CARD,” then choose “Button” or “Entities.”
  3. In the entity field, search for the name (entity) you created earlier, such as “Sensor Light Bypass.”
  4. Click save to add the card.
  5. Click “DONE” to finalize the changes.

You now have a “Sensor Light By-pass” switch to disable the trigger sensor of your sensor light automation.

THE SETTINGS

  • Use The By-pass Options (Optional).
    Select if you would like to enable an option. Each option allows manual control of your lights but alters its behaviour by either turning ON, OFF, or keeping its current state when the bypass is switched ON. When enabling an option, please enter the bypass switch into the corresponding input below.

  • By-pass Switch - Turn lights ON.
    Select the switches that will turn your lights ON, bypass the trigger sensor, and allow your lights to function as normal. Please note that the entity cannot be included in the ‘Lights - Switches - Scenes - Scripts’ or ‘Night Lights’ selections.

  • By-pass Switch - Turn lights OFF.
    Select the switches that will turn your lights OFF, bypass the trigger sensor, and allow your lights to function as normal. Please note that the entity cannot be included in the ‘Lights - Switches - Scenes - Scripts’ or ‘Night Lights’ selections.

  • By-pass Switch - Keep The Lights Current State.
    Select the switches that will keep your lights current state, bypass the trigger sensor, and allow your lights to function as normal. Please note that the entity cannot be included in the ‘Lights - Switches - Scenes - Scripts’ or ‘Night Lights’ selections.

  • By-pass - Time Delay.
    This is only used in two bypass scenarios; when the lights are already ON and when the automation turns the lights OFF. The first scenario occurs when you have selected option 2 above to “Enable the Bypass - Turn lights OFF”. The second scenario occurs when you turn the bypass OFF, the trigger sensor is OFF, and your lights are ON. In both scenarios, the automation will turn your lights OFF after the set time delay.

  • Use The By-pass Auto OFF Option (Optional).
    This is used when you turn ON the bypass and want it to automatically turn OFF after a set time delay. You can choose which bypass option you would like to apply the auto OFF feature to

  • By-pass Auto OFF - Time Delay.
    Set the bypass auto OFF time delay. The time delay starts from the last bypass that was turned ON.

By-pass Examples

Use By-pass in the UI (Dashboard).

If you have a physical switch then you can just enter that switch in to the UI (dashboard). If you don’t have a physical switch then see above “How To Create A By-Pass Without Having A Physical Switch”.

Use Bypass With A Local Switch.

Is there a way to disable the automation when you manually turn the light ON with a physical local switch? The answer is Yes.

I will explain two possible options but there are more.

Option 1

Use an independent physical local switch that reports to Home Assistant (HA). So when you turn it ON and OFF HA can see this state change. This switch is not connected to your lights. The only function is to report a state to HA. You would then;

  1. Select option “1 - Enable the By-pass - Turn lights ON”.
  2. Enter the switch into “By-pass Switch - Turn lights ON”.
  3. You also can set the “By-pass - Time Delay”. This controls what happens when you turn the switch OFF. If no motion is detected (Trigger is OFF) then it will start the time delay and turn your lights OFF. If you would like it to go OFF instantly then set the time delay to “0”. If motion is detected when you turn it OFF then the automation will simply run as per normal and your light will turn OFF when no motion is detected and the time delay has passed. This is why it is nice to set a delay as it allows time for the motion sensor to detect motion before turning OFF the lights. It stops them turning OFF and then back ON again.
  4. Can also use the By-pass Auto OFF Option. If you forget to turn it OFF.

Now when the switch is turned ON the automation will be disabled and your lights will come / stay ON.

Option 2

Use an existing switch that controls something else that reports an ON and OFF state to HA. Could be an existing light not used in the automation. Then use that light as your by-pass so when you manually turn that light ON it turns the by-pass ON keeping the rest of your lights ON. You would then;

  1. Select option “1 - Enable the By-pass - Turn lights ON”.
  2. Enter the switch into “By-pass Switch - Turn lights ON”.
  3. You also can set the “By-pass - Time Delay”. This controls what happens when you turn the switch OFF. If no motion is detected (Trigger is OFF) then it will start the time delay and turn your lights OFF. If you would like it to go OFF instantly then set the time delay to “0”. If motion is detected when you turn it OFF then the automation will simply run as per normal and your light will turn OFF when no motion is detected and the time delay has passed. This is why it is nice to set a delay as it allows time for the motion sensor to detect motion before turning OFF the lights. It stops them turning OFF and then back ON again.
  4. Can also use the By-pass Auto OFF Option. If you forget to turn it OFF.

Now when the other light is turned ON the automation will be disabled and your lights will come / stay ON.

Use The By-pass To Turn ON And OFF All Your Lights.

You can utilize the by-pass to toggle your lights on and off by selecting either option ‘1 - Enable the By-pass - Turn lights ON’ or ‘2 - Enable the By-pass - Turn lights OFF.’ Once configured, you can employ the same by-pass in multiple automations for convenient control. Activating the by-pass triggers all the associated automations, turning them all ON or OFF simultaneously. After activating it, you can manually deactivate the by-pass or utilize the by-pass auto-off option.

Use the by-pass linking to my other automations.

This can be done with most of my blueprint. I will provide links below to them so you can see how they work. More information can be found there.

:infinity: Sensor Light Add On - Media & Movie Lights - House Alarm Lights - Smoke Alarm Lights & Exhaust Fans + More Utilize this blueprint to create a movie mode, utilizing the by-pass as a link. For more detailed information, click here.

:shower: Bathroom Humidity Exhaust Fan The automation link can utilize the by-pass to keep the lights on during a shower. For more information and details on my full setup of this automation, click here.

:calendar: Calendar Notifications & Actions The by-pass can be utilized in this blueprint to enable different sets of lights for various calendar events such as Halloween, Christmas, New Year, Sporting Days, Easter, Parties, etc. For more information, click here.

:round_pushpin: State Notifications & Actions Similar to a calendar event but use a state change.

Conclusion

Hopefully this has given you enough information so you can better understand the power of the by-pass. Now it is up to you and how you would like to use it.

Enjoy

Blacky :grinning:

Back to FAQ: Click Here

Back to “The Settings & Best Practice Guidelines” Click Here

2 Likes

@Asalas88

Can you provide us the condition you would like to use.

Blacky :smiley:

@Anaconda

No problem, happy to help.

You talked about using your remote… and this remote turns the light ON and OFF. If your remote has a spare button / switch that when you push it HA see and ON and OFF state. This spare button / switch controls nothing. If you have this then you can use that button / switch on your remote to turn the by-pass ON and OFF. You would then put that button / switch into the automation. In the automation you would select “1 - Enable the By-pass - Turn lights ON” and enter that button / switch entity into “By-pass Switch - Turn lights ON”. Now when you turn ON the by-pass using that button / switch the light will come ON and stay ON (unless you manually turn it OFF). When you turn it OFF the automation will evaluate your site conditions and prereform the correct action. You all so have a “By-pass - Time Delay”. When your turn the by-pass OFF if no motion is detected the time delay will start and turn your light OFF. So if you would like it to go OFF instantly then you would set the “By-pass - Time Delay” to “0”. Now you have a button / switch on your remote that will work like an sort of dumb light switch.

Hope this make sense

Glad you like it and thanks for your kind words. :smiling_face_with_three_hearts:

Blacky :smiley:

Thank you, I think I understood, but will have to try to be sure. So many options, You rock !!!

1 Like

Thanks, @Blacky . It does look like the lux sensor probably only reports when it detects a change, so that seems likely to be the problem. Do you have a lux sensor recommendation?

Here is the YAML just in case it is a code related issue

alias: Sensor Light office
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.lumi_lumi_sensor_motion_aq2_motion
    light_switch:
      entity_id: scene.office_work
    time_delay: 15.5
    include_light_control: []
    end_scenes:
      - scene.office_office_off
    include_dynamic_lighting:
      - enable_dynamic_lighting_brightness
    dynamic_lighting_lux_sensor: sensor.lumi_lumi_sensor_motion_aq2_illuminance
    dynamic_lighting_max_lux: 300
    include_time: time_enabled
    after_time: "07:00:00"
    before_time: "18:00:00"
    dynamic_lighting_heartbeat: 1

Hey @mrw2828, I happen to have the same motion sensor, and yeah the lux meter on that motion sensor is extremely unreliable.

I’d recommend an Aqara T1 Light Sensor to complement your setup, been working flawlessly for me for a year now.

I think just the condition that the light is off when motion is detected would be enough to solve my issue.

If the lamp is already on, the automation doesn’t trigger and doesn’t start the timer and turn the lamp off.

But I’m not sure if that wouldn’t mess up reseting the timer. If the automation triggers and then motion is detected on and off while the lamp is on, it should extend the time

@mrw2828

Hi Matt,

If that is the case then that will be okay. Let try to get it to work with what you have first, if your not happy then you can look into another lux sensor. Even 5% may be okay just realy depends on your range and how it works (fade in fade out).

All your settings for “Dynamic Lighting” are good. The good news is I can see your are using a scene… this is where the problem is as dynamic lighting will not control a scene. You will need to remove the scene and add entities. Dynamic lighting will only work with light (domain) entities.

Let us know how you go.

Blacky :smiley:

1 Like

@Asalas88

Yes this will not work. I have gone down the rabbit hole on this before and always find there are a few things that just don’t work. The are so many options and they all have to work together. I will look at it again.

Don’t under estimate the power of the by-pass. I would recommend that you have a separate switch. You could even use a Shelly BLU Button1 (note, I don’t have one so I can’t recommend it) or something similar or ESPHome so you have a nice independent switch. Keep it in your desk draw. Then use option 1 in the bypass (Turn lights ON) with this button when you would like to manually turn it ON. You will then also have and auto OFF option if you forget to turn the light OFF and a by-pass time delay when your turn it OFF allowing you time to walk out of the room or time to trigger the motion sensor again. I think if you do this you will see it is a realy nice feature.

Blacky :smiley:

I have an issue with a hue motion sensor in a bathroom, I have created a bypass input boolean entity for the dashboard, however, as soon as I enable the option “by pass , keep the lights current state”, the lights are no more turned off when no motion even if the bypass is not activated (only the option is enabled). For information, the lights to be turned on/off in the bathroom are added in the adaptive lighting integration. Any idea plz what could be the problem ?

I have the same setup for the room with the fp2 and no issue with it (No adaptive lighting for these, which are connected to HA through Hue Hub). The problem is only for the bathroom.

@Anaconda

If you turn any of the by-pass ON, then the automation will be disabled. You can manually turn the lights ON and OFF but if the by-pass is ON the automation will not run. When you turn the by-pass OFF then the automation will run. Regards to adaptive lighting integration, I don’t use it and never have so I have no idea.

Blacky :smiley:

Ahah, thanks @Blacky. I will try replacing the scenes with the lights and report back!

@Blacky it works!!! Thanks again for the support and for making this.

Hi, very nice blueprint, thanks for your great work :+1:

One question: currently, if sunset for the nightlight mode is active, the light changes if there is another scene selected for the night. Is it possible to only switch to the nightlight scene if the motion sensor is activated the next time, not when light is still on from before sunset?

i also noticed a change from 4.8 to 4.9 in sun conditions.
now my lights at the dining table sometimes turn off with the trigger condition sun. (whene we are eating)
4.8 worked perfectly.