πŸ’‘ Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

This is very tricky and I have built a :stop_button: Manual Control Status Tracker blueprint. It's not perfect but it tracks if an automation turn ON the light or if it was manually turned ON. It then turns ON a toggle helper that you can use in the bypass. Maybe have a look at this.

Blacky :smiley:

@ylnest2018

You can have any light you like for normal lights and night lights and it will turn them ON and OFF when night lights become active. The thing you may of missed (a lot of people do) is the option in Night Light Control to enable If lights are ON, adjust the lights when crossing over option. Make sure you select this.

If your still haveing problems then just explain it and 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 :grinning_face:

@Yeeley

The Sun and Time options control when the automation is allowed to run.

Enable the Sun option if you only want the automation to work when the sun is below a specified elevation (for example, when it is dark).

Enable the Time option if you only want the automation to work between the specified Start and End times.

If both options are enabled, both conditions must be true before the light can turn ON.

Because your testing during the middle of the day then the sun will block it from running most likely and the time may be blocking you to depending if your testing before 2pm as per your settings.

Hope this helps you.

Blacky :grinning_face:

@Mgs

I regularly have my hallway lights starting to turn OFF (dimming down) and then I re-trigger it and the lights come back ON. They sometimes never turn OFF but start to dim and then dim back up. Sometimes they just turn OFF and then they come back ON. I use Shelly dimmers and not seeing this.

Once the light is ON, the automation will use light_entities_off to prevent repeatedly sending ON commands to the same lights or switches on every trigger. This helps reduce unnecessary commands, keeps the automation cleaner, and may help prolong the life of your devices.

If this behavior is a problem, you can instead create:

  • one scene with the lights ON
  • another scene with the lights OFF

You can then use the scenes in the automation instead of direct light entities.

The important part is to avoid using a Scenes & Scripts - Toggle Helper, as every trigger would call the ON scene again even if the lights are already ON.

Blacky :grinning_face:

@mr_gimlet

That looks like a HA bug because input_boolean.turn_on is a known action. I am going to update once I get through all these questions. Maybe I wait until 2026.5.3.

Blacky :grinning_face:

1 Like

@MrJester

Thanks for the heads up

:man_facepalming: I hope they haven't done this as I am totally unaware of the announcement. Are you sure it is not just a bug they have. I still see in in there documentation template conditions .

Can anyone confirm this is true.

EDIT: I have just updated to HA 2026.5.2 with no issues at all.

Blacky :grinning_face:

@jmy_crkt

Yep that is 100% possible and the main reason for night lights.

The main thing people get caught on here is they think they have to enable the main Time option. The main Time option is when the whole automation can run including night lights. So your main time condition is probably set to 5am to 11pm. Disable the time condition and only use the night lights time option and set that to start at 11pm and end at 5am. Make sure you also enable If lights are ON, adjust the lights when crossing over in night light control.

Hope this helps.

Blacky :grinning_face:

2 Likes

@buginthesystem

The bypass input needs to be;

  1. Must have an ON/OFF state. Can directly use a button.
  2. Be totally independent, can't be the light unless you use my :stop_button: Manual Control Status Tracker blueprint.

Then you have 3 options on what should happen when your turn the bypass ON.

1 will turn the light ON
2 will turn the light OFF if it is ON.
3 will keep the lights current state whether if it is ON or OFF nothing will change.

Once you decide what you would like to happen when you turn ON the bypass enable that option and then select your bypass switch input to the corresponding option you selected.

That get the bypass working.

Now you have an option for a time delay and the description explains this.

Then you can have the bypass turn OFF automatically so you don't forget to turn it OFF. you select the auto off to the same option you selected above and set the auto off time delay.

Here is the FAQ for the bypass click here

Blacky :grinning_face:

@TheAdrianMc

When you open a garage door you want the light to come on for X and then turn OFF (normally). Then you have a motion sensor to turn the light ON and OFF when motion is detected. All depends on your garage opener and what it reports to HA.

What you can to is have a trigger template binary sensor that will turn OFF in a set time. Click here on the FAQ and look for REF - TS-6. Once you have created that sensor you group your motion sensor with your newly created trigger template binary sensor and use the group as the trigger. Then you will have one automation that will turn ON your light when you open the garage door and you motion sensor will keep them ON when motion is detected.

To answer your question on how to add your garage door opener to the input, copy your garage door entity ID first.

Next:

  1. Open the automation.
  2. Add any entity to the input.
  3. Click the 3 dots in the top-right corner and select Edit in YAML.
  4. Locate the entity ID you just added.
  5. Replace it with your garage door entity ID.
  6. Click Save.

The garage door opener will now work with the automation.

Blacky :grinning_face:

1 Like

Question about using multiple motion sensors for adjacent-room awareness

Hi, thanks for this blueprint β€” really impressive work!

I'd like to ask whether the following scenario is possible with the current setup, or if it would require modification:

I'd like to use multiple motion sensors to control the light in a given room, based on activity in adjacent rooms as well. The behavior I'm trying to achieve:

  • Normal state: Motion in the given room β†’ light turns on at full brightness (as today).
  • Dimmed state: If there has been no motion in the given room for 5 minutes, but motion has been detected in an adjacent room within that window β†’ dim the given room's light to e.g. 50%. The rooms are connected by an open sliding door, so I'd prefer a softer "transition" light rather than going fully off.
  • Off state: If there has been no motion in either the given room or any adjacent room for 10 minutes β†’ turn the light off completely.

So essentially two timers / two states:

  1. 5 min no motion in given room + recent motion in adjacent room β†’ dim to 50%
  2. 10 min no motion in given or adjacent rooms β†’ off

Is this something the blueprint supports out of the box (e.g. by configuring multiple motion sensors and tweaking the dim/off delays), or would I need to either chain two automations or modify the blueprint itself? Any suggestions on the cleanest way to implement this would be greatly appreciated.

Thanks!

@haavard1

Yes you can do this.

You can get as creative as you like using a script and keep it running. That is one good thing about HA, it lets you do anything you like. The script would be used instead of your lights in Lights - Switches - Scenes - Scripts. If your unsure how to make this script there are so many people on this forum that can help. Just start an new topic and ask how can I make this script.

Blacky :grinning_face:

New update 8.6

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

:new: New Features

Dynamic Lighting Update

We have add 3 more option.

  • 14 - Time Controlled - Colour Temp + Brightness Inverted
  • 15 - Time Controlled - Colour Temp + Lux Controlled Brightness
  • 16 - Time Controlled - Colour Temp + Lux Controlled Brightness Inverted

:bug: Bug Fixes

  • Dynamic Lighting
    • If a light is unavailable or unknown, it will now be excluded from calculations so the automation continues running using the remaining available lights. If the light becomes available again during operation, it will automatically be included again on the next cycle.
    • Fixed brightness calculation when a light does not expose a brightness attribute. These entities are now safely ignored in the calculation logic.

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:

Enjoy

Blacky :grinning:

Thanks so much for your response. I did definitely have that setting ticked, I was just finding that if I wanted the same lights to come on at a different brightness at night eg,

Study Downlights - 50% between 08:00-17:00 & 10% between 17:01-07:59 it wouldn’t trigger those lights at night unless I explicitly defined them as a target at night.

This might be by design but from all my reading, if you turn night lights on but don’t specify a different target, it assumes the day lights are your target.

I have it working in this way I mention above by nominating the same target in both sections so it’s not an issue but just curious what the intention is vs my reality.

I've never done it this way round before so please bear with me. I have a sensor light running on motion that shuts off after 5mins, all good. Mrs_G would like to have the light on when the bathroom door is closed (easiest way of knowing if someone is in there longer than a few minutes without moving)

How do I programme this? I can get it do trigger when the door is opened, but not when it is closed. Was thinking of a new automation or as a bypass on the existing motion one.

@mr_gimlet

This is common when you have a bath. I do have a solution for this but you will need a motion sensor in the room and a door contact sensor. I call it "Bee in the Hive".

I point you to some resources. Once you created a bee in the hive sensor you just group your motion sensor with the bee in the hive sensor and use that group as the trigger.

My blueprint :honeybee: Bee In The Hive Sensor. Read this also before starting click here

Extra information on templates click here and look at the first one called bee in the hive.

Hope this helps you

Blacky :grinning_face:

1 Like

I've tried for a couple of weeks now to get this blueprint to behave the way I would expect and I'm just not getting something correct on my end, clearly. I have an ecowitt weather station that is feeding me a LUX value for Dynamic Lighting Control. But no matter how I configure, when they value of the LUX sensor drops below the designated Max Lux Value, the lights never trigger on at all. There is a bypass set to allow the lights to stay at their current values, but it is off during this testing. I don't use large blueprints like this often but I've been using Home Assistant for six years and I know enough to think it should be working and I'm missing something or I've done something wrong I won't easily catch. Would anyone mind looking at the yaml to see if I've missed the obvious? The traces are sadly really difficult to follow here.

alias: "NEW Illuminance Based Kitchen Lighting "
description: >-
  Using the Blacky Blueprint to determine Kitchen lighting based on outside Lux
  readings.
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.kitchen_motion
    light_switch:
      entity_id:
        - light.kitchen_center
        - light.kitchen_left
        - light.kitchen_centerline
        - light.kitchen_middle
        - light.kitchen_right
        - light.kitchen_sink
    include_light_control: []
    light_transition_on: 5
    light_transition_off: 8
    include_light_colour_control: disable_colour_control
    light_colour_temperature: 2700
    include_dynamic_lighting: enable_lux_controled_brightness
    dynamic_lighting_lux_sensor: sensor.solar_lux_fraction
    dynamic_lighting_max_lux: 770
    dynamic_lighting_max_colour_temp: 3000
    dynamic_lighting_step_value: 10
    dynamic_lighting_dead_zone: 5
    dynamic_lighting_state_control: disable_state_control
    include_ambient: ambient_disabled
    ambient_light_sensor: sensor.aqara_fp300_002_illuminance
    ambient_light_options: ambient_light_option_enabled
    ambient_light_value: 30
    ambient_light_low_value_delay: 0.25
    dynamic_lighting_min_lux: 70
    dynamic_lighting_min_brightness: 0
    light_brightness: 100
    dynamic_lighting_max_brightness: 97
    dynamic_lighting_min_colour_temp: 2200
    include_state_control: state_control_disabled
    state_control_activation_state: "on"
    ambient_light_high_value: 100
    ambient_light_high_value_delay: 0.5
    include_dim_before_off: dim_before_off_enabled
    dynamic_lighting_heartbeat: 0.5
    dim_before_off_time_delay: 45
    time_delay: 10
    include_bypass:
      - bypass_enabled_stop
    motion_bypass_lights_stop:
      - input_boolean.light_level_lighting
    bypass_time_delay: 3

Thank you.

Thank you so much for the answer! Tried a bit on a script, but a bit unsure where to start. Do you have any overall suggestion on what is needed on this script?

@Blacky

Should a 09:00–23:30 time condition force occupancy-controlled lights to turn off right at 23:30, even if the room is still occupied?

Still have this issue, which is different to what I'd expected. Is that correct behaviour for the blueprint?