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

Thank you!!! You are amazing!

@JaccoN

Thanks for the info :+1:

Automation 1

  1. Front light @ 20% when dark turned ON and OFF by another automation. All good.

Automation 2

Can you try this… I haven’t tested but :crossed_fingers: hopefully it will work.

  1. Front light in a scene and set at 100%. Enter the scene into “Lights - Switches - Scenes”.
  2. Extra ceiling light entered in as an entity and the light controls to 100%. Enter the entity into “Lights - Switches - Scenes”
  3. Scene to turn OFF set front light to 20%.
  4. Same ON and OFF conditions as set for automation 1. Example you could have the sun, ambient and or time condition. So automation 2 will not run out of automation 1 conditions… maybe 1 minute after automation 1 turns the light ON to 20% and maybe 1 min before automation 1 turns the light OFF. The OFF will probably be the main condition and the ON could be the same :thinking:

:crossed_fingers: Let us know if this works for you.

Blacky :smiley:

:smiling_face_with_three_hearts: Glad you like it…

Blacky :smiley:

Hi @Blacky, i already set this up. i made an alternative test with just 2 lights in my kitchen. As turn-off scene I set 1 off the lights to 20%.
I get exactly the same behaviour.
for the record, i don’t have automation 1 here, its just plain simple: 2 lamps that get triggered by a motion and after time T they turn of and 1 of them should stay on which is achieved by the turn-off scene.
Here is the code with your blueprint:

alias: Test blueprint with turnoffscene
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.aqara_motion_sensor_beweging
    light_switch:
      entity_id:
        - light.keuken_keuken_kast_414
        - light.keuken_keukeneiland_416
    time_delay: 0.2
    include_light_control:
      - use_brightness
    light_brightness: 50
    include_bypass: []
    motion_bypass_lights_on: []
    motion_bypass_lights_off: []
    include_night_lights: night_lights_disabled
    include_night_light_control: []
    night_lights_conditions: []
    night_lights_entity_state:
      - input_boolean.sleepmode
    light_transition_on: 5
    end_scenes:
      - scene.testscript_dim

but in mine setup i cannot make this work it the light is already on...

@JaccoN

Hi @JaccoN, what you are doing is you are entering both of your lights in as entities into “Lights - Switches - Scenes”. I have just tested it here and it works if you follow the steps.

Please read the instructions clearly. It is the same as above but we will keep it simple by using “Light 1” and “Light 2”. Obviously you can change the brightness to your liking.

  1. Create a scene for “Light 1” that is 100%. Enter the scene into “Lights - Switches - Scenes”.
  2. Enter “Light 2” in as an entity and enter the light entity into “Lights - Switches - Scenes”.
  3. Create a scene for “Light 1” that is 20%. Enter the scene into “Scenes To Turn OFF”.

Let me know if it works for you.

Blacky :smiley:

@Blacky, I see what you mean. I have to put the light that has two different brightnesslevels in a turn on scene and in a turn of scene.
I will give it a try and let you know.

Update: it works!
Only the downside is that the options in the blueprint are not applicable anymore on the lights which are called from the scene.

But i still don’t understand why i cannot call the lights directly from the blueprint even if i call a scene to modify the brightness in the Scenes-turn-off option. Its not what you expect. I mean: i call the blueprint, set the lights, the blueprint ends, and then i call an extra scene to do something with one of the lights which i call from the blueprint.
Don’t get me wrong, its not critique, its curiosity :slight_smile:
thks

hi, any idea why I would get Unknown error when trying to install this blueprint?
I have very few plugins, am on the latest version in the stable branch
image

@JaccoN

Nice one :+1: Glad you got it up and running.

You still can do it all in a scene. The main thing is you have Light 2 entity entered in and not in the scene with Light 1.

There are a lot of options and reasons why it is set up like this.

Anyway glad you got it up and running.

Blacky :smiley:

@dakipro

Not sure why it is doing this but I can see the blueprint address is not there. Could be your firewalls or your browser. If possible maybe try a different browser or try to import it on your phone.

Blacky :smiley:

Hi @Blacky

Thanks for the tremendous Blueprint!!

I have implemented a couple of instances of it in rooms where I don’t have motion sensors, rather I use a binary sensor Helper of type Times of the Day so that the automation activates at a certain time of day.

I have set my ‘Evening’ helper sensor as the main ‘Trigger Sensor - Binary Sensors - Schedule*’ and my Night helper senor as the Night Lights ‘Night Lights - Entity State’.

‘Use The Time Options’ is enabled and set to 5pm (the time the Evening helper sensor turns On) to 1am.
‘Night Lights - Start Time’ is set to 8:45pm - the same time that the Night helper senor turns On.
‘Night Lights - End Time’ is set to 1am.

My issue with this setup is that the lights don’t dim to the Night Lights brightness setting at 8:45pm. They stay at the non-Night Lights setting.

Here is my automation setup YAML:

alias: Front of House Lights
description: Automation of Front of House Lights
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.evening
    light_switch:
      entity_id:
        - light.front_of_home_driveway_266
        - light.front_of_home_front_porch_ceiling_387
        - light.front_of_home_front_house_sofitts_296
        - light.front_of_home_front_soffits_666
    time_delay: 225
    include_light_control:
      - use_brightness
      - use_transition
    light_brightness: 50
    light_transition_on: 3
    light_transition_off: 5
    include_sun: sun_enabled
    sun_elevation: 13.5
    include_time: time_enabled
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id:
        - light.front_of_home_front_soffits_666
        - light.front_of_home_front_porch_ceiling_387
        - light.front_of_home_front_house_sofitts_296
        - light.front_of_home_driveway_266
    night_time_delay: 195
    include_night_light_control:
      - use_brightness
      - use_transition
    night_light_transition_on: 3
    night_light_transition_off: 5
    night_lights_conditions:
      - time_enabled
      - entity_state_enabled
    night_lights_after_time: "20:45:00"
    night_lights_before_time: "01:00:00"
    after_time: "17:00:00"
    before_time: "01:00:00"
    include_bypass: []
    motion_bypass_lights_off:
      - input_boolean.lounge_sensor_light_bypass
    bypass_time_delay: 1
    bypass_auto_off_delay: 1
    include_bypass_auto_off: []
    night_lights_entity_state:
      - binary_sensor.night

Your welcome and thanks for your kind words :smiling_face_with_three_hearts:

Yes this is correct and was a feature added in to Version: 3.5. The link explains why this was introduce.

If you create 3 scenes,

  1. one for normal lights (set your brightness) and enter in “Lights - Switches - Scenes”
  2. one for night lights (set your brightness) and enter in “Night Lights”
  3. one with all your lights OFF and enter in “Scenes To Turn OFF”

I didn’t retest again… but if my memory serves me right, it should work :crossed_fingers: Transition should still work.

Let us know if this works for you.

Blacky :smiley:

Hello, If this was answered before then apologies I couldn’t find it. I’m using a presence detector to turn the lights on/off, based on Ambient light value. I also have an Ikea Styrbar that I would like to use to turn on or turn off the lights, when I don’t want the lights on or off when I’m in the room. What is the best way of setting this up, do I create another automation to turn on or off the lights, and then use the By-pass switch? Or what am i missing?

Thank you

OK :slight_smile:
I’ve set those scenes up this morning.
I’ll see how it goes tonight.

Cheers,
G.

@DaAliG

If you automation turns the lights on/off with presence detector and that stays ON when you are in the room then you can just turn them on/off as the automation will not receive another trigger as presence detectors are good keeping the state ON. If the presence detector goes OFF and back ON when your lights are OFF then it will turn the lights ON. The by-pass is to pause (disable) the automation. Try it out and if it works for you then your all good.

A good starting point is to read “The Settings & Best Practice Guidelines” Click Here.

Blacky :smiley:

Hi, I use this blueprint in my kitchen with an aqara P1.
I have set nightlights using the time condition so the lights only come on to 20% between 22:00 and 07:00.
At 22:00 the lights do indeed come on to 20%, however they still only come on to 20% after 07:00 the next morning. I have to manually turn the brightness back up to 100% every morning. I’m sure it’s just a setting I have missed. I’m pretty new to this so still learning. Any help would be appreciated.

@mattyscaife

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 :smiley:

I’ll do that tonight when I am home. Thank you.

I had a thought after I posted. I hadn’t specified a brightness for the day part of the automation. Am I correct in thinking the lights will just come on to their last known brightness when night lights ends if a “day brightness” is not specified??

I have since specified 100% brightness to the day part of the automation but not tested yet.

Thanks

Yep that will be it.

1 Like

I’ll let you know either way. So many options! Love it!

Hi,
I found a weird working mode for this automation.
It looks like If I set the option for bypass on Turn ON:
1 - Enable the By-pass - Turn lights ON

then the switch off timer DO NOT WORK.

I gueess this is not expected. Practically I would like to have an automation which disables the automatic lights turn on while I want to use just the automatic turn off.
It drove me crazy to understand the failure mode, but I now realized that the situation is the one described before.

What am I missing, or what is wrong with the automation?

Probably the problem is due to the fact that the automation doesn’t get the ON trigger and it does the count from the trigger ON instead of on the light ON.
But I guess this is not a useful way of working because in my previous automation I preferred to use to switch the lights off after a certain timeout regardless the event which switched the lights on.

Thanks