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

@Rubberduck73

Hi Michael, thanks for your question. For the english speaking I will translate it.

No problem, your welcome. With your bedside lamps they must communicate with HA so when you turn them ON and OFF, HA knows they are ON or OFF. Once you have this then put the bedside lamps in the by-pass as shown below.

To German Translate

Kein Problem, gern geschehen. Ihre Nachttischlampen mĂŒssen mit HA kommunizieren. Wenn Sie sie also ein- und ausschalten, weiß HA, dass sie ein- oder ausgeschaltet sind. Sobald Sie dies haben, stecken Sie die Nachttischlampen wie unten gezeigt in den Bypass.

If using 2 automation then try not select the same day in both of them. Also there is no Friday selected.
Sunday to Thursday from 10.30 p.m. to 8 a.m.
and
Friday to Saturday 12:30 a.m. to 8:00 a.m.

To German Translate

Wenn Sie zwei Automatisierungen verwenden, versuchen Sie, nicht in beiden den gleichen Tag auszuwĂ€hlen. Außerdem ist kein Freitag ausgewĂ€hlt.
Sonntag bis Donnerstag ab 22.30 Uhr bis 8 Uhr morgens
Und
Freitag bis Samstag 12:30 bis 8:00 Uhr

Blacky :smiley:

@HannesDi

Sorry I have just realised I missed your post.

It is on the road map ahead. One way we can do this now is to use scenes. You can set all your lights up to any colour you like in a scene and then use the automation to turn your scene ON.

Blacky :smiley:

Thanks a million for pointing me to the right spot in the blueprint UI! and even more thanks for adding the feature!
Cheers

1 Like

I have been watching this blueprint for a very long time. I’m currently using EntityController. But I would like to switch to HA automation.

Do I understand correctly that I even have to create a helper so that the blueprint does not switch on a light if it is already switched on? That surprises me a little. This seems to be a standard function in many other blueprints: “Don’t turn it on (temporarily) if it’s already on.”

The problem is that in addition to the normal buttons (events only), you cannot make any switching via the web interface GUI.

Or have I misunderstood something?

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 six preset options available in the drop-down 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 - Colour Temp + Brightness
  6. Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness

: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, your standard ‘Light Control Options’ are available according to your selections in the ‘Light Control Options’ input. For instance, choosing ‘Use Brightness’ enables brightness control while keeping ‘Colour Temperature’ and ‘Transition’ active if also selected. Keep in mind that ‘Transition’ is always operational if selected, but ‘Brightness’ or ‘Colour Temperature’ (or both) may be inactive depending on your dynamic lighting choices.

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

Settings For Options 1, 2 & 6 - Lux Controlled Brightness Settings (Click Here to expand)

Option 1 & 6 “Lux Controlled Brightness”
This will constantly adjust your lighting brightness % to a floating lux value. Example - When it gets darker your brightness will increase and as it gets lighter your brightness will decrease as shown in Figures 1-1 & 1-2

Option 2 “Lux Controlled Brightness - Inverted”
This will constantly adjust your lighting brightness % to a floating lux value. Example - When it gets darker your brightness will decrease and as it gets lighter your brightness will increase. It works the opposite way to option 1 & 6. On 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 below graph (Figure 1-1) shows the default settings. It shows as the lux value decreases, the brightness increases and vice versa.

With this setup when motion is detected and the lux value is equal or above 400 lux, then the lights will turn OFF (if they were ON) or when the automation gets triggered the lights will stay OFF because the brightness is set to 0%. If the lux value decreases then it will increase its brightness. The light will start to come on at around 399 lux. I say around 399 lux as some lights may need 1% to 10% brightness setting to turn ON. It all depends on your lights and your controller. At equal or below 40 lux, the lights will be set to 100% brightness.

The blue dotted line represents how to read the graph, at 200 lux it will be around 55% brightness.

  • 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 setup we have,

  • 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 or above 500 lux, then the lights will turn ON at 60% brightness. If the lux value decreases then it will increase its brightness. At equal or below 200 lux, the lights will be set to 100% brightness.

The blue dotted line represents how to read the graph, at 350 lux it will be around 80% brightness.

Figure 1-3
The below graph (Figure 1-3) shows a different setup. This is when you are using option 2 “Lux Controlled Brightness - Inverted”. In this setup we have,

  • 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 or above 60 lux, then the lights will turn ON at 100% brightness. If the lux value decreases then it will decrease its brightness. At equal or below 20 lux, the lights will be set to 20% brightness.

The blue dotted line represents how to read the graph, at 40 lux it will be around 60% brightness.

: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 - 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. You can also set the transition time in the ‘Light Control Options.’ This further helps slow down the rate of changes per step to help smooth out the transition.

    To understand its function, consider this scenario: imagine dynamic lighting aims to set your lights at 44%. With a Step Value set at 4%, if your actual light brightness is at 96%, 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 intends 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. While a 7% Dead Zone might appear substantial initially, when testing it has demonstrated 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

Settings For Options 3, 4, 5 & 6 - Sun Elevation Settings (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

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.