Good question
I have ambient light enabled, and sun elevation disabledā¦ But still the automation stops because of sun elevationā¦
No, sun elevation and ambient as well as time are all conditions so you can use them but you donāt need to use them for dynamic lighting. It is totally up to you if you would like to use the condition in the automation.
Blacky
If you have ambient light enabled then this must be true (condition met) for the automation to run. You can do this in dynamic lighting but it all depends on what option you have selected. You have full control over what happens it is just getting your head around that sun, ambient and time are all conditions that must be true for the automation to run.
Blacky
hey @Blacky , generally loving this blueprint so thanks, and thanks for all your help so far. iām trying to use it to replicate a very specific use case which is, effectively, the room lighting app from hubitat. iāll explain and hopefully you can tell me either how to achieve it, or if i just need to set a couple of different automations up:
- turn lights on on motion, set to a constantly variable brightness based on lux and also follow the sun through the day to decide the colour temperature. (this works, but i find the Adaptive Lighting integration gives me better colour temperature variance than the sun elevation in this app. any idea why?). so nothing to see here really, this use case works perfectly.
- bypass / supress the automation if a given switch is on. again, this works perfectly really, no problem
- this is the one thatās got me scratching my head. i want totally different behaviour at night time as i have cats in the room. i have a helper which turns on when my house alarm goes into armed night mode. when armed night, i want the lights in this room to turn on low and red for a few seconds when motion is detected on a completely different motion detector (i.e. out in the hallway where the cats canāt go but i do if i come downstairs). i donāt want the motion detector that triggers the lights during the day involved at all. is there anyway to do this, i.e. supress the ātriggerā motion detector and just have the other motion detector work? (i have setup a mixed group helper which turns on when itās night and motion is detected on the OTHER detector; this group works well, but doesnāt affect the automation as iād hoped as it still just seems to turn on when there is motion on the main detector).
really hope you can help; if itās not possible then i can clearly run a couple of different automations but i like simple, and i like to have as many things as possible in one placeā¦
thanks again
ian
@Blacky
I am attempting to figure a way to add a humidity sensor to keep the lights on as the wife LOVES to keep the door slightly ajar while showering so that the door sensor doesnāt trigger. Is there anyway to do that?
Thank you!
-
I am assuming you are talking about dynamic lighting when you say sun elevation. Adaptive Lighting would be different as I havenāt modeled dynamic lighting with Adaptive Lighting. I have never downloaded the integration so I am not sure how they do it. Dynamic lighting gives you full control so maybe your settings are different. If you like Adaptive Lighting then maybe stick with this or try and see at what points of Adaptive Lighting sun elevation = brightness / colour temp and adjust your settings to be the same or similar.
-
Nice.
-
Maybe have 2 automations and use your helper to switch them. You will need to create another template binary sensor so when the helper is OFF the binary sensor is ON. Then use them in the bypass to switch (toggle) the automations and set it up exactly how you like.
Hope this helps you.
Blacky
Hi John, I use my Bathroom Humidity Exhaust Fan blueprint to do this and if you look in the FAQ I show you my set up.
I would need more information, like maybe when your exhaust fan is ON you use this in the bypass to turn ON the lights so they stay ON and when the fan goes OFF then the automation can run in auto again.
Anything turns ON then you are showering?
Blacky
Hi,
I am facing a new situation BC the sunset is more earlier each day.
And chance to accomplish the following?
Night lights should be turned on by sun elevation, but never before 9 pm. And something similar for the morning.
@Blacky
Feature Request:
I think the following feature would be useful for several users:
Add a timer under āLight Controlā to have a delay before the lamp turns off completely after dimming down to the selected brightness.
An example of use would be:
- You enter a room that is completely dark. The lights are turned on at 100% by a motion sensor.
- You leave the room and the lights dim down to 20% after 3 minutes.
- Lights continue to be at 20% until another timer counts down after, for example, 15 minutes and then the lights are turned off completely.
Support:
I canāt somehow get my light to use transition OFF. Transition ON works fine.
I have tested several different light entities but none want to use transition OFF.
Do you have any tips on what could be wrong or how I can troubleshoot this?
You can use night lights time and sun elevation. Both conditions must be true for night lights to work.
Blacky
Hi Martin
For your feature request you can use a script to do what you are after. You will need a scene or a script for Lights - Switches - Scenes - Scripts and then you will need a script for Scenes - Scripts To Turn OFF. Make sure when you do this you add a helper into Scenes & Scripts - Toggle Helper.
For support 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
Cool, and thanks for your help. I will experiment with this today, but as a general rule:
- if I enable the Bypass Off with a binary sensor does the automation stay supressed until that binary sensor is switched off? If it does, then I can simply turn on a Night = True setting, keep this automation thereby off, allow another automation to control my cat-safe night settings for the lights, and then when itās Day again, turn off the Night=True sensor and have everything go back to normal.
Feature request:
Iām sorry but that did not helped me much. Maybe I can try read your FAQ/Best practices to understand what you mean
Support:
alias: Lights WC
description: ""
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.rorelse_wc_occupancy
light_switch:
entity_id:
- light.toalett_tak
include_light_control:
- use_brightness
- use_transition
include_night_lights: night_lights_enabled
night_lights_conditions:
- entity_state_enabled
night_lights_entity_state:
- input_boolean.sleepmode
night_lights:
entity_id: light.toalett_tak
night_time_delay: 2
time_delay: 3
include_night_light_control:
- use_brightness
- use_transition
night_light_transition_off: 4
night_light_transition_on: 5
night_light_brightness: 64
light_transition_on: 1
light_transition_off: 10
I will walk you through it.
We need to make 2 scripts and one toggle helper.
1st Script is to turn light ON.
- Navigate to Settings > Automatons & Scenes > Scripts tab at the top.
- Click on + Add Script & create new script.
- Click on add action.
- In search type ālight turn onā and select it.
- Add your light and the settings you would like ā¦ 100% brightness.
- Save the script and add the script into Lights - Switches - Scenes - Scripts. Donāt have you light entity in there only the script.
That turns your light ON, now we need to turn it OFF as per your feature request. Your time delay is 3 minutes, it will run the script to 20% brightness then wait 15 min and turn OFF light. To do this we will create another script.
- Navigate to Settings > Automatons & Scenes > Scripts tab at the top.
- Click on + Add Script & create new script.
- Click on add action.
- In search type light turn on and select it.
- Add your light and the settings you would like ā¦ 20% brightness.
- Click on + Add building Block
- In search type wait for time to pass and select it.
- Input 15 min
- Click on add action.
- In search type light turn off and select it.
- Select your light.
- Save the script and add the script into Scenes - Scripts To Turn OFF.
Now you have the light turning ON 100% and then turning OFF as per your feature request. Next we need to create a toggle helper.
- Navigate to Settings > Device & Services > Helpers tab at the top.
- Click the Create helper button.
- Select Toggle and then enter in a name then click create.
- Add the toggle helper into Scenes & Scripts - Toggle Helper.
Your done
Support
All your YAML looks good. Sometimes lights have inbuilt time delays that could be messing with it. Try and type 60 sec in and see if the light will slowly transition OFF.
Hope this helps you
Blacky
Thanks for the good description. But this doesnāt seem to work as intended. I thought the light and timer would reset to 100% if someone re-entered the room within those 20 minutes like in the example but it didnāt.
I have a flow in Node Red that handles this perfectly. But I wanted to try to achieve the same thing through a blueprint instead.
Regarding the transition OFF problem, it also works perfectly in Node Red with the same lamp.
Now Iām going to have to put this down and go back to Node Red, Iām sorry
I initially misled you regarding the āOFFā function, sorry. After testing it, instead of explaining the changes step by step, Iāll just provide the YAML for the OFF script. Please keep the line at the top and simply replace the code in the sequence.
alias: Light 20% # Keep your line here
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_pct: 20
target:
entity_id: light.toalett_tak
- wait_for_trigger:
- platform: numeric_state
entity_id:
- light.toalett_tak
attribute: brightness
above: 99
timeout:
hours: 0
minutes: 15
seconds: 0
milliseconds: 0
- if:
- condition: numeric_state
entity_id: light.toalett_tak
above: 99
attribute: brightness
then:
- stop: ""
else:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.toalett_tak
description: ""
If you are still having problems and you would like to sort it out then provide your YAML of the automation and I will look at it. Make sure you remove your light entity in Lights - Switches - Scenes - Scripts and only use a script.
I am interested in this. You say when turning ON the light it works but when you turn OFF the light it doesnāt. We send the same command for ON v OFF. Are you able to let us know what command node red sends when turning OFF the light? In the scripts you created you set the transition in the script not in the blueprint. Do they work?
Blacky
How can I make an automation where outdoor lights turn on when LUX is below certain value and that the lights stay on all night at 10% until lux raises to some level. I have door sensors on the doors and a motion sensor in the yard and I would want it to work so the lights stay on at 100% when door or motion is detected for 10 minutes and then they go back to 10% brightness. I just canāt get this to work.