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

@Herr.Vorragend

I made some changes for crossing over and so it will work using automation link in my other blueprints. I have tested it here again through many options and I cant fault it.

You could try going back to Version 7.3 and see if that resolves it.

Blacky :smiley:

1 Like

@BastiKA84

Thanks for sharing your experience… it is really nice to get these ones. Glad you like it and it helped you :smiling_face_with_three_hearts:

Blacky :smiley:

Continuing the discussion from :bulb: Sensor Light - Motion Sensor - Door Sensor - Sun Elevation - LUX Value - Scenes - Time - Light Control - Device Tracker - Night Lights:

Hello Blacky,

Got an issue and not sure what the problem is. I have a light attached to Tapo P135 which is a plug with dimmer and remote switch. I’m using to automation; 1. Third reality motion sensor set to work from 5pm to 5:25am Blueprint Light Sensor, 2. Timed light on/off Blueprint Turn Light, Switch, Entity or Scene On & Off with Trigger Conditions.

Problem is motion sensor keeps turning on light after 5:25am.

Blueprint Light Sensor, YAML

alias: Motion Sensor - Office Light
description: ""
use_blueprint:
  path: Blackshome/sensor-light.yaml
  input:
    motion_trigger:
      - binary_sensor.third_reality_inc_3rms16bz_motion
    light_switch:
      entity_id: light.office_light
    include_light_control:
      - use_brightness
      - use_transition
    light_brightness: 70
    light_transition_on: 3
    light_transition_off: 5
    include_time: time_enabled
    after_time: "17:00:00"
    before_time: "05:25:00"
    weekday_options:
      - mon
      - tue
      - wed
      - thu
      - fri

Turn Light, Switch, Entity or Scene On & Off with Trigger Conditions - YAML

alias: Office Light
description: ""
use_blueprint:
  path: Blackshome/entities-on-off-trigger-conditions.yaml
  input:
    entity_switch:
      entity_id: switch.office_light
    include_time: time_enabled
    after_time: "05:30:00"
    before_time: "06:15:00"
    weekday_options:
      - mon
      - tue
      - wed
      - thu
      - fri
    include_weekdays: weekday_enabled

Very good Blueprint, so many options :slight_smile: But i wounder how to use conditions in this Blueprint?

I like to use this Blueprint for a “Nightlight”, when someone go up to the toilet, but it should only start the light if other lights are turned off.

@Blacky Not sure if this was suggested before, but i would love to have an extra option to be able to dim a light when no motion is detected anymore before turning off after a set timeout.
So i would expect the following behavior: Motion detected > Turn on light > No motion detected > Dim light to X percentage > Wait X minutes before turning off fully OR turn on again when motion was detected again.
This could make some lights in my hallway a bit more subtle.
I believe i could use this night glow setting, but then my light would be turned on the whole day which is not desirable.
Thanks!

@knotfinleyHA

I noticed you’re using an older, unsupported blueprint of mine: Turn Light, Switch, Entity or Scene On & Off with Trigger Conditions.

If you’d like, consider updating to ensure you’re using the latest version. Also, make sure you’re running the latest version of Home Assistant (HA), as recent updates are required for the new blueprints to work properly. To update, click the blue Import button at the top of the post.

For the second blueprint, :high_brightness: Smart Light now replaces the older blueprint, Turn Light, Switch, Entity or Scene On & Off with Trigger Conditions. It’s a completely new blueprint, so you’ll need to create a new automation. However, it provides the same functionality with many additional options.

That said, the blueprints you’re currently using should still work, as all your settings seem correct. If you’re experiencing issues, it could be due to incorrect time settings in HA.

To verify your HA time:

  1. Go to Developer Tools > Template Tab.
  2. Copy and paste the following code into the template editor:
{{ now() }}
{{ now().astimezone() }}
{{ utcnow().astimezone() }}
{{ now().now() }}
{{ now().today() }}
{{ now().utcnow() }}
{{ utcnow() }}
{{ now().tzinfo }}
{{ now().astimezone().tzinfo }}
{{ utcnow().tzinfo }}

It should display the time configured in HA.

Blacky :smiley:

@Beta-Cam

I’m not sure which light you intend to use. If it’s a light included in the Lights input, it won’t work as expected.

For any other light (if it’s not part of the Lights input), you’ll need to create a template binary sensor and invert it to reflect the light’s behavior. Then, use this binary sensor in the night light entity state option.

Try setting it up, and if you’re having trouble, share your YAML for the automation. I’ll take a look and help you troubleshoot.

Blacky :smiley:

@shocknl

There was a community member who requested this previously. I believe we created a script and used it in the Turn OFF action.

You could try using a scene or script in the Lights input. Avoid using a Scenes & Scripts - Toggle Helper. Then use the Scenes - Scripts To Turn OFF input.

In the script used in Scenes - Scripts To Turn OFF input, you could set the light to 50%, wait for a specified duration, and then turn it OFF.

Blacky :smiley:

Thanks will have a look at that option!

Hello Blacky,
I’ve updated the Blueprints and switch to use new :high_brightness: Smart Light. I used the template, and the date/time is correct for my location. I’ve see how it goes for the next couple days.

One additional question can you mix Time ON/OFF with Sun Elevation. Example,

include_sun:
      - sun_falling  
sun_elevation: -5

include_time:
     - time_off
before_time: "07:00:00"

Mark

1 Like

Hey guys, I noticed that when I set a Night Glow light that is not included in Night Light or Lights, the bypass option that turns off all lights does not turn of the Night Glow light.

I tried to use a scene to force to turn off the light and I’ve added it to to the “Scenes - Scripts To Turn Off” field but the problem now occurs when turning off the bypass entity. The automation does not turn on again the Night Glow light (Night Light entity helper was on when I run this test).

I don’t know if I’m doing something wrong or if that behavior is expected or is a known issue.

As a workaround I’ve added the light to the Night Light entities but the idea is to turn on that light only when Night Glow is on, otherwise should be off.

If you find a better solution, I’d appreciate your help.

I hope this is an easy one …
I would like the automation to run only if someone is at home, otherwise switching lights on don’t make much sense. :wink:
I have a sensor that indicates whether a person is at home (not speaking about the cat :wink: ): binary_sensor.someone_at_home

I would like to use that sensor to decide whether the sensor light automations are active.
as soon as there is no one at home anymore, the already started automations should finish (mainly switching off lights after the configured delay).
and then the automations should “sleep” until someone is at home again. Basically I would like to stop the automation to run triggered by the cat :wink:

I think I should use ‘Bypass Switch - Keep The Lights Current State’ - am I right?

Or do I need to group the binary_sensor.someone_at_home with the motion sensor used in the automation?

Does this include a timer helper for tracking the remaining time and also does the timer resets automatically if there is motion detected?

It seems like a great blueprint with tons of options but I can’t see the option to use a timer helper.

Please let me know.

Thanks!

Hallo Blacky,
Zwischen Sonnenuntergang und -Aufgang soll der Bewegungsmelder das Aussenlicht fĂźr ein paar Minuten einschalten. geht!
Zwischen Sonnenuntergang und 21 Uhr und 7 Uhr und Sonnenaufgang soll Dauerlicht sein. geht leider nicht.
Was mĂźsste ich einstellen? Vielen Dank

Sorry now in English
Hello Blacky,
Between sunset and sunrise the motion detector should switch on the outside light for a few minutes. It works!
Between sunset and 9 p.m. and 7 a.m. and sunrise the light should be continuous. Unfortunately it doesn’t work.
What should I set? Many thanks
Vorhand

@matiasnl23

Welcome to the community.

Thanks for bringing this to our attention. This is a bug, and it should work as expected. I’ll work on a fix… stay tuned for an update!

Blacky :smiley:

@nicknol

You could just use Device Tracker option.

If you want to use your sensor, it must be in the ON state when no one is home. If it’s not, you’ll need to invert it. Then, use it in Bypass Option 2 to ensure your lights turn OFF. In the Bypass - Time Delay, set a delay so that when your sensor triggers the bypass to turn OFF the lights, it waits for the specified time before doing so.

Blacky :smiley:

@amardeepsinghnagpal

No but there is a delay.

Yes

Blacky :smiley:

@Vorhand

All good for me ether way.

The best way to do this is to create a Template Binary Sensor for your continuous condition and then group it with your motion sensor.

In the trigger section of the blueprint, you’ll find a link explaining how to group your motion sensor and the template sensor. Once you’ve grouped them, use only the group as the trigger.

Creating a Template Binary Sensor:

  1. Navigate to Settings > Devices & Services > Helpers.
  2. Click Create helper.
  3. Select Template → Template a binary sensor.

Next:

  • Name the sensor.
  • Choose a Device class (optional).
  • (Optional) Link the sensor to an existing device for better organization.

State Template Code:

Paste the following into the State template field:

{{ (state_attr('sun.sun', 'elevation') < -1.5 and now().hour < 21) 
   or (now().hour >= 7 and state_attr('sun.sun', 'elevation') < -4.0) }}

Note: The -1.5 and -4.0 sun elevation values determine when the sensor is active. Adjust them to fit your needs.

Blacky :smiley:

In German for you.

"FĂźr mich ist beides in Ordnung.

Der beste Weg, dies zu tun, ist das Erstellen eines Template-Binärsensors für deine dauerhafte Bedingung und anschließend das Gruppieren mit deinem Bewegungssensor.

Im Trigger-Abschnitt des Blueprints findest du einen Link, der erklärt, wie du deinen Bewegungssensor und den Template-Sensor gruppierst. Sobald sie gruppiert sind, verwende nur die Gruppe als Trigger.

Erstellen eines Template-Binärsensors:

  1. Navigiere zu Einstellungen > Geräte & Dienste > Helfer.
  2. Klicke auf Helfer erstellen.
  3. Wähle Template → Template-Binärsensor.

Als Nächstes:

  • Benenne den Sensor.
  • Wähle eine Geräteklasse (optional).
  • (Optional) VerknĂźpfe den Sensor mit einem vorhandenen Gerät fĂźr eine bessere Übersicht.

State-Template-Code:

FĂźge den folgenden Code in das State-Template-Feld ein:

{{ (state_attr('sun.sun', 'elevation') < -1.5 and now().hour < 21) 
   or (now().hour >= 7 and state_attr('sun.sun', 'elevation') < -4.0) }}

Hinweis: Die Werte -1.5 und -4.0 fĂźr die Sonnenelevation bestimmen, wann der Sensor aktiv ist. Passe sie nach deinen BedĂźrfnissen an.

Blacky :smiley:

@Blacky
thanks a million for the pointer to Bypass Option 2 - will try it soon :slight_smile: