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

Sure! (Maybe I’m also using it wrong :smiley: )
I have a presence sensor in my kitchen. I want the lights turn on in the afternoon (when it’s getting a little darker) and then getting brighter the darker it gets.
However, if it’s after 10 PM, I go to sleep. If I then go the kitchen for a midnight snack, I don’t want to be screamed at by the lights :rofl:
My first try therefore was to ignore dynamic lighting in the evening, but use it when it’s really dark (sun elevation based).

Okay this id dynamic lighting. At -10 sun elevation it will be inactive but it will / should be dark. Your ‘Min Brightness Value’ will be applied.

Then enable night lights and set a night light time condition for 10pm or 11pm to X am. Then set your lights to a % that you would like when you get up for a midnight snack it could be 10% brightness.

This is how it is designed to handle what you are trying to do. You then wont be screamed at by the lights.

Hope this helps you and let us know how you go.

Blacky :smiley:

First of all thanks for elaborating!
One question for the night light. I have used it in the past and the lights were on the whole night. Was this an error by me, so normally it is, as the other triggers, a feature to switch the light on by a trigger, just with a different brightness?

Night lights work with the same trigger for normal lights. It just has a separate set of settings so you can have softer lights come ON for exactly for what you are trying to do. The lights should turn ON and OFF with the trigger + nigh lights time delay.

1 Like

thx for the amazing script!
suggestion: hide all inactive/unused settings under a dropdown menu or sorts? for less scrolling and more outline overview

@tazztone

Thanks for you kind words.

Please vote here

Blacky :smiley:

Hi. Thanks for the blueprint. Very useful.

I am trying to implement a use case where a light triggers and then, even if the sensor is still active, it automatically turns off after a time delay. The use case is that I have a door sensor turning on a closet light and my kids will leave the door open when they leave the room. So, if the door is open for longer that some period of time, I want the automation to turn off the light.

I tried the bypass settings as my thought was to use the auto-off function and timer but that doesn’t seem to work. I assume this has to be a pretty common use case so hopefully it is a straightforward implementation.

Update*
So looking at your other blueprints I see that you have the run on timer blueprint. So for a simple use case I highlight above you would have two automations. The sensor light to turn the light on and off using the door sensor, and a timeout automation using the run on timer that was triggered when the light comes on.

I did this flow and it almost does what I want. I have this automation running on a different platform from home assistant and for the logic I built there the timer to turn off the light starts the countdown when the door sensor is open. Then if the timer expires while the door is still open it will turn off the light. The use case that isn’t implemented in the home assistant example is if I manually turn the light back on, the timer will start again. Ideally what I want to implement is that the timer doesn’t start again until the door sensor changes start from closed to open. This allows me to handle a use case where I am doing something in the closet longer than normal and the light turns off. I can turn the light back on manually and if I do that, the timer doesn’t start again.

@superbad_dad

Hi Ross, I have another blueprint that does this + some. I will release it so keep an eye out for it.

EDIT: New blueprint Click Here

Blacky :smiley:

1 Like

Yes it is a sensor issue that made it unavailable. However, the code behavior in this edge case maybe needs attention?

Sorry I am not sure what you are doing.

Blacky :smiley:

Best blueprint I have ever seen…well well done Blacky! LOVE IT. :smiling_face_with_three_hearts:

@reefball

Thanks for your feedback, it really nice to get these ones.

Blacky :smiley:

Hi,
I’m experiencing something that is completely unexplainable to me (as a HA noob).

I have four floors in my house. Each floor has at least one HUE lamp and one Aqara motion sensor. All sensors are grouped as “All Motion Sensors”, all lights as “All lights”. Across all floors.

My single motion sensors are named like the floor and their count on the given floor:
Floor 1, motion sensor 1 => ms_1-1
Floor 2, motion sensor 1 => ms_2-1
Floor 2, motion sensor 2 => ms_2-2
etc.

Same naming structure for the single lights:
Floor 1, light 1 => light_1-1
Floor 2, light 1 => light_2-1
etc.

I have set up the blueprint two times, because I want to have two behaviors.
Reason is that I don’t want to annoy my wife when she is watching TV in the living room (floor 2) by turning all lights on/off too often, while I’m working and moving in my office on the 4th floor. But if someone comes upstairs I want all lights to be on from the beginning. Also that I know someone is coming.

Blueprint instance 1:
When one of the motion sensors in the group “All Motion Sensors” detects motion, I set the group “All lights” to 100%. So far, so good, thats working, all lights are turned on and off after the given time.

Blueprint instance 2:
When the motion sensor “ms_4-1” detects motion, only the light “light_4-1” is set to 100% (and later 0%). Also working.

When they are working “independently” all is working as expected.

But when they “overlap” (instance 1 is activated while instance 2 is still running) the strange behavior (bug?) kicks in:
When instance 2 is activated by the motion “sensor ms_4-1” and the single light “light_4-1” is already set to 100% and THEN one of the other motion sensors in the group detects motion, all lights in the group (incl. light_4-1) are set to 24% only.

Why? What am I missing here?

I’m also using the “Dynamic Lighting Options”, here option 1, “Lux controlled brightness” that is depending on a Aqara illuminance sensor that is outdoors.
Settings are
Max Lux Value - 500 lux
Min Lux Value - 130 lux
Max Brightness Value - 100%
Min Brightness Value - 0%

for both instances of the blueprint.

Does that have an influence on that (to me) strange behavior?

Thanks for any hints that might lead me to the right direction.

@Grml

Try to not group your lights an add them individual. This way the automation will see the light as ON and it will keep its 100% and not go to 24%. Try it and let me know how you go.

So if you are using dynamic lighting option 1 then it controls the brightness. :thinking: Also note when you set 0% for Min Brightness Value then your light will turn OFF.

It will influence the brightness so try it with it OFF (disabled) first. Maybe I need to do a new option 7 for sun elevation lux brightness. Then you can use the sun to swap to night lights. Anyone reading this would this be something you would like please let us know.

Blacky :smiley:

Thanks for your reply!

Tried that already, that didn’t make a difference.

Correct. That is why I am confused. I would understand the behavior if it always would behave the “wrong” way and set the light group to 24%. But it is only when light_4-1 is already on/100%.

What do you mean? The Dynamic Lighting Options set to OFF?

It is hard to work out what you are doing exactly. I am not sure what is using dynamic lighting. So I will go through what I think it could be

Blueprint instance 1:

All light in a group and light control set to 100%. Change the lights out of the group and add them as entities.

Blueprint instance 2:
Only for light 4-1 working with motion ms_4-1. Dynamic lighting used.

Because you have light 4-1 used in instance 1 & 2 This may cause conflicts… I haven’t tested anything like this setup. So I could be wrong. But what I think should happen is instance 2 should control the brightness when motion is detected even if the light is ON because you are using dynamic lighting. If you group lights I think it will not work.

Blacky :smiley:

Hey there!
I am currently trying to have a great Motion light management and I found your blueprint. Pretty complete to my opinion, yet I cannot make it work for my use case :stuck_out_tongue:

I have a input_boolean that enables the motion sensor, meaning that if it’s false, the automation will not be triggered but the countdown still runs. It is not a bypass, more a condition to turn on the light.

Moreover, I want only my automation to run if somebodies at home. I created a person for all my usual friends by scanning the WiFi devices, and I use the condition zone.home above 0 to check if the automation should run.

Do you think it would be easy to add in this already crowded Blueprint? Did I miss something and it is already feasible?

Anyway, nice blueprint. It looks like one blueprint to rule them all to be honest :slight_smile: Well done!

EDIT: I did find the zone option, I was just confuse with the people field under but it seems to be behave as I expect :wink:

@Nover

Maybe you can give me an example of what you are trying to do and then I can work out the best way to achieve this.

Blacky :smiley:

Thanks for this blueprint. I’ve configured dynamic lighting as follows:

include_dynamic_lighting: enable_lux_controled_brightness_inv
dynamic_lighting_min_brightness: 50
dynamic_lighting_lux_sensor: sensor.gazebo_east_sensor_illuminance_3
dynamic_lighting_heartbeat: 15

A Z-Wave JS debug trace suggests the blueprint is adjusting dynamic lighting every 15 minutes (as expected) however it is often the same current and destination values. For example:

[Node 114] Value updated: 38-1-currentValue 57 => 57

This results a flood of Z-Wave traffic when you have lots of lights setup and they all switched on around the same time (eg someone walked through the house).

Can the blueprint be adjusted to only send a change if the new dynamic lighting level differs from the existing lighting level, therefore avoiding this traffic?

@bpa

Welcome to the community.

Your welcome.

HA should be able to handle it. The data is small and only every 15min in your case.

I will put it on the list, thanks for your suggestion.

Blacky :smiley: