@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!
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, 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:
- Go to Developer Tools > Template Tab.
- 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
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
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
Thanks will have a look at that option!
Hello Blacky,
Iâve updated the Blueprints and switch to use new 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
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.
I have a sensor that indicates whether a person is at home (not speaking about the cat ): binary_sensor.someone_at_hom
e
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
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
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
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
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:
- Navigate to Settings > Devices & Services > Helpers.
- Click Create helper.
- 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
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:
- Navigiere zu Einstellungen > Geräte & Dienste > Helfer.
- Klicke auf Helfer erstellen.
- 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