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

Make the plunge and try it.

No, but the automation will run if a light is ON as that is what we are asking it to do. If you would like to stop / pause the automation then there are by-passes for this.

You can.

It is probably a bit tricky to get your head around it when you don’t use HA. The best way to understand is to try it. It can be a bit confusing at the start but HA have done a lot of work to make it extremely easy to get HA up and running from when I started using it. If your are unsure on how to set it all up, my recommendation would be to get the new Green or a Yellow from HA as it is all ready to go. In time you will upgrade but that is like anything.

@Herr.Vorragend take the plunge into HA, but word of advice TAKE IT SLOWLY, Start small and build it up, it is easier to get your head around it all, that way. There is loads of help in the forum with plenty of people that would be glad to help you.

Hi @andyblac und @Blacky thank you both very much.
We misunderstood each other. I’ve been using HA for several years. And quite extensive. I also create blueprints myself.

EntityController is a custom component to make it easier to implement such complex automations.

I’ll fight my way through the thread.
I think I misread something.
Thank you.

Hmm maybe it isn’t clear to me then

So I can use a single switch to turn the light on before the sensor, and then the sensor will turn the light off when I leave?

Which option sets this?

Yes

Yes if the trigger sensor is triggered it will turn OFF the light. If it is not triggered then the light will stay ON.

There isn’t an option it just works this way :wink:.

If you don’t want this to happen then you use a by-pass switch to turn the light ON / OFF / Pause State (you decide). Then the light will stay ON / OFF / Pause State even if the trigger sensor is triggered until the by-pass turns OFF. When the by-pass turns OFF the automation will evaluate the site conditions. You also have the option for a by-pass auto OFF, and you can also have a time delay you can set before the light will turn OFF when the by-pass turns OFF.

Blacky :smiley:

1 Like

FAQ - Dynamic Lighting Settings

This option aims to make continual adjustments in your lighting setup by modulating brightness according to floating lux values or adapting colour temperature and brightness based on the sun’s changing elevation. Choose from nine preset options available in the dropdown menu.

1 - Lux Controlled Brightness
2 - Lux Controlled Brightness Inverted
3 - Sun Elevation Lighting - Colour Temp
4 - Sun Elevation Lighting - Brightness
5 - Sun Elevation Lighting - Brightness Inverted
6 - Sun Elevation Lighting - Colour Temp + Brightness
7 - Sun Elevation Lighting - Colour Temp + Brightness Inverted
8 - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness
9 - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted

:warning: Please note:

  • Dynamic lighting options are designed specifically for light entities within the light domain. Switches, scenes, and scripts are not compatible with the dynamic lighting options.

  • When using dynamic lighting, the standard ‘Light Control Options’ are available based on your selections in the ‘Light Control Options’. For example, selecting ‘1 - Lux Controlled Brightness’ enables brightness control, while ‘Colour Temperature’, RGB, RGBW, RGBWW and ‘Transition’ remain active if also chosen. Note that ‘Transition’ is always operational if selected, but ‘Brightness’, ‘Colour Temperature’, RGB, RGBW and RGBWW may be inactive depending on your dynamic lighting choices.

Below are three expandable sections depending on what information you are looking for.

Lux Controlled Brightness Settings for Options 1, 2, 8 & 9 (Click Here to expand)

Option 1 & 8 “Lux Controlled Brightness”
This will constantly adjust your lighting brightness percentage to a floating lux value. For example, when it gets darker, your brightness will increase, and as it gets lighter, your brightness will decrease, as shown in Figures 1-1 and 1-2.

Option 2 & 9 “Lux Controlled Brightness - Inverted”
This will constantly adjust your lighting brightness percentage to a floating lux value. For example, when it gets darker, your brightness will decrease, and as it gets lighter, your brightness will increase. It works the opposite way to options 1 and 8. In the graphs shown below, rather than going from high to low, it will go from low to high, as shown in Figure 1-3.

:wrench: HOW IT WORKS

Figure 1-1
The graph below (Figure 1-1) shows the default settings. As the lux value decreases, the brightness increases, and vice versa.

With this setup, when motion is detected and the lux value is equal to or above 400 lux, the lights will turn off (if they were on) or remain off when the automation is triggered because the brightness is set to 0%. As the lux value decreases, the brightness will increase. The lights will start to come on at around 399 lux. I say ‘around 399 lux’ because some lights may require a 1% to 10% brightness setting to turn on, depending on your lights and controller. At 40 lux or below, the lights will be set to 100% brightness

The blue dotted line shows how to read the graph. At 200 lux, the brightness will be around 55%.

  • Max lux = 400 lux
  • Min Lux = 40 lux
  • Max Brightness = 100%
  • Min Brightness = 0%

Figure 1-2
The below graph (Figure 1-2) shows a different setup. In this example, are setting are:

  • Max lux = 500 lux
  • Min Lux = 200 lux
  • Max Brightness = 100%
  • Min Brightness = 60%

With this setup, when motion is detected and the lux value is equal to or above 500 lux, the lights will turn on at 60% brightness. As the lux value decreases, the brightness will increase. When the lux value is equal to or below 200 lux, the lights will be set to 100% brightness.

The blue dotted line shows how to read the graph. At 350 lux, the brightness will be around 80%.

Figure 1-3
The graph below (Figure 1-3) shows a different setup, specifically when using option 2, ‘Lux Controlled Brightness - Inverted.’ In this example, are setting are:

  • Max lux = 60 lux
  • Min Lux = 20 lux
  • Max Brightness = 100%
  • Min Brightness = 20%

With this setup, when motion is detected and the lux value is equal to or above 60 lux, the lights will turn on at 100% brightness. As the lux value decreases, the brightness will also decrease. When the lux value is equal to or below 20 lux, the lights will be set to 20% brightness.

The blue dotted line shows how to read the graph. At 40 lux, the brightness will be around 60%.

Sun Elevation Settings for Options 3, 4, 5, 6, 7, 8 & 9 (Click Here to expand)

Below, you’ll find graphs illustrating the Sun Elevation feature within Dynamic Lighting. These visuals aim to provide a clearer grasp of the settings. As the saying goes, ‘a picture is worth a thousand words.’

By manipulating the proximity between the start and end points, you’re essentially altering the progression of colour temperature or brightness percentage along a linear path from their minimum to maximum values on sun rise or from their maximum to minimum on the suns descent until they reach the rising endpoint or descending endpoint. Changing the closeness or distance between these points adjusts the slope of the linear progression concerning sun elevation. In simpler terms, it influences how quickly or gradually the colour temperature or brightness changes as the sun rises or descends.

"The settings showcased in these graphs were as follows:

  • Max Brightness Value = 100%
  • Min Brightness Value = 30%
  • Max Colour Temperature = 6500 K
  • Min Colour Temperature = 2000 K
  • Sun Elevation Rising - Start Point = - 1.5 degrees
  • Sun Elevation Rising - End Point = 35 degrees
  • Sun Elevation Descending - Start Point = 35 degrees
  • Sun Elevation Descending - End Point = - 4.0 degrees

These settings were crafted as an example, demonstrating a transition from a warm, dimly lit ambiance to a brighter, cooler ambiance during the sun’s ascent. Conversely, during the descent, the settings showcase a shift from the brighter, cooler ambiance back to the initial warm, dimly lit ambiance. It’s crucial to note that these values are provided as an illustration, encouraging users to customize settings according to their preferences and unique requirements

The lowest possible start point for the Sun Elevation rising phase and the lowest end point for the Sun Elevation descending phase is set at -10 degrees. Below these specified points, the settings utilize their minimum configured values.

This is how it looks in a sensor card

If you chosen to select “Brightness Inverted” in an option then the graph below also show how the brightness will be as inverted apposed to just selecting “Brightness”.

The Settings (Click Here to expand)

:gear: THE SETTINGS

The default settings are just random numbers I used. You will have to adjust them to suit your site conditions and to your liking. Play around with it and try different settings to make it work for you. Don’t forget you still can also use the “transition” and “colour temperature” in “Light Control Options”. Only “brightness” in the “Light Control Options” will be disabled if your use brightness in “Dynamic Lighting”. Transition is a nice way to smooth out your lights.

  • Dynamic Lighting - Ambient Light Sensor

    This is the ambient light sensor that will be use. You can have a local light sensor in the same room as your lights or you can use and outside sensor.

  • Dynamic Lighting - Max Lux Value

    You can see in the above graph (Point B) the maximum lux value is set to 400 lux.

  • Dynamic Lighting - Min Lux Value

    You can see in the above graph (Point A) the minimum lux value is set to 40 lux.

  • Dynamic Lighting - Max Brightness Value

    You can see in the above graph (Point A) the maximum brightness value is set to 100%.

  • Dynamic Lighting - Min Brightness Value

    You can see in the above graph (Point B) the minimum brightness value is set to 0 % If setting the brightness to 0% then the light will turn OFF.

  • Dynamic Lighting - Toggle Helper

    When you set up dynamic lighting with a brightness level of 0%, the light will turn off. Dynamic lighting relies on the state of the lights being “ON” to function correctly. If the lights are not detected as “ON,” dynamic lighting stops, which is not desired. By using a toggle helper, dynamic lighting will monitor the toggle helper’s state instead, ensuring it continues to run. This is why the toggle helper is necessary only when setting a brightness level of 0%. Toggle helpers in Home Assistant are reliable and don’t get lost on the network. If a light drops off momentarily when dynamic lighting checks the state, it can cause dynamic lighting to stop. Using a toggle helper ensures consistent functionality without relying on network connections.

  • Dynamic Lighting - Heartbeat

    This is the speed it will run at. At each heartbeat it will check your lux value and change the brightness if necessary. Every Lux sensor report differently so you will need to adjust this to suit your lux sensor. There is no point checking every minute if your lux sensor reports every two minutes.

  • Dynamic Lighting - Step Value

    With every heartbeat, the system evaluates the lux value, light brightness, and the targeted brightness. If the targeted brightness surpasses the predefined step value, the system applies the set step value to gracefully moderate the rate of changes, facilitating a smoother transition in light brightness.

    To understand its function, consider this scenario: Imagine dynamic lighting aims to set your lights at 44%. If your actual light brightness is at 96%, and with a Step Value set at 4%, instead of applying the full 44%, it adjusts to 92%. This adjustment pauses, allowing the LUX sensor time to adapt before proceeding to the next step, synchronized to your heartbeat setting. As your actual light brightness reaches 92%, the target value may be adjusted to 50%. This process repeats with each heartbeat until the target value aligns with your actual light brightness. The introduction of the Dead Zone comes into play when the target value approaches the brightness of your lights.

  • Dynamic Lighting - Dead Zone (±)

    With every heartbeat, the system evaluates the current light brightness and the targeted brightness. If the targeted brightness falls within the defined dead zone, the system maintains the current light brightness. This prevents minor fluctuations in light intensity that could be bothersome to the eye.

    To understand its function, consider this scenario: suppose dynamic lighting aims to set your lights at 88%. With a Dead Zone set value of 7%, if your actual light brightness falls between 81% and 95%, there will be no alteration to the brightness value. Although a 7% Dead Zone might initially seem substantial, testing has shown that it is actually considerably less than 7% of the intended value.

Trouble Shooting & Testing

In order for dynamic lighting to work well, it needs data from your lux sensor. Having a lux sensor that reports every 5 - 10 min + or on 5% change will not work well. The more data we can have the sensor provide the better it will work. Dynamic lighting only works with light (domain) entities. It will not work with switches and scenes.

A good way to test it is to add your motion sensor, light and lux sensor into a dashboard. This way you can see what is happening. Reduce your heartbeat to the minimum 0.25. If possible make your lux sensor report every 20 seconds. Now you will have a fast reacting dynamic lighting. From there you will then need to expand out your settings until you find what works for you. Below shows the dashboard.

45

Enjoy

Blacky :smiley:

Back to FAQ: Click Here

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

3 Likes

I come from another hub and I had to set up 4 separate automations to meet my needs, I don’t understand if this could help me, I’ll explain:

in each room with 2 lights, I have 1 light that turns on when movement is made and turns off at the end of movement only if the other light is off, or if desired they must remain on. All this only if a virtual switch is turned on.
With Home Assistant I don’t know how to set something like this, either I copy the logic I had created, with virtual devices and so on, or I don’t know. I saw the project and tried to use it, but I found myself with the switch that was going crazy trying to figure out continuous on-off-on-off. definitely my mistake but I can’t find a solution

Also, I also have a location mode and would like the Automations only work in those cases. Is it possible with this program?

Hi there,

Newbie question, is there a way to have 2 different night light configurations?

Would I need 2 automation of the same blueprint, 1 for regular hours + 1 night light config limiting hours and 2 for 2nd night light config limiting hours as well

Thank you in advance.

Sounds possible, you just need to hook the motion sensor and light to this blueprint.

You can then create input helper for the virtual switch, map that to the bypass ON option on this blueprint.

For location mode, assuming you mean using device location to disable the automation, if so, there is the zones + person option.

@ripblade

If your are after 3 different lights zones example; Zone 1 = Daytime, Zone 2 = Evening, Zone 3 = When sleeping then yes. Recommend one automation to do zone 1 & 2 then 2nd for zone 3. Reason for this is zone 1 & 2 you can use all the conditions and then zone 3 can be a time condition.

Blacky :smiley:

Hello,
I’m using this blueprint for a lot of my lights, it works very well !

I’m writing here because I’m struggling with one case:

I have kids and they want the light of the hall(couloir) to be in nightlight ALL the Night and not just when there is movement.
When not in nightlight, the light should light when there is movement.

I have a boolean nightlight
I tried to use it with the bypass the turn off with this boolean but cannot make it to work.
Now I’ve set the timeout for night at 12 hours. it kinda works but it’s not nice.

Here is my actual config:

Any tips would be welcome, thanks !

alias: "LightMvt - Couloir "
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.couloir_couloir_mvt_1485
    light_switch:
      entity_id: scene.couloir_relax
    time_delay: 2
    include_light_control:
      - use_transition
    include_ambient: ambient_disabled
    include_night_lights: night_lights_enabled
    light_colour_temperature: 3200
    light_transition_on: 3
    light_transition_off: 20
    night_lights_conditions:
      - entity_state_enabled
    include_night_light_control:
      - use_transition
    night_lights:
      entity_id: scene.couloir_nightlight
    night_time_delay: 720
    night_light_colour_temperature: 1500
    night_lights_after_time: "21:00:00"
    night_lights_before_time: "06:30:00"
    night_light_brightness: 5
    night_light_transition_on: 3
    night_light_transition_off: 10
    night_lights_entity_state:
      - input_boolean.nightlight
    motion_bypass_lights_on:
      - input_boolean.nightlight
    motion_bypass_lights_off:
      - input_boolean.nightlight
    light_brightness: 70
    include_bypass: []
    end_scenes:
      - scene.seb_couloir_lightstrip_off
    include_bypass_auto_off: []

Hey all,
quick question. I would like to trigger the night light (e.g. based on time) even if the main Trigger Sensor of the automation has not cleared yet.
In other words, my room lights are on (because my presence sensor is still occupied) but now at 18:30 I would like the lights to go dimmer (night lights). However, this will only happen once the main Trigger Sensor has cleared and get occupied again. Is there a way I can force the change even without a change in the main trigger sensor?
My best idea so far is to use the addon blueprint for a night time scenario and pause the main automation. However the transition of the addon is limited to 10 seconds which means the lights go on and of to frequent.
Thanks a bunch <3

@sebcbien

If you would like normal lights during the day and then a some lights ON during the night then for now the best way to do this is it use may :gear: Turn Light, Switch or Scene On & Off with Trigger Conditions for your night lights. Then you would use the state at the trigger in the other blueprint and the state as a by-pass in this blueprint.

Let us know if this works for you.

Blacky :smiley:

1 Like

Thanks @Blacky
I just edited my post when you were replying and added this:

Now I’ve set the timeout for night at 12 hours. it kinda works but it’s not nice.

I will have a look at your other blueprint.
Thanks for your amazing work and availability :grinning:

1 Like

the best way to do this is it use may :gear: Turn Light, Switch or Scene On & Off with Trigger Conditions

Did not know about that blueprint but it might be the solution for my question too :slight_smile:

Yea that will work to
 I will put his on the list.

The other blueprint is ON and OFF. We will also look at this and put it on the list. It use to work that way but it was changed to how it is now.

I am just got my head in some new development on this blueprint and looking 3 releases ahead. But I will look into it.

2 Likes

Thanks!!
I think the current behavior of the night light behavior makes more sense than what I seek. E.g. most want the light to change to night light AFTER they went to bed ( after Occupancy cleared and they get up again in the night for toilet etc.). Which is nice since it gives some fluctuation time, e.g. night light start at 22:30 but I go to bed at 22:34.
My use case is more during the evening ours for the kids bed time. Where I want night lights between 18:30 and 19:30 (fingers crossed they sleep by than hehe) if there is occupancy and the time hits the 18:30 regardless if the the occupancy sensor has been cleared.
Any idea on how to achieve this best?

  • was thinking of an automation that toggle the main trigger of the automation briefly at 18:30
  • use the addon blueprint but that keeps the night lights only on for 10 sec if the room cleared

I can see how my text is confusing, I gotta learn how to be more precice when it comes to describing automations :sweat_smile:

Yep that is why it was changed.

I have got a lot in my head at the moment so excuse me if I am not 100% correct on this, but what needs to happen is the light has to go OFF not the trigger
 you could use the by-pass turn OFF light and then the auto off or something to turn it the by-pass off and you will get a flicker, then it should go to night lights as the by-pass analyses the automation when we turn the by-pass OFF and if the trigger is ON it should turn your lights ON night mode
 it is a totally hack. Just test it first before you go to town on making something by adding in a by-pass for the OFF option and turn it ON and OFF manually
 then I will look at a better option.

Thanks a bunch!!
I think you are right that the light has to go off rather than the trigger.
Thank you for all your help and the amazing blueprints :slight_smile:

1 Like