šŸ’” Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights

Hi Blacky,

Again, thank you so much for all your hard work. It is fascinating to see what you can build and how you think of solutions to all kinds of problems.

I’m a bit unsure of how the bypass works, even after carefully reading your documentation several times. As far as i understand it, the bypass ā€œturns off the automationā€ so one can turn on and off their lights as they want, for example with a physical switch. If that is the case, it makes sense there is also a ā€œauto turn offā€ of the bypass, which, in effect just ā€œturns onā€ the automation again. If that is the case, can you give me an example of a situation where that might be needed?

I have a zigbee switch connected to one of my lights. The switch has a button for turning on the light and another for turning off the light. I also have motion sensors which, in combination with your automation, controls the lights on the daily. In rare occasions, i want to turn the lights on manually, but without stopping/disabling/ā€œturning offā€ the automation. So if it usually turns off automatically after 30s of no motion, i want it to still do that when i turn it on manually, maybe with a cooldown period from turning on, used for giving me a chance to activate the motion sensor. Same with turning off lights.

This is how i imagined a bypass would work, but i might be wrong. I have the impression that when i turn it on manually, it never turns off, which makes sense if it works like my first paragraph.

Can you tell me how the bypass works?
Can you tell me how i can achieve the behavior of the second paragraph?

Thank you so much for all your time

Hello Blacky, I use a motion sensor (with lux sensor, Aqara RTCGQ11LM) to turn on my kitchen lights. and I want to use your blueprint for the following:

  1. turn on the lights at a certain lux value (when it’s dark enough)
  2. when turned on, then after 10 minutes and no motion detection, lower the brightness to a certain value (and if possible, change colour temp to warm)
  3. after 30 minutes and no motion detection, turn off lights (using turn of scene)

I have the feeling this is possible with you Blueprint, but with so many options i only get one or two things working. Can it be done?

kind regards,
Yenzen

@Blacky This what I have:

alias: Overloop 1e
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.overloop_1e_sensor_occupancy
    light_switch:
      entity_id:
        - light.overloop_1e_1
        - light.overloop_1e_2
    include_light_control: []
    include_dynamic_lighting: enable_time_controled_brightness
    dynamic_lighting_min_brightness: 5
    dynamic_lighting_max_brightness: 80
    dynamic_lighting_time_start_evening: "19:00:00"
    dynamic_lighting_time_end_evening: "22:00:00"
    dynamic_lighting_time_start_morning: "06:30:00"
    dynamic_lighting_time_end_morning: "08:30:00"
    include_light_colour_control: use_colour_temperature
    light_colour_temperature: 2200
    time_delay: 2
    include_time: time_enabled
    before_time: "23:30:00"
    after_time: "07:00:00"
    dynamic_lighting_step_value: 5
    include_bypass:
      - bypass_enabled_turn_on
    motion_bypass_lights_on:
      - input_boolean.overloop_1e_override_on
    bypass_auto_off_delay: 2
    include_bypass_auto_off:
      - bypass_auto_off_enabled_on
    motion_bypass_lights_off:
      - input_boolean.overloop_1e_override_off

@Blacky can you elaborate on these situations?

Sensor Light is running

  • a device (eg: lutron dimmer switch) brightness is changed.
  • device is turned off while Sensor Light is still running (per schedule)
  • change to a schedule group

Sensor Light has stopped

  • how to best restart it as if it hadn’t stopped

History

  • any way to trace code flow? I see traces, and I’ve downloaded sensor light yaml to another editor, but not expert enough to read it without more learning

I’m testing in real time with a few sensor light blueprints turned on, but not knowing how to look inside at the operation makes it very slow to understand.

@Strux

  1. Porch light. Visitors coming over and you just want the light ON. Turn the bypass option 1 ON and then if you forget to turn it OFF it will turn it OFF for you.
  2. Cooking outside on the BBQ and you just want the light to stay ON and then it will turn OFF for you.
  3. Automation link.
  4. Etc, so many examples to list.

You can just trurn the light ON and the automation will take over if the trigger is triggered.

The automation will do this for you.

Click here

You can use the :stop_button: Manual Control Status Tracker blueprint for when you turn it ON but turning it OFF just let the automation do that for you.

Blacky :grinning:

@TheYenZen

This will be done in scripts.

Script or scene to turn ON your lights, 10 min time delay and use the ambient option.

When the trigger goes OFF a script to handles what you would like in Scenes - Scripts To Turn OFF. Make sure you put a Scenes & Scripts - Toggle Helper in.

  1. Lower the brightness to X and set the light to Y.
  2. Wait for 30 min then do XYZ.

Blacky :grinning:

@basje

Thanks for t=your YAML… I have tested it here and everything seems to be working correctly.

Blacky :grinning:

@SoccerTX

The best way to understand it is by checking the traces… just follow the orange line through the conditions and actions. Clicking on an action will show what it’s doing. But fair warning: this blueprint is complex, and the logic is intense, so don’t worry if it’s hard to follow!

Blacky :grinning:

Hi @Blacky , thank you so much for this blueprint as I’ve just started using HA! I’ve enjoyed it for the past few days.

I have noticed some odd behaviours and wonder if you have a quick-fix for me.

I have a mmWave sensor that detects motion used as a trigger to toggle a dimmer’s state with a time delay of 1 minute.

(1) There are times where it wouldn’t turn off despite waiting for 5 minutes. How do I troubleshoot this?

(2) Tricky situation where a switch controls the same light. Person A goes to the toilet, triggers the mmWave sensor, light turns on, Person A exits the toilet and manually presses the wall switch to turn it off. Person B walks in almost immediately or 1 minute later but it wouldn’t switch on. Wondering if there’s a cooldown period before it can trigger again to turn the lights on again?

I am currently in a process of simplifying my setup and this blueprint is of a great help. However I have 2 scenarios, I am not sure how to replicate using this blueprint. Could you please help me?

I was using node-red for my lights automation and I was quite used combine time and sun range as this:

Scenario 1:

  • start at sunset (in this blueprint it would be sun elevation)
  • end 21:00

Scenario 2: for other lights I had 2 ranges.

Morning

  • start at 5:00
  • end dawn (in this blueprint it would be sun elevation)

Evening

  • start at sunset (in this blueprint it would be sun elevation)
  • end 21:00

Is it possible to replicate these settings in this blueprint? Thanks.

I have a small problem with this blueprint and my bathroom light. I have it configured to switch the light on automatically upon presence detected. This works fine. However, sometimes, out of habit, I will switch the light on manually before walking into the bathroom. If I do that, the automation somehow switches off the light within a split of a second, as soon as the presence is detected.
Note that I don’t use scene for turning the light on, but actual light entity.

Is this a known issue? Any way to solve it?

Using 8.0 version of the blueprint. The automation configuration:

alias: Bathroom main light on/off on motion
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bathroom_motion_detector_occupancy
    light_switch:
      entity_id: switch.bathroom_main_light
    time_delay: 1
    include_time: time_enabled
    after_time: "09:00:00"
    before_time: "23:00:00"

Hello Blacky,
Thanx for your quick response. I’ll soon test you suggestions!

greetings, Yenzen

Well, going to do some more digging then! Thanks and keep up the good work!

Hi @Blacky

Sorry for the delay, here’s the yaml :

alias: Gestion lumiĆØre de la SAM
description: LumiĆØre SAM
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.presence_sensor_fp2_918e_presence_sam
    light_switch:
      entity_id:
        - light.ampoule_1_salle_a_manger
        - light.ampoule_2_lumiere_salle_a_manger
        - light.ampoule_3_lumiere_salle_a_manger
        - light.ampoule_4_lumiere_salle_a_manger
    time_delay: 0
    include_sun: sun_disabled
    include_ambient: ambient_enabled
    ambient_light_sensor: sensor.light_sensor_level_salon
    ambient_light_value: 40
    ambient_light_high_value: 140
    include_dynamic_lighting: enable_time_controled_colour_brightness
    dynamic_lighting_max_lux: 100
    dynamic_lighting_max_colour_temp: 5500
    dynamic_lighting_min_colour_temp: 2700
    dynamic_lighting_heartbeat: 0.25
    ambient_light_options: ambient_light_option_enabled
    include_light_control:
      - use_brightness
      - use_transition
    include_light_colour_control: use_colour_temperature
    include_night_lights: night_lights_enabled
    night_lights_after_time: "00:22:00"
    night_lights_before_time: "00:07:00"
    night_light_brightness: 1
    include_night_light_colour_control: use_colour_temperature
    night_light_colour_temperature: 2500
    include_night_light_control:
      - use_brightness
      - use_transition
      - if_lights_are_on_adjust_when_crossing_over
      - manage_scripts_crossing_over
    night_lights:
      entity_id:
        - light.ampoule_1_salle_a_manger
        - light.ampoule_2_lumiere_salle_a_manger
        - light.ampoule_3_lumiere_salle_a_manger
        - light.ampoule_4_lumiere_salle_a_manger
    night_time_delay: 1
    night_lights_conditions:
      - time_enabled
      - entity_state_enabled
    night_lights_entity_state:
      - binary_sensor.do_not_disturb_2
    dynamic_lighting_min_lux: 40
    dynamic_lighting_min_brightness: 0
    dynamic_lighting_step_value: 4
    sun_elevation: -1.5
    dynamic_lighting_lux_sensor: sensor.light_sensor_level_salon
    motion_bypass_lights_on: []
    include_bypass: []
    motion_bypass_lights_off: []
    include_time: time_disabled
    before_time: "23:59:59"

The copy/paste didn’t go well from iOS :sweat_smile:

I can confirm that everything works fine during the night but during the day, my ights don’t go on at all. And when I turn them manually, the automation turns them off when the trigger clears itself.

Thanks in advance for your advise :slight_smile:

@Aeyko

Welcome to the community.

  1. When your light turns ON your trigger (mmWave sensor) has to go clear and then it will wait 5 min and then turn OFF.

  2. You will find when you exit your mmWave sensor is detected so if you turn the light OFF in order for the automation to turn the light back ON it needs to be triggered again so your mmWave sensor must go clear and then detected again. There is no cool down it will be your mmWave sensor.

Blacky :grinning:

@fixer

Have a look at this blueprint :high_brightness: Smart Light.

Blacky :grinning:

@wrobelda

Thanks for your YAML. I have tested it here and can’t fault it. Could something else be turning it OFF?

Blacky :grinning:

@Zeroth25

You got a few thing going on

  1. Your using dynamic lighting. You have 0% for brightness but no Dynamic Lighting - Toggle Helper.
  2. Ambient will turn the light OFF above 140lux. It will only come ON when below 40lux.
  3. Night lights your using state (do not disturb) and your using time from 12:22am to 12:07am is this correct? Both have to be true but your time will be ON most of the day anyway only OFF between 12:07am to 12:22am.

Blacky :grinning:

1 Like

As I reread my original post I did not make myself clear. I want to use only motion sensor as trigger and use it in the 2 ranges to turn on lights.

After more thinking I could do it as daily light from sunset to dawn (as sun elevation) and use night light with 0% light from 21:00 - 5:00. I am not sure if it will work :slight_smile:

@fixer

Okay then

  1. Set time condition to well before sunset (3pm) and end at 21:00. The set the sun elevation for Sun Elevation Falling sunset and leave Sun Elevation Rising.

Now both conditions have to be true for the automation to work so it will be active from sunset till 21:00.

  1. same, same but 2 automations.

Blacky :grinning: