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

@hazio

Even though we call the second set of lights Night Lights, you can also use them to set a different Time Delay. To do this, incorporate the state condition in the Night Lights and add the ā€˜Guestā€™ mode. When ā€˜Guestā€™ mode is ON, the system will use the night light settings, allowing you to adjust the Time Delay accordingly.

Blacky :smiley:

@run51

Welcome to the community.

You are using a device and only entities are supported. You will need to expand your device done to entities. Click here on the how to.

Blacky :smiley:

Hey Blacky, love you work with this one mate.

Just a quick one, cant seem to select a ā€˜lux entityā€™. See screenshots. Using an ldr to measure voltage and coverting to
Lux. Is it my unit of measure or maybe do i need a unique id?

Thanks mate.


Hi @Blacky,
first I like to thank you for the outstanding blueprint. It really solves almost all conditions I have in my house.
However there is one condition I canā€™t solve so far:

  • I have 1 light and 1 LED in my bathroom.
  • A motion sensor to trigger the lights.
  • Daymode = both lights are turned on with a turn off delay of 20 min
  • Night mode = only LED is turned on
  • Night mode is triggered between 23:00 - 6:30.

Now the problem:

  • I go into the bathroom at 22:55 (to take a shower). => Both Lights are turned on.
  • At 23:00 the lights are turned off hard (before the 20 min delay). Poor feedback from the family on that condition!

=>I need the lights to stay on until the last delay ends (20 min) when the motion sensor triggered the light on. Once after this ā€œlastā€ delay I would expect the night mode LED to be triggerd on motion detection.

Can I solve this with your automation?

@WazzaSparky

Hi Shayne,

Thanks for your kind words.

If you just copy / paste your entity ID into the input and click save.

Blacky :smiley:

@thesmer

Thanks for the info! A 20-minute delay does seem like a long time to keep the lights on. Is the goal to keep them on while showering? If the motion sensor isnā€™t detecting movement in the shower.

One approach you could consider is reducing the delay and using another method to keep the lights on, like a door sensor or even a fan trigger. If youā€™re controlling a bathroom fan with Home Assistant, Iā€™d recommend checking out my :shower: Bathroom Humidity Exhaust Fan blueprint, which includes an Automation Link for keeping lights on during a shower.

Also, if the lights still turn off too soon, you could try using my :honeybee: Bee In The Hive Sensor, which combines multiple sensors for smarter room control. That might help better detect when someone is in the bathroom even if the motion sensor misses them.

Blacky :smiley:

yeah I do. 2 minutes

alias: Flurlicht
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.bewegungsmelder_occupancy
    include_light_control:
      - use_brightness
      - use_transition
    light_transition_on: 0.5
    light_transition_off: 2
    light_brightness: 90
    light_colour_temperature: 2500
    light_switch:
      entity_id:
        - light.flurlichter
    time_delay: 2
    night_time_delay: 1.5
    include_night_light_control:
      - use_brightness
      - if_lights_are_on_adjust_when_crossing_over
      - use_transition
    night_light_brightness: 5
    night_light_colour_temperature: 2500
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    include_bypass:
      - bypass_enabled_turn_on
      - bypass_enabled_turn_off
    motion_bypass_lights_on:
      - input_boolean.bypass_flurlicht
    night_lights_after_time: "23:00:00"
    night_lights_before_time: "07:20:00"
    night_lights:
      entity_id:
        - light.flurlichter
    include_bypass_auto_off:
      - bypass_auto_off_enabled_off
    motion_bypass_lights_off:
      - input_boolean.flurlichter_bypass_off
    bypass_auto_off_delay: 2
    include_light_colour_control: use_colour_temperature
    include_night_light_colour_control: use_colour_temperature

Iā€™ve just used one of the new Xiaomi/Mi presence sensors with the Automation Script and it seems to work well.

https://smarthomescene.com/reviews/xiaomi-battery-ble-occupancy-sensor-review/

It was a bit of a pain to add to HA but now itā€™s working.

So replace your motion sensor with one of these, it uses PIR to detect first movement and radar to stay detected. So whilst you are in the shower it should just stay on.

Thatā€™s my goal now, Iā€™ve been holding off an auto light in the bathroom until I had got around the having to wave at it every few mins. And as this is battery thereā€™s no wires to run.

1 Like

Hi, Iā€™ve been using your blueprint for a while and love seeing how much hard work has been pit into it.

Over the past few weeks a few of my Automations with the blueprint hadnā€™t been triggering at night. Yesterday I moved to zigbee2mqtt and took the plunge updating the blueprint and recreating all my Automations.

None of my night timers are working. Could somebody please cast an eye over this and help me out?

Thanks in advance

alias: "Light Hallway "
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.g_hallway
    light_switch:
      entity_id:
        - light.highway_light_f_door
        - light.highway_light_k_door
        - light.highway_light_stairs
        - light.highway_light_t_door
    night_lights:
      entity_id:
        - light.highway_light_f_door
        - light.highway_light_k_door
        - light.highway_light_stairs
        - light.highway_light_t_door
    night_time_delay: 0.5
    include_night_light_control:
      - use_brightness
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 5
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "22:00:00"
    night_lights_before_time: "07:00:00"
    include_time: time_enabled
    after_time: "07:00:00"
    before_time: "22:00:00"
    time_delay: 2.5

I am getting the following error when trying to run the script and I donā€™t know how to solve this at the moment.

The automation "Acceuil to Bar Bureau" (`automation.acceuil_to_bar_bureau`) has an unknown action: `light.turn_on`.

This is the YAML for the script:

alias: Acceuil to Bar Bureau
description: ā€œā€
use_blueprint:
path: Blackshome/sensor-light.yaml
input:
motion_trigger:
- binary_sensor.detecteur_accueil_occupancy
light_switch:
entity_id:
- switch.lumiere_bar
- switch.lumiere_bureau
time_delay: 6

I am using ZBMINI for light control and SNZB-03 for detector.

Reread the manual on timing and disabled day. Worked a treat

Just quick follow up: I edited the original script and replaced light.turn_on / off with switch.turn_on / off and it has been working fine since.

Hello,
Is there posibility to control Delay time from helper, without entering settings in automation?

Update: Managed to edit blueprint to set time delay with input_number entity

1 Like

First of all, I wanted to thank you for the incredible work youā€™ve done on the light automation system. Itā€™s really impressive!

I have a question about a specific scenario. There is a time restriction set for the lights, and within that time frame, the light can turn on by switch (also used in light section, so i canā€™t use bypass). However, I want to ensure that the light always turns off, regardless of the time or other conditions, if thereā€™s no presence detected by the presence sensor (used as triger). How can I set it up so that the light will automatically switch off when thereā€™s no presence, even if it was triggered within the not allowed time frame?

Hi - I am enjoying this for my motion sensor automation. I tried to add an email notification but am unable to get it working properly. Is there something i might be missing to get it to send an email when the motion sensor triggers?

Thank you

@Hometoza

Thanks for you YAML. Everything looks good. The only thing I can think of is if your ON bypass goes ON and OFF it will turn your light ON and OFF. To confrim this in your Bypass - Time Delay rather than setting it to 0 try putting in a time of 1. If it stops the light turning ON and then OFF and the light stays ON for a minute then it could be the bypass. You could also look at the trace to see what triggered the light ON and OFF.

Blacky :smiley:

@3earnshaw

Thanks for your YAML as it helps me help you :+1:

In Time you have 7am to 10pm. This is a global condition, so the automation will only run between these times and your night light will not work. Since you would like the automation to run 24/7 just disable the Time and keep the night light time and it should all work.

Below is your fixed YAML.

alias: "Light Hallway "
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.g_hallway
    light_switch:
      entity_id:
        - light.highway_light_f_door
        - light.highway_light_k_door
        - light.highway_light_stairs
        - light.highway_light_t_door
    night_lights:
      entity_id:
        - light.highway_light_f_door
        - light.highway_light_k_door
        - light.highway_light_stairs
        - light.highway_light_t_door
    night_time_delay: 0.5
    include_night_light_control:
      - use_brightness
      - if_lights_are_on_adjust_when_crossing_over
    night_light_brightness: 5
    include_night_lights: night_lights_enabled
    night_lights_conditions:
      - time_enabled
    night_lights_after_time: "22:00:00"
    night_lights_before_time: "07:00:00"
    time_delay: 2.5

EDIT: Just read your 2nd postā€¦ glad you got it working.

Blacky :smiley:

@neoraptor123

I have tested it here and I donā€™t receive the error so you shouldnā€™t need to edit anything, but if it works for youā€¦

Blacky :smiley:

@slavatyn

Welcome to the community.

Thanks for your kind words.

You can set up an automation in Home Assistant for this. For example, if the time delay in your blueprint is 5 minutes, you can create a custom automation that triggers when your presence is set to ā€˜clearā€™ and the light is still ON after 6 minutes. This way, the light will turn OFF automatically. The blueprint will take priority, but outside of the defined hours, your custom automation ensures the light turns OFF if it remains ON after 6 minutes.

Hope this makes sense.

Blacky :smiley:

@JeepDog64

Your probably best to set up a custom automation that send you an email when your motion sensor is triggered and then use this blueprint to control the light.

Blacky :smiley: