Turn on light, switch, scene, script or group based on motion, illuminance, sun (+ more conditions)

Hi @freakshock
Thanks for your quick response. So I created an input_boolean helper and set as blocker entity in your automation. Then I created a seperate automation like below, but nothing happens. Could you give me a hint, which part is wrong? Thank you again.

Stupid question maybe, but with this blueprint, is it also possible to add the color and brightness to the light i want to turn on?

1 Like

I would check your trigger.
See for instance these docs: Automation Trigger - Home Assistant

Yes that’s possible, by defining a scene for the color and brightness you want, and have the scene be the turn-on entity in the blueprint.

Sorry to bring this up, but is there any way to execute a script using the “turn off entity” property?
Thank you :slight_smile:

Thanks for the hint with the trigger check. Now it behaves as expected and I like your blueprint better and better :slight_smile:
Now I have a question about a scene as turn on entity:
I set a scene (just one light with color in blue and brightness 20%) as target turn on entity, but then tthe light won’t turn off after last motion and turn off wait time. When I switch target turn on entity back to light entity, light goes off as expected.

Mea culpa. You have to put in a turn-off entity, if a scene or script was used as target entity. It works now as expected.

Having a few issues with this. I think I’ve set everything up as per the instructions. The automation is triggered and activates a scene. But it never turns off; after no motion is detected for more than the helper for turn off wait time (set to 10 minutes) or off the illuminance drops below 50lx.

Thanks

@hutchtg Did you ever solve this, I am having exactly the same issue.

If you use a scene as a turn-on entity, you also have to define a turn-off entity. Since turning off a scene is not possible. You could set the turn of entity to a light or a light group.

@mike2ns and @hutchtg are you using philips hue motion sensors? I think there might be problem due to they are based on occupancy and you have to define that lights should turn off after time sensor detects no occupancy, not on/off motion.

I’m not sure how the state of the philips hue motion sensor looks, but if it is an entity which has state ‘on’ when motion is detected, and ‘off’ when it is not anymore detected, it should be compatible with this blueprint.

I am having an issue. I am new to blueprints and scripts in general. I have a zooz zse11. I have the blue print setup and picked the home security motion sensor on the zse11 in drop down. Have to right entity. So my situation is this.
When motion is detected, the smart plug (controlling a lamp) turns on perfect. I have the setting (optional turn off wait time (minutes) set to 10 minutes. I have tried any time from 1 minute and up.

The light DOES turn on. But turns off after what seems like a minute no matter what I set the time too.

How do I get it to turn on the light… and if no motion for X minutes and NOT retriggered, then turn off light?

Thanks for a great blueprint.

I am having a problem with the “Turn off wait time (minutes)” option. I cannot get a delay after the motion sensor clears. I have tried integers between 1 and 10 but the target entity (not a script or scene) turns off as soon as the motion sensor clears.

Below is a trace of the wait step after execution, As you can see, “Delay:” is given as 0. So it seems the integer I entered for turn off wait time does not seem to make into the script during execution.

Executed: January 27, 2022, 4:00:49 PM
Result:
delay: 0 done: true

An ideas regarding what I need to do to get a turn ff wait time delay?

Regards

Looks like I have the same problem as you. Just saw your post.

Here is what you do … it was in the instructions. A little convoluted but it works. Basically create a helper and set the desired minutes to wait there. Then instead of directly entering the number of minutes in the blueprint like you have done in your screenshot, just press the drop down arrow to the right and select the helper you created for the minutes. Below are the actual instructions.

"If you want to create the optional entities in the UI instead of in YAML, you van do so in the following way:

To to Configuration
Go to Helpers
Click the ‘Add helper’ button
Select the entity type (in this case, number, toggle or date/time)
Enter required fields
Click on create

Setting the values for the helper entities

To set a value for your newly created helper, find it in the helper list as described in the section above, press the settings icon on the top right of the screen and set the value there. "

Is somebody using this blueprint together with a Hue Motion Sensor AND with an illuminance cutoff?

Maybe the problem even exist for other motion sensors, but it can happen that when the motion is detected (change state from ‘clear’ to ‘detected’), the illuminance value is still “old” (e.g. it is high because the light was on a few seconds ago). Then, one second later the illuminance gets updated but the automation is not triggered again, because it only reacts on the motion state change but not on illuminance change. In my opinion it is needed to also listen to an illuminance change AND if then the motion is in state ‘detected’, it should be treated as if motion was detected.

I already explained it a few years ago in that thread: Hue Motion sensor with illuminance condition

I am trying to use this blueprint and light triggering with PIR works fine, but I am not sure if I understand the Illuminance cutoff value right.

I defined an input_number in my configuration which gives a value between min and max but it always defaults to min when checking in the entitiy browser.

My current illuminance is around 250lx and even when I set the min to above 300, the light still triggers. Anyone can help me understand Illuminance cutoff value?

The Illuminance cutoff value is used to determine if it is dark enough for the light to need to be turned on. So if you set this at 250lx, when the motion sensor is triggered and the actual illuminance value is below that, the light will turn on. If it is above 250lx, the light will not turn on.

Yes I use it with the Hue Sensor and an illuminance cut off of 20 lux.

I find that when my chosen light goes off, i can’t get it to come back on straight away. I’ve gone as far as walking right up to the sensor and stll nothing. If I look at the Hue reported lux in HASS it does indeed seem to be still reporting the value that it was when the light was on, usually 40 lux in my house. Only when that drops back to the actual room lux value will the light turn back on, this can be over a minute.

I’ve been tearing my hair out with this for weeks.

I presume the automation logs would “show me” frantically waving my hands around to get the light to come back on with the logic then looking at illuminance and passing on running.