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

@chris400

Thanks for your YAML.

Could you try a few things for me.

  1. In dynamic lighting could you please select ‘Disable Dynamic Lighting’. You have used the ‘X’ to remove it but it is best if you select to disable it.
  2. Not sure what version you are on but because you are using scenes it is best to create 2 separate toggle helpers and add them to the inputs. This will really help the automaton function correctly. If you done see these options then please update.
    • Scenes & Scripts - Toggle Helper
    • Night Lights - Scenes & Scripts - Toggle Helper

The only time you will see it turn OFF and back ON again is when crossing over from normal lights to night lights if the scene is ON.

Hope this helps you.

Blacky :smiley:

1 Like

@Sk1vvy

Tested it here again and it is working and I can fault it. Just checking, where you live is is starting to get darker earlier (at night when you trigger the automation normally) thus the dynamic light calculation on initial start up could be higher.

Blacky :smiley:

@TheScubadiver

Thanks Ramon for you kind words. It is really nice to get these ones. Glad you like it :smiling_face_with_three_hearts:

Blacky :smiley:

1 Like

@Bobie

I am just about to releas a new update that will solve what you are trying to do. Please update to version 6.5 when I release it and in dynamic lighting you will select option ‘5 - Sun Elevation Lighting - Brightness - Inverted’. Below is the YAML for you again.

alias: Blacky Outside light tester
description: Blacky Outside Lights on and off test
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - schedule.a_test_light_schedule
    light_switch:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    time_delay: 0
    include_light_control:
      - use_transition
    light_transition_on: 5
    include_dynamic_lighting: enable_sun_elevation_brightness_inv
    dynamic_lighting_min_brightness: 10
    dynamic_lighting_sun_elevation_start_falling: 5
    dynamic_lighting_sun_elevation_end_falling: -3
    include_sun: sun_enabled
    sun_elevation: 5
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    night_time_delay: 0
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
      - use_transition
    night_light_brightness: 10
    night_light_transition_on: 600
    night_light_transition_off: 5
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "18:30:00"
    night_lights_before_time: "19:10:00"

Let us know if the now works for you.

Blacky :smiley:

That’s not my case. I’ll try to explain as example:
dynamic_lighting_max_lux: 50
dynamic_lighting_min_lux: 10
my current setup. If LUX value 30 then light would turn on with 50% brightness. After this my LUX value still around 30 but light will up brightness until 100% with this heartbeat: dynamic_lighting_heartbeat: 0.5 with 7% steps i think. So my light would be 100% brightness in less than 5 minutes according to this settings, and LUX value is still the same. It happens only after 2024.4 update

New update 6.5

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

New Feature :new:

Changes to Dynamic Lighting Options

  1. Added new option selection to Dynamic Lighting. This will allow you to use the sun elevation as the sun sets the brightness will increase and as the sun rises the brightness will decrease. This is a nice option to use for your outdoor garden lighting systems.

    • 5 - Sun Elevation Lighting - Brightness - Inverted
  2. Changed Dynamic Lighting numbering system to the existing 5 & 6 options. Option 5 is now 6 and option 6 is now 7. This will not effect your inputs it is just a note to be aware of.

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:

1 Like

@Sk1vvy

Okay, I see what you are saying. I will test this now.

Blacky :smiley:

@Sk1vvy

Okay this is my settings for the test. Home assistant 2024.4.3. Blueprint Version: 6.5

  • Use The Dynamic Lighting Options = Option 1
  • Dynamic Lighting - Max Lux Value = 50
  • Dynamic Lighting - Min Lux Value = 10
  • Dynamic Lighting - Max Brightness Value = 100%
  • Dynamic Lighting - Min Brightness Value = 0%
  • Dynamic Lighting - Heartbeat = 0.5
  • Dynamic Lighting - Step Value = 4%
  • Dynamic Lighting - Dead Zone (Âą) = 7%

This is the outcome of the test.

  • Actual Lux sensor reading = 30.7 lux This stays consistent through the test.
  • Actual Light Brightness = 48% This never changes

I then took the lux value to 16.3 lux and my brightness = 80% This never changes.
I then took the lux value to 0.0 lux and my brightness = 96% This never changes. The dead zone is 7% so It stayed at 96%.

Okay so we know it is working here. Now we just need to work out what is going on at your end.

Nothing changed here and you are on the same BB version so we can rule that out. I tested it here on the latest BB version but updating it didn’t change the BB in that area and I am on the latest Home assistant 2024.4.3. So I would start looking at the lux sensor as it uses that to calculate the brightness %. It just could be a gremlin in the system and that is very had to find and fix. Maybe the next HA update will resolve it or you could try to use a back up and roll back then try update again. I hate doing that so I would wait for the HA update and see what happens.

Let us know how you go and I hope you find it.

Blacky :smiley:

What can I say - thanks for all your effort put into this.

Now I understand why someone would want to mimic the sun rising like in a dark bed room and so on…

One more thing you might find the time to sort out is the last part to dim down slowly at a fixed time also doesn’t dim down - it jumps to the set brightness level and stays until the set off setting - at that time the light comes on full - does not go out.

I thought that if we/you can get the Dynamic part working to brighten the lights at Sunset then I could perhaps use the same Dynamic option to dim the lights down and then finally off at a set time or whenever.

Before I found this Blueprint I was toying with the idea of trying to write my own YAML file but I couldn’t find a ‘While’ statement to do the dimming…

Again thanks for all this help and work you are putting into this Blueprint.

Regards,

Bob…

1 Like

Hi Blacky,

I’ve upgraded to 6.5 and have installed your YAML - I’ll let you know how I get on.

I’ve changed to light starting % to 1% as my dimmer can work at this lower level.

Regards and Thanks again,

Bob…

Hi Blacky,

The light came on at 1% and within an hr or so was at 100% way cool.

Last problem to solve is the dimming down at a set time, after the main 100%, and then going off at a set time.

The going off can be done I guess by the timer Helper?

But it seems the last part, The Night Light section, didn’t work - the light stayed on way past the OFF Night Light Setting. However: it might have been the time and the angle set at -1.5 causing it so I have set the angle to be -2 and the time to 9.00pm and 9.30pm respectively.

See my YAML:

alias: Blacky Outside light tester
description: Blacky Outside Lights on and off test
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - schedule.a_test_light_schedule
    light_switch:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    time_delay: 0
    include_light_control:
      - use_transition
    light_transition_on: 5
    include_dynamic_lighting: enable_sun_elevation_brightness_inv
    dynamic_lighting_min_brightness: 1
    dynamic_lighting_sun_elevation_start_falling: 5
    dynamic_lighting_sun_elevation_end_falling: -3
    include_sun: sun_enabled
    sun_elevation: 5
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.my_test_moer_zigbee_dimmer_light_2
    night_time_delay: 0
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
      - use_transition
    night_light_brightness: 10
    night_light_transition_on: 600
    night_light_transition_off: 5
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "21:00:00"
    night_lights_before_time: "21:30:00"
    night_lights_sun_elevation: -2

Best Regards,

Bob....

Hi there,

I am new to HA and coming from a Homematic setup. So the way HA works with automations is very different then in Homematic.

I got motion sensors in every room at home and would like to use your blueprint. But I have some scenarios, childrens room, where I don’t get it how to configure.
The scenario is easy. The light is normally switched on by a switch, long for “on” (5 minutes) and short for “off”. The motions sensor only extends the “on” state by 5 minutes, but only when its switched on by the switch. When the lights are off, the motion sensor should not turn on the lights.

With Homematic it’s easy to do, but I don’t get it to work with your blueprint. Do you have any hint for me?

Thanks and regards!

@Bobie

Looking at night lights. You will need to work from your trigger schedule. If your schedule ends at 9pm just set your nightlights to 10pm much later than your schedule. This will make sure it will not revert back to normal lights. Setting your ‘Night Lights - End Time’ latter than your schedule wont matter because your schedule will turn OFF before then.

No it will not be that and the sun is not enabled in night lights so no need to worry there. Best to work with time as you are doing.

I have tested light ‘transition’ here and it looks like there may be a bug or a limitation in HA. If I set it to 600 then it takes about 5 seconds. If I set it to 60 it takes 60 sec. I sure this was not the case before when I did a lot of testing during development of this blueprint. I normally only use about 5 sec max so everything works here and haven’t noticed. Maybe others can test it and provide some feedback. So maybe try a shorter time than 600. Start at 60 and work your way up.

Let us know how you go.

Blacky :smiley:

@benkly

Have a look at this blueprint :magic_wand: Manual light control with auto OFF I think this is what you are after. You will need to enable the ‘Use The Motion Sensor Option’.

Let us know how you go.

Blacky :smiley:

Thank you very much. I think this should work.

But, I had read a lot about how to best deal with “delay” and “timer” functions. The deeper I get, the more I read that both are not the best options when it comes to reboots of HA or maybe also other problems.
Many of the other users recommend “day/time” input function to be reboot safe for the most scenarios.
Is this right or did something change in HA so that is not needed anymore?

@benkly

Your welcome.

This is best answered on the other blueprint I recommended as it relates to that blueprint.

Blacky :smiley:

Blacky,

As a coder of many years, I’m grateful for your work on the “Sensor Light” blueprint. You’ve wrangled a very complex decision tree expertly in YAML. :sweat_smile: I’m here because I couldn’t do it myself. Thank you.

My ideal use case for nightlights is for them to brighten a bit when I walk in. Then, a few minutes after I leave the room, they dim back. But the fact that regular and nightlight modes share “turn off” scenes makes this hard to do.

Could night lights their own “turn off” scenes? I have done this myself, but I have to fork every new version you release and reimplement on top.

Again, thanks for all your work on this.

@onethirtyfive

Thanks for you kind words Joshua and welcome to the community.

I have an example that is a step by step guide on how to do this, click here to find out the how to under the automation example.

Let us know how you go.

Blacky :smiley:

Haha well, I guess it’s a really common use case. I am glad to have the option outlined in your FAQ–I may use it, thank you.

I still think there may be merit to separating “turn off” scenes. For example, I have “Nightlight” and “Nightlight Bright” scenes set up in my Philips Hue system–which is bridged to Home Assistant. This allows for me to have my overhead lights come on at 10%, but keep my end table lamps off. And it’s “just a scene.”

I could do this via script, but that’s true of everything in Sensor Light. A separate scene list would keep things declarative for me (which is already the benefit of the automation in many other ways).

That said, I don’t know what I don’t know. There may be a lot of logic for having two lists. Is this too exotic a use case for the blueprint to support? :thinking:

I’ll probably take a stab at it if it’s something you don’t think adds much value.

Thanks for hearing me out!

It has been asked once or twice.

Believe it or not I try hard to reduce as many inputs as I can. This is on my list to do but it is slightly different in the way I am thinking. It is the same but different and I am try hard not to say anything.

Blacky :smiley:

1 Like