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

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

Hi, thank you for this blueprint
I would like to know if it is possible to have different brightness levels based on distance.
I am using an LD2410 sensor to define different zones.
I would like that when a person is detected in zone 1, which is more convenient near the sink, to have the brightness at 100%. And when I return to zone 2, I would like to resume what was defined in the blueprint, which is to have the light power based on the ambient light.d

@stream74

Maybe try using night lights and the state condition. Use zone 1 in your state condition and set your brightness to 100%. Make sure you tick ‘If lights are ON, adjust the lights when crossing over’ in night lights control options.

Then in normal lights group zone 1 & 2 and use this as the trigger. Set your lights up as required.

Now when zone 1 is detected it will activate night lights and go to 100%. Then we deactivated it will turn OFF or if zone 2 is detected it go to normal lights.

Let us know how you go.

Blacky :smiley:

1 Like

Thanks for the fix in v6.4. I missed that when you published it. I wish HA had a version control and notification system for blueprints.

I’ve updated and will see how it goes.

Thanks.

@pgale

No problem your welcome.

I think they did mention doing something on those lines in the past.

Blacky :smiley:

I saw something someone had made and shared on Github but it was a fairly complex install. I can do that but didn’t want something that’s likely to break over time as it was very hacky it seems.

Yeah, best to wait for HA to implement this. For now it easy to check in every now and then to see if it is updated. The link is in the blueprint back to this topic for ease.

Blacky :smiley:

1 Like

Hi experts! I need some guidance. I am using this blueprint and it’s awesome, but cannot figure out what values to use with Ambient Options. The setting is between 0 and 1000, with an example of 20 lx for dusk and 80 lx for dawn. When I check my sensor, it goes between 0 and 3000… Right now, as in the screenshot, it’s at almost 3000 lx.

what should I use in this automation as the high value to prevent it to turn on the lights if my light sensor senses 1500 lx?

Thanks!

@hernanp

Hi Hernan, welcome to the community.

This is really easy to do. It normal to see the values you are getting. There are many factors to what setting you should use and ultimately it is really up to you and what you would like. Everyone’s sensor will be different because it all depends where it is and the effects of your site may have on it. You can also have different values just based on the sensor.

The best way to do this is to wait until sunset and monitor your lux sensor, or open and close your blinds slowly. You then can decide at what value you would like the light to come ON. Then turn your light ON and see if it effects the lux sensor. If the value goes up you have 2 options.

  1. You can opt to select yes or no in the site conditions. This is good if you are using the lux sensor to turn the light ON at sunset and it just keeps getting darker. If that is your use case and the lux sensor is effected when the light turns ON then select ‘Yes’ and set your ‘High Lux Value’ the same as your ‘Low Lux Value’.

  2. If your lux sensor goes up in value when the light is ON and you are using it for daytime use, example clouds cover making it darker then you will probably chose ‘No’ in your site conditions and then use the ‘High Lux Value’. So your ‘Low Lux Value’ with be the value to allow the light to be turn ON. Then when the light turns ‘ON’ and your lux sensor value goes up just decide at what value higher then when the light is ON to then set your ‘High Lux Value’ so the light will turn OFF.

If your lux sensor is not effected then you can just decide what value you would like to use in the ‘Low Lux Value’ & ‘High Lux Value’.

  • Low Lux Value will allow your light to be turned on by the trigger.
  • High Lux Value will turn your light OFF if it is ON.

The difference between the ‘Low Lux Value’ & ‘High Lux Value’ servers as a buffer so when your light turns ON it is not turned OFF instantly.

Hope this helps you.

Blacky :smiley:

I also found that the Lux sensor in my Athom presence sensors aren’t very sensitive at low light levels - for example, in our main bedroom, at night and with table lamps on, the measured lux level is only around 0.5-1 lux. Not much to play with at the darker end.