I think your asking for a feature that is already there. Have a look under Ambient
Blacky
Currently there are only 2 modes that I call normal lights and night lights. If you would like more different modes then you could use a script and say if X is on then = ABC lights @ 30% green if XY is ON then = ABC lights @ 60% blue etc. You can make as many as you like…
Blacky
You would use a scene or script to turn the light ON in Lights - Switches - Scenes - Scripts and then in your Scenes - Scripts To Turn OFF you would use a script to turn your lights first to 50%, delay and then turn OFF.
Blacky
This is a great blueprint, thankyou. I have a few improvements mainly allow multiple ambient light sensors.
I think I have found a bug or oversight, if I have night glow enabled and dont have all of the “night light entities” selected in the “night glow” entities then the night light entities never end up turning off.
I have a hallway with a few bathrooms that I have 4 of the Third Reality night lights that have a motion, illumination and color bulb. I have 2 of them in them in a hallway and another 2 in bathrooms connected to the hallway. Ideally Id like the lights in the hallway to enable night glow and then have the 2 lights in the bathroom only act as a night light and turn off after no motion. As it is now the lights in the bathroom dont seem to get the off signal.
Please see this FAQ click here
I have tested it here and it is working… please look at Night Lights - Time Delay as this is the time it will take to transition back to night glow once your motion sensor is clear.
I am working on this blueprint now so if you could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.
Blacky
Merry Christmas to all and all the best for the New Year!
Your lighting experience, your way – take control and customize it to perfection!
Bugs Fixed
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
Trying to see if this would work for me. My biggest problem is my cat that keeps me from just using mmWave.
Is it a correct use of the bypass to use the PIR for triggering and mmWave for Keep current state bypass?
I want to trigger with PIR but keep on if mmWave is detecting something.
Ideally I’d like to trigger with PIR, keep on if mmWave is detecting but no longer than 30 minutes (unless PIR is high again).
I would try and look at the problem (The Cat). So there are a few ways.
Blacky
Hope everyone had a Merry Christmas to all and all the best for the New Year!
Your lighting experience, your way – take control and customize it to perfection!
Bugs Fixed
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
Enjoy
Blacky
Hello all! I’m not sure i’m using it right or if its possible.I have until now just had 2 scenes to control my garden lights. 1 turn off at 8am and 11pm, 1 turn on 5.30am and 6pm. But i bought a sensor and would use this blueprint to turn on the lights in the periods where its not controlled by the timebased scenes. Problem is that then the sensor is triggered within the scenes turn on periods, its turn off the lights after the time set in the blueprint. Is that what the bypass function could be used for or?
Hey!
I am trying to implement the night light function in my automation. Turning the night light on at the selected time works just fine. But it doesnt turn back to the normal light at the end night light time. I guess i have an error in my logic. It fires at 15:05 but nothing happens at still stays at the night light.
alias: Sensor Light - Wohnzimmer
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.group_motion_sensor_wohnzimmer
light_switch:
entity_id: light.wohnzimmer_decken_lampe
include_light_control:
- use_transition
include_bypass: []
motion_bypass_lights_on: []
motion_bypass_lights_off: []
include_bypass_auto_off: []
include_ambient: ambient_enabled
ambient_light_sensor: sensor.wohnzimmer_presence_sensor_illuminance_lux
ambient_light_options: ambient_light_option_disabled
ambient_light_value: 150
include_device_tracker: zone_people_enabled
zone: zone.home
people:
- person.test
night_light_brightness: 10
night_light_colour_temperature: 2300
motion_bypass_lights_stop: []
include_dynamic_lighting: disable_dynamic_lighting
dynamic_lighting_min_brightness: 1
dynamic_lighting_sun_elevation_end_falling: -13.5
dynamic_lighting_sun_elevation_start_rising: -13.5
dynamic_lighting_sun_elevation_end_rising: 60
dynamic_lighting_sun_elevation_start_falling: 60
dynamic_lighting_lux_sensor: sensor.wohnzimmer_presence_sensor_illuminance_lux
ambient_light_high_value: 350
light_transition_on: 2
light_transition_off: 5
bypass_time_delay: 5
light_colour_temperature: 2400
include_light_colour_control: disable_colour_control
include_night_lights: night_lights_enabled
night_lights_conditions:
- time_enabled
night_lights_after_time: "14:50:00"
night_lights_before_time: "15:05:00"
include_night_light_control: []
night_boolean_scenes_scripts: input_boolean.toggle_helper_night_light_wohnzimmer
night_lights:
entity_id: scene.night_light_wohnzimmer
end_scenes:
- scene.night_light_wohnzimmer_off
Tried to figure it out myself but i cant seem to. Thanks! Happy Holidays!
edit: input_boolean.toggle_helper_night_light_wohnzimmer stays on after it fires at 15:05. I guess it should turn off? At 14:50 it turned on.
Hi @Blacky ,
Let’s imagine that the lights are on (with a scene for example). Can you explain how to keep the lights on after the delay if the automation has triggered?
I suppose that I need to use a by-pass but I don’t know how.
Sorry, but I need someone that understands this blueprint to give me a hand.
I have a light and an IKEA motion sensor. Until now I have bind the motion sensor in Zigbee2MQTT to turn the light on/off when activated.
Now I want to use my outdoor illuminance sensor to adjust the brightness of this light. I want the light to be less bright when if gets darker outside. I also want to light not to be turned on at all when it is very bright outside.
I want the motion sensor to turn on the light as usual and be on for two minutes.
I started by unbinding the sensor from the light in Z2M, so it no longer controls the light, but allowing for this blueprint/automation to control the light.
I used the configuration wizard and this YAML is the result. However nothing happens. What have I done wrong?
alias: The brightness of the lamp
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.mymotionsensor_occupancy
light_switch:
entity_id: light.thelamp
time_delay: 2
include_dynamic_lighting: enable_lux_controled_brightness_inv
dynamic_lighting_lux_sensor: sensor.outdoor_lightsensor
dynamic_lighting_max_lux: 100
dynamic_lighting_min_lux: 20
dynamic_lighting_min_brightness: 5
include_ambient: ambient_enabled
ambient_light_sensor: sensor.outdoor_lightsensor
ambient_light_value: 200
ambient_light_high_value: 200
Hi! I have the problem described in the FAQ that the lights ignore the timer and turn off immediately after the motion sensor stops detecting motion if I use the ambient light condition. I added a toggle helper as described but it does nothing.
My setup: I have 2 motion detectors controlling several lights. The occupancy sensors from both detectors are grouped and the ambient light sensors are also grouped. The occupancy is used as trigger and the grouped ambient sensor as the ambient light condition (all are entities). The lights are also grouped (entity). I only use the normal light switching with the ambient condition, nothing else (no night lights, dynamic lighting or whatever). Why is the timer (“time delay”) ignored when the ambient light condition is used? How can I debug it?
Hi Danny, welcome to the community.
What we need to do is group everything but in order to group them it must be in the same domain (binary sensor). I am assuming you using a schedule helper to turn on your scenes… I wish I had more information on what you doing as I could just be going down the wrong path… but I will try my best.
First we need to create a template binary sensor for your schedule times. I think this is what your after.
ON at 5:30am OFF at 8am, ON at 6pm OFF at 11pm. This is how I will set it up but you can change the times if you like.
To create a Template binary sensor, follow these steps:
Next, provide a Name and Device class of your choice. If applicable, you can link this template to an existing device so it appears under that device’s details.
In the State template field, add the code below, and adjust the times that suits you.
{% set now = now() %}
{% set morning_start = now.replace(hour=5, minute=30) %}
{% set morning_end = now.replace(hour=8, minute=0) %}
{% set evening_start = now.replace(hour=18, minute=0) %}
{% set evening_end = now.replace(hour=23, minute=0) %}
{{ (morning_start <= now <= morning_end) or (evening_start <= now <= evening_end) }}
Now you will have a binary sensor (schedule) you can group with your motion sensor. Group them together and use the group as the trigger only. In the blueprint under triggers there is a link that will show you how to group them. You then can also still use the sun or ambient conditions so it makes sure it is dark when the automation can run.
Hope this helps you, let us know how you go.
Blacky
Thanks for reaching out and providing your YAML. It helps me allot.
Just one setting was needed, see below. Please tick this option.
TIP: Scenes can sometimes be tricky to work with, depending on what you’re controlling. When possible, it’s generally better to use entities directly, as this ensures the blueprint functions at its best. That said, scenes are ideal for setting specific colors and brightness levels across different lights. If your scene consistently uses the same brightness or colors, I’d recommend using entities with light control options instead. This approach can also help reduce the chances of light flicker.
Let us know how you go.
Blacky
Do you mean? “Can you explain how to keep the lights on after the delay if the automation has not triggered?”
If so then yes you can use the bypass. I have a FAQ on the bypass that may help you. Have a read of it and if you got any questions just ask. Click Here
Welcome to the community.
You did everything right but I found one thing that I will need time to think about before or if I fix it as it could impact something else.
Your min brightness is 5% and then dead zone is 7%. Because your brightness is lower than your dead zone it is not turning the light ON. I am doing this so it keeps HA working faster (I know it is only a little but every bit helps). So for now you have 2 options. Increase your min brightness to +8% or reduce your dead zone to 4%. You may find from 5% to 8% there is no real difference anyway or your can adjust both like min brightness to 7% and dead zone to 6%.
Let me know what you think and if it worked for you.
Blacky
Welcome to the community.
You can look at the traces and see what triggered it to turn OFF.
Just checking everything as you didn’t provide your YAML.
Because your are using the ambient as soon as it goes above your High Lux Value the lights will go OFF instantly and that is what I think is happening for you but I could be wrong.
How did you group the ambient sensors and are they effected by the lights? You do have an option to tick called YES - My Ambient Light Sensor is affected by the Lights but then your High Lux Value will not be in use. Check this out and make sure your settings are correct here and monitor your lux values.
If you like could you please provide us your YAML of the automation? This YAML code are the settings you have selected in the automation so I can help. To do this go into your automation, top right 3 dots, Edit in YAML, copy all the code, come back to the forum and in your reply at the top tool bar click on “</>” and paste code in there.
Blacky
Hi! Is there an example how to use this blueprint with a button like a Sonoff SNZB-01 - for example to turn the light off manually after turned on by the sensor?
I played with the Overrides but always end up with a nonworking setting
My working steps:
→ This works so far as supposed.
Now the non-working steps:
That works like I can use the button to toggle the light on and off.
BUT: as soon as the sensor is triggered - then the states of the helper is not the same as the light itself → so it seems this breaks the condition to let the automatisation work.
Where is my error in thinking?
Do i have to do some logic with the Scenes & Scripts - Toggle Helper?