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

Hi all,
I have a simple application and thought i could use this blueprint. But the complexity is a bit overwhelming.
I want to reset my Internet router some time during the night, for example at 02:00 and switch it back on at 02:15.all other times the router should be stayed ON.
I want to use a TAPO Plug for this (entity: switch.tapo_smart_wcd_10)
But I do not know to tackle this…
I was thinking of using Night Lights Mode, but instead of switching a light ON, I just want to switch it OFF for 15 minutes.
.
This is what I came up with, but I dont see any On or OFF functions:

alias: Smart Light Fritz!Box 7490 - Reset (Tapo 10)
description: Smart Light voor uit- en aanschakelen Fritz!Box 7490
use_blueprint:
  path: Blackshome/smart-light.yaml
  input:
    after_time: "03:00:00"
    before_time: "02:00:00"
    light_switch:
      entity_id: switch.tapo_smart_wcd_10

I am sure, I do somthing stupid or do noth know how to use the Bp properly.
Anyone who could help me with this?

And Ohhh, I forgot something; with a restart from Home Assistant, the Smart Plug should default to ON, so my Internet connection comes on-line again…

I try it for the first time. I can’t trigger any lamp or scene.

Here is the yml

talias: Sensor Light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.0x001788010201002f_occupancy
    end_scenes:
      - scene.bad_hell

+1 i have the same use case, motion activated lighting in the ceiling and a mirror light which is turned on manually. Right now I just have a second automation to “follow” ceiling light if it’s turned off.

I will move this to the correct blueprint.

Blacky :smiley:

@Olli0073

You have your scene in the Scenes - Scripts To Turn OFF and it should be in Lights - Switches - Scenes - Scripts.

If you use a scene then you should create a Scenes & Scripts - Toggle Helper and then you need to create another scene with everything OFF and add this scene into Scenes - Scripts To Turn OFF.

I am thinking that you may not need a scene… then you just add your light entities into Lights - Switches - Scenes - Scripts and set all the light settings in Light Control as this is a lot easier than creating scenes.

talias: Sensor Light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.0x001788010201002f_occupancy
    light_switch:
      entity_id: scene.bad_hell

Blacky :smiley:

@xtfrost

For you mirror light that you turn ON manually use this blueprint :magic_wand: Manual light control with auto OFF and opt to use the Motion Sensor Option.

Blacky :smiley:

I just made a simple automation to always turn off when the ceiling lights turn off, I usually push the button to turn the lights off, where motion off is just a “backup”

But the Manual light is just what I need for other rooms, where the lights arent turned off manually - You almost have an automation for everything, thanks :smiley:

1 Like

Blacky,

I’ve been using your blueprints for a while now annd love them thank you! I cannot for the life of me get the nightlight mode to trigger on from my motion sensor. It works perfectly during the day time hours I have configured, however at night it will never trigger.

If I run the automation manually during the night it will turn on the lights correctly.

id: '1701985979449'
alias: Upstairs Bathrooms Lights
description: ''
use_blueprint:
 path: Blackshome/sensor-light.yaml
 input:
   motion_trigger:
     - binary_sensor.upstairs_bathroom_motion_sensor_occupancy
   light_switch:
     entity_id: light.upstairs_bathroom_lights
   end_scenes: []
   include_light_control: use_brightness
   include_time: time_enabled
   after_time: '05:00:00'
   before_time: '22:30:00'
   include_night_lights: night_lights_enabled
   night_lights:
     entity_id: light.upstairs_bathroom_lights
   include_night_light_control:
     - use_night_brightness
     - use_brightness
   night_light_brightness: 2
   night_lights_after_time: '22:31:00'
   night_lights_before_time: '04:59:00'
   time_delay: 30
   include_bypass: bypass_enabled_stop
   night_time_delay: 3
   night_lights_conditions:
     - time_enabled
   night_lights_entity_state:
     - binary_sensor.upstairs_bathroom_motion_sensor_occupancya

Simple fix. You need to include your Night Lights time window in the main time window.

1 Like

Hi Blacky, this is an amazing blueprint! One small request, is it possible to add an option to specify brightness of bypass? I’m using this to control a zigbee bulb that I typically want at 70%, then 5% for night light mode, but would like it to be at 100% if I activate the bypass switch.

I jumped into the yaml config and it is much more complex than the automation I have ben playing with so far :grimacing:

Thank you!

Hi Blacky,

I have a question. Are the bypass switches “and” or are they “or”?
They seem to be ignored :confused:

@Blacky
Hi. Can you add an function for an brightness sensor? So I can simulate the funtion of the hue app for brightness and motion sensor.
So I can choose as input that the motion sensor ist enabled and teh brightness ist above oder under a limit.

Hi Blacky,
Great automation. I love the brightness adjustment based on lux option. I understand we can set night lighting conditions when a boolean switch is turned on. Is there a way to set lighting for other modes (other than night)? The only way I see is to use the bypass feature and have another automation activate a scene. Is this correct or am I missing something?
Louis

:santa: Santa is coming:christmas_tree:and 2025 :partying_face:

@Blacky
Many thanks for your comprehensive and handy blueprints, and for all the support throughout the year.
Merry Christmas and all the best for the New Year!

3 Likes

Hey Blacky,

I need to implement a second state for my lights. They should dim to 50% before they go off. But this only should happed if the turned on by the sensor.

Where can I implement such a sequence?

Thx for this fantastic blueprint.

@Spencer8742

Because you are wanting the automation to run 24/7 you don’t need to enable the main time condition so I have disabled that and cleaned up your YAML as I see there were some old code in there. Also in Night Light Control I enabled If lights are ON, adjust the lights when crossing over so if the lights are ON they will transition to the correct brightness. Up to you if you don’t want that then just disable it. Also consider using the Transition if required. Below is you code fixed up.

Note: If you were not running 24/7 then your main time condition must include the night light time. Example main time from 5pm to 5am and night light time from 10:30pm to 5am. You can see the night light time is included in the main time.

id: '1701985979449'
alias: Upstairs Bathrooms Lights
description: ''
use_blueprint:
 path: Blackshome/sensor-light.yaml
 input:
    motion_trigger:
      - binary_sensor.upstairs_bathroom_motion_sensor_occupancy
    light_switch:
      entity_id: light.upstairs_bathroom_lights
    include_light_control: use_brightness
    include_night_lights: night_lights_enabled
    night_lights:
      entity_id: light.upstairs_bathroom_lights
    include_night_light_control:
      - if_lights_are_on_adjust_when_crossing_over
      - use_brightness
    night_light_brightness: 2
    night_lights_after_time: "22:30:00"
    night_lights_before_time: "05:00:00"
    time_delay: 30
    night_time_delay: 3
    night_lights_conditions:
      - time_enabled

Enjoy

Blacky :smiley:

@will5

Yeah there is a lot of logic in the code. You could have a custom automation that when you turn the bypass ON it sets your light to 100% but I can see when testing this I need to fix a bit of logic in this blueprint so when you turn the bypass OFF it resets you lights to the correct % value. I will have to update the blueprint for this to work.

Blacky :smiley:

1 Like

@victoroos

When you turn ON a bypass, it executes the action associated with that bypass. If you activate another bypass, the system will perform the action for the newly activated bypass.

Examples:

  • Turning ON Bypass Option 1 turns the lights ON.
  • Turning ON Bypass Option 2 turns the lights OFF.

Once all bypasses are turned OFF (cleared), the system evaluates site conditions and reacts based on your trigger settings.

Scenarios:

  • If the lights are ON and you turn OFF the bypass, they may not turn OFF immediately because:
    • The trigger is still active.
    • The Bypass - Time Delay is still in effect.
  • If the lights are OFF and you turn OFF the bypass while the trigger is active, the lights may turn ON depending on the conditions you’ve set.

Blacky :smiley:

@Olli0073

I think your asking for a feature that is already there. Have a look under Ambient

Blacky :smiley:

@lmmalouin

Currently there are only 2 modes that I call normal lights and night lights. If you would like more different modes then you could use a script and say if X is on then = ABC lights @ 30% green if XY is ON then = ABC lights @ 60% blue etc. You can make as many as you like…

Blacky :smiley:

1 Like