Normally this is done in your sensor (reduce the false positives). The blueprint keeps being triggered so it may cause problems.
You could create a simple automation that turns ON a toggle helper if your theory is correct. You can then use this helper in Bypass Option 2 to turn the light OFF. Set Bypass Auto OFF to 1 second (0.016) so the toggle helper automatically turns OFF, allowing the blueprint automation to become active again and wait for the next trigger.
This looks a bit tricky and you will need to test it because your MR16 hue lights are OFF so HA can see them until they are ON. The order of the blueprint is lights first then switches (not switches then lights) and this is milliseconds apart but that may matter.
I am assuming you would like and have the Shelly mini to keep power OFF to your MR16 hue lights.
Option to try in this order are;
Add your MR16 hue lights into Lights with your Shelly mini and in Light Control enable brightness and set it to 20%.
If that works if not then:
Create a scene with your lights at 20% and your Shelly mini ON. Use the scene in Lights - Switches - Scenes - Scripts You then need to add a toggle helper into Scenes & Scripts - Toggle Helper and then create another scene with all your lights OFF and your Shelly mini OFF then add that scene into Scenes - Scripts To Turn OFF
If that works if not then:
Turn your Shelly mini ON and leave it ON⌠Then just control you MR16 hue lights in the blueprint adding them to Lights and in Light Control enable brightness and set it to 20%
Currently no, if you set the time to 10pm it will turn the lights OFF because that is what we are asking it to do.
BUT!
This is going to get a but advance in templates. We need to create code using the entity ID of the template we just created in the code, so once you save the template then you have to get the entity ID and edit the template again. This will do what your asking but it is all at the trigger level.
Go to Settings > Devices & Services > Helpers.
Click â+ Create Helperâ and choose Template > Binary sensor.
Set a Name for your new binary sensor. This will create the entity ID we will use later in the code below once you saved the template.
In the State template field, paste the code below.
Replace:
binary_sensor.your_presence_sensor_here with the actual entity ID of your presence sensor.
I have set the start and end times to 9am to 10pm but if you need to change them then this is where you will do it⌠not in the blueprint time section. Disable the time section in the blueprint now.
The tricky part. Save the template sensor and then replace binary_sensor.this_binary_sensor_ID with this binary sensor ID.
Set the Device class if you want this binary sensor to behave like a motion sensor, opening sensor, etc.
Optionally, select a Device to link this sensor to. Leave it blank if not needed.
{% set motion = is_state('binary_sensor.your_presence_sensor_here', 'on') %}
{% set start = now().replace(hour=9, minute=0, second=0) %}
{% set end = now().replace(hour=22, minute=0, second=0) %}
{% set allowed = start <= now() <= end %}
{% set prev = states('binary_sensor.this_binary_sensor_ID') %}
{{ (motion and allowed) or (prev == 'on' and motion) }}
Once you created this template binary sensor you then use it as the trigger ONLY (not your presence sensor).
Hey guys, I am wondering if I do not get it or if it works as intended. I have the sensor light blueprint set up with bypass option 3. My bypass switches are âinput_boolean.woz_manual_controlâ for temporary blocking the automation in case my wife uses the light switch, âinbut_boolean.woz_bewegung_blockerâ for permanent blocking the automation in case of guests in the room for overnight stay or a nap , and another one for cleaning mode. When I switch of the manual mode input boolean with my switch (switch off the lights deactivates also the manual mode), then the lights switch on. Is this intentionally? Yes, I am in the room while doing this and the occupancy sensor is still detecting me. I was hoping the automation gets triggered only when the trigger is changing from clear to detected (or off to on).
@Blacky - I have about 100 motion sensors throughout my home for lighting control (and other purposes). I would prefer not creating 100 binary sensors (one for each motion sensor). Any chance your blueprint could be altered to handle my wired motion sensors. I did confirm that their two states are either âviolatedâ or ânormalâ.
Anyone having an issue with the Light sensor template not working anymore?
My issue is that the light wonât turn on/off when the human sensor changes. It was working fine before. Iâve checked the devices and all are working fine.
This blueprint is awesome, thank you so much for your work! @Blacky
I have been using it for quite a while now to turn on the lights with a motion sensor depending on the sun option.
Recently I wanted to add the night light function and turn on the same lights but with a lower brightness during the night (using time option).
Actually itâs working as intended but the lights now turn on without the motion sensor triggering exactly at the start and end time I set for the night light option.
I have not observed this behavior in another room where I use a different light entity as night light.
Is there anything Iâm missing?
Also from my side thanks for this awesome blueprint! One issue Iâm running into which I cannot solve. I only want to have the lights switched on during night time when motion is detected.
Iâve set the Night LIghts configuration as per screenshot below.
But the automation is never triggered! Only with a light has been added to the âLightsâ config then the automation is triggered. What am I doing wrong in the config and/or how to solve this?
My goal is to only have the lights on when my helper âNightTimeâ is true and motion is detected. Thamnks.
I have an issue that seems to have appeared only with the 8.5 release - wondering if anyone else has experienced this and if itâs a bug. I have enabled the âdim before offâ option and what Iâm seeing if that when the lights are on, and motion is detected, the automation is changing the brightness to 100% - event though that is not the current brightness. I think what is happening is this:
Motion detected - lights are turned at defined brightness e.g. 80%
Within the lights-off timeout period (e.g. 10 minutes), motion is detected again.
Since âdim before offâ is enabled, the automation tries to calculate the correct brightness to set - is seems to assume we are in the dimmed phase, to it tries to restore the brightness level.
In my case I have the âdim before offâ percentage set to 50%, so it tries to restore the brightness level by calculating 80% / 0.5, which is above 100%, so it rounds to 100%.
I think the logic should check that when âdim before offâ is enabled, that we are actually in dimmed phase before trying to restore the brightness level.
If I run this manually, it bypasses sun sensor and times? In fact I think I am losing my mind. All I want to do is user a helper to show I am away from the house and turn on a light and then after so long being home turn it off. How can I best accomplish this? Iâm struggling with my tests.
If you run any automation manually (the run command in the automation UI using ârunâ) then none of the triggers are used because you are triggering it manually.
Is that what you mean?
Yes. I am looking for a way to test this. I am thinking I need to link it to the [high_brightness Smart Light - Entity - Sun Elevation - Ambient & Time Triggers]
I have this configured to turn on the lights in a room at 100% during the day, and in the late hours of the morning it will only turn on at 10% (night light) with a 1% night glow.
After the sun goes down and before the night lights are active, I would like to turn the lights on at 75% with a similar effect as the night glow (1% or slightly more).
Since the dynamic lighting does not work with night lights, am I correct in understanding this is not possible?
Hello! Thanks for this awesome blueprint!
I have a problem with my Nanoleaf bulbs.
I canât get the transition effect to work properly.
Iâve set 2 seconds in the device settings, and it works greatly manually, but with the automation it just flashes on/off, no matter whether I use transition option of the blueprint.
Love the Blueprint. Iâm using it in a bunch of rooms and it feels like magic.
Two questions. First, I recently cleaned out some Helpers that I thought werenât being used and I didnât recognize, but I am now seeing a red error message âUnknown Entity Detectedâ message in the âScenes & Scripts - Toggle Helper,â even though I am not using a Scene or Script here. Iâve tried reimporting the Blueprint, but am not sure if I messed something up and need to recreate a default helper (or if it can be reinstalled somehow), or if everyone is seeing this error message and it can be ignored.
Second, @Blacky I saw a story recently about the different Modes in automations, and in my case, would prefer Restart vs. Single mode for my light automations, that way detecting motion would restart the clock rather than adding it to an ongoing timer. Is that how your Blueprint works, or is that a config setting Iâm missing, or is that not an option for Blueprints like this? Just curious as I have noticed some lights seem to go off faster than my timer but only after I leave and re-enter the room a few times.