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

i also noticed a change from 4.8 to 4.9 in sun conditions.
now my lights at the dining table sometimes turn off with the trigger condition sun. (whene we are eating)
4.8 worked perfectly.

@mrw2828

Hi Matt

Awesome, glad you are up and running… thanks for letting me know :+1:

Blacky :smiley:

@markist

Scenes are a different animal. They dont have an ON or OFF state they just send a command to do what you asked. I do have this on my list but the best way for now it not to use scenes and use light entities.

Blacky :smiley:

@propi62

Just checked all the sun conditions again. All working here. There were also no changes made to the sun condition from 4.8 to 4.9.

The only time it will turn OFF lights is at sunrise (crosses from below to above sun elevation setting) and that is what we are asking the automation to do (Automation to only work when below sun elevation).

Please confirm this. If you can give me your automation YAML and your trace line when it does this I can see what it happening.

Blacky :smiley:

i use two automatisation how you told me to use with 4 timeslots (morning, day, evening, night)

alias: Licht Esstisch - Bewegung Morgen und Nacht
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    after_time: "22:00:00"
    before_time: "07:30:00"
    include_time: time_enabled
    motion_trigger:
      - binary_sensor.bewegung_esstisch_occupancy
    time_delay: 3
    ambient_light_sensor: sensor.bewegung_esstisch_illuminance_lux
    ambient_light_options: ambient_light_option_enabled
    include_ambient: ambient_enabled
    include_sun: sun_disabled
    include_light_control:
      - use_transition
      - use_brightness
    light_brightness: 50
    light_transition_off: 7
    night_lights_after_time: "22:00:00"
    night_lights_before_time: "06:00:00"
    night_lights:
      entity_id:
        - scene.esstisch_nur_mitte
    include_night_light_control:
      - use_brightness
      - use_transition
    night_light_transition_off: 7
    night_light_transition_on: 3
    night_light_colour_temperature: 3000
    light_colour_temperature: 3000
    night_time_delay: 2.5
    include_night_lights: night_lights_enabled
    night_light_brightness: 1
    light_switch:
      entity_id:
        - light.esstischmqtt
    light_transition_on: 3
    ambient_light_value: 80
    bypass_time_delay: 0.5
    night_lights_conditions:
      - sun_enabled
    night_lights_sun_elevation: -2
    include_bypass:
      - bypass_enabled_stop
    motion_bypass_lights_stop:
      - input_boolean.esstischbewegung
    end_scenes:
      - scene.esstisch_off
alias: Licht Esstisch - Bewegung  Tag und Abend
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    after_time: "07:30:00"
    before_time: "22:00:00"
    include_time: time_enabled
    motion_trigger:
      - binary_sensor.bewegung_esstisch_occupancy
    time_delay: 3
    light_switch:
      entity_id: light.esstischmqtt
    ambient_light_sensor: sensor.bewegung_esstisch_illuminance_lux
    ambient_light_value: 80
    ambient_light_options: ambient_light_option_enabled
    include_ambient: ambient_enabled
    include_sun: sun_disabled
    include_light_control:
      - use_transition
      - use_brightness
    light_brightness: 90
    light_transition_off: 7
    night_lights_after_time: "19:30:00"
    night_lights_before_time: "22:00:00"
    night_lights:
      entity_id:
        - scene.esstisch_nur_mitte_abend
    include_night_light_control:
      - use_transition
    night_light_transition_off: 7
    night_light_transition_on: 2
    night_light_colour_temperature: 3000
    light_colour_temperature: 3000
    night_time_delay: 1
    include_night_lights: night_lights_enabled
    night_light_brightness: 40
    light_transition_on: 2
    bypass_time_delay: 0.5
    night_lights_conditions:
      - sun_enabled
    night_lights_sun_elevation: -1
    include_bypass:
      - bypass_enabled_stop
    motion_bypass_lights_stop:
      - input_boolean.esstischbewegung
    end_scenes:
      - scene.esstisch_off

Hey!

Thanks for the blueprint! I was trying to figure out this sensor thing for a whole day until I realized there are blueprints to do that!

One qestion I would like to ask - is there a way to set a switch/light as a trigger as well and make it actually work?
I tried adding “switch” and “light” to the filters in the trigger and it does turn the light on, but it does not turn the light off if motion was not detected before (e.g. when I just turn the lights on from HA directly).
Looks like the timer counts down from motion detection rather than from lights turning on.

Thank in advance

Thanks for the blueprint! I do have an issue with dynamic lighting though. It does not seem to trigger for some reason. I have set the heartbeat to 1 min, but the lights do not change with the lux sensor. (That sensor updates every 30s). If I click “Run” on the automation then it updates the lights in accordance with the lux value. But if I let it run by itself then the light does not change when the lux value changes. I use two light group helpers for the lights to be controlled. Could that be the reason?



Hi, I am coming from a version below 2 or something, and am really impressed with how far this blueprint has come! With all these new options it would be great to have them categorized, and foldable, zo when you want something simple, you can hide (fold in) the options you don’t use. But great work anyway!

Thanks for a great blueprint! I´m experiencing a slight issue with the «Bypass Auto-OFF - time delay». I have a virtual switch dedicated for this purpose (switch.autolight1). I would like the switch to be turned off after a delay defined in the slider - but this does not seem to happen. Turning the switch on makes the lighting go in manual mode as expected - and when I manually turn the switch off the blueprint will return to automatic light control. All good except for the Bypass Auto Off - time delay function​:+1::smiley:

This is very confusing, you are using ambient and in night lights sun condition and can’t work out your times. I have spent 30 min trying to work it out but still cant so rather than trying to work out what you are trying to do can you explain.

Blacky :smiley:

Firstly welcome to the community.

Can you explain what your are trying to do as I have other blueprints that I think may suit you better but first I need to understand.

Blacky :smiley:

@Sleepy81

Your welcome.

No, I have just tested light groups and they work. Have you enabled dynamic lighting?

Let us know how you go.

Blacky :smiley:

Thanks, hope you like them.

I agree.

No problem, your welcome.

Just tested it here all good and working.

Have you enabled this option?

Let us know how your go.

Blacky :smiley:

Yes, and I found the reason. For whatever reason the lux sensor did update accordingly, but the presence sensor was stuck in occupied. That should not cause the dynamic lights to not work, but for some reason it did. So fixing the presence sensor fixed the dynamic lights also. :slight_smile: No idea how or why this happened. :slight_smile:

All good the main thing is you got it working. :+1:

1 Like

Quick additional question:

The Time Option. Is the lights supposed to turn off when the End Time is reached? I had a blueprint running now that had an end time of 1600. At exactly 1605 my light went off. That corresponds to the 5 min Time Delay setting I have set.

I was expecting the automation to just stop controlling the lights at 1600, but it looks like it instead kind of sent the equivalent of a “not occupied” message at 1600, then started the timer for the 5 min delay, and then at 1605 turned the lights off.




Yep that is how it works.Maybe I should change it.

EDIT: Yes will change it. Be out in the next update. All done.

2 Likes

Awesome! Looking forward to it. If I may make a suggestion for a further update as well. I have kind of a strange scenario where I would like to dynamically adjust the lights based on a lux sensor, but at the same time adjust the max setting of the lights depending on the time of day. In the morning (0200-1000) and afternoon (1600-1900) I want it to be not too bright so I set a 50% max light. Midday (1000-1600) I want to have more light so I set 75%. In he evening (1900-0200) I set 35% max to make the lights more comfortable.

To solve this I use 4 automations with a time start and end to activate and deactivate the different automations (or that will work from the next update. :slight_smile: ). Would I be possible to make this possible within one automation? Sort of a Dynamic Max Light setting based on time? Or a Dynamic Dynamic Light (DDL)? :joy:

First of all: @Blacky, thanks for all the work you’re putting into this wonderful blueprint. Now as for my question:

I can’t get the by-pass to work. What I want is:

“Whenever I turn on the by-pass switch, the light should stay in the current status. After 2 hours the by-pass switch should turn off and the light should be controlled by motion again.”

I’d use this for watching a movie (light should stay off) or reading a book (light should stay on, even if no motion is detected).

But with the following setup the by-pass did nothing. The controlled light turned off as “normal” when no motion detected, and I think the by-pass switch stayed on for more than the defined two hours. It’s as if the automation is completely ignoring the input_boolean.bypass_stehlampe.

What am I doing wrong? I’m using version 4.8. Thanks to anyone who can help.

alias: Sensor based Wohnzimmer Stehlampe
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.motion_wohnzimmer
    light_switch:
      entity_id: light.wohnzimmer_stehlampe
    time_delay: 2
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.wohnzimmer_light_level
    ambient_light_value: 10
    motion_bypass_lights_stop:
      - input_boolean.bypass_stehlampe
    include_bypass_auto_off:
      - bypass_auto_off_enabled_stop
    bypass_auto_off_delay: 120