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

great blueprint! Would it be possible to execute a scene after a certain period of no occupancy? e.g. Scene: turn living room lights off.

This instead of the “(OPTIONAL) Turn off wait time”

1 Like

Sorry the issue here is that I did not have the most update version of your blueprint installed. Unfortunately there doesnt seem to be a way to update them once they are installed. I had to delete my blueprint and then install it again from your posted link to have these additional optional inputs.

Your “turn_off_blocker_entity” is exactly what I was wanting you to make, essentially. So works like a charm now. If I see any other bugs or find other parts I’m too stupid to understand, Ill post again.

1 Like

It doesn’t really make sense to have a scene called ‘turn off living room lights’, because that can be done with a light group.

My suggestion for this specific usecase would be to greate a light group (if you have not done this already) and use that light group as the ‘target_off_entity’ input.

That way you can use a scene for turning on your lights, but a group for turning them off.

No changes to the blueprint are needed for that :slight_smile:

And another day went by where I learned something! thanks! will try that.

1 Like

I imported your blueprint today but I don’t see the option for setting the brightness.
This is the first blueprint I’ve used so I may be missing something.

You cannot set brightness with this blueprint directly.
If you want to turn on a light with a certain brightness, you have to define a scene for that, and use the scene as the target entity to turn on.

Newbie here. This works very nice, but I would like to have the light stay on for 2 min when no motion is detected. I tried to input 120 in the “(OPTIONAL) Turn off wait time” section. However this is probably wrong because the light goes off after 30 sec. Anyone with a helping hand :slight_smile:

I have read your documentation and created a helper with input number. Can somebody explain why the automation adds 30 sec to each number of minutes I add? If I add 2 min of no motion the automation turns off the light after 2 min 30 sec. This is of course not really a problem for me, but as I’m a beginner and trying to understand I think it’s important to get some confirmation that I’m doing something right and then something like extra 30 seconds puzzles me :thinking:

1 Like

Taking a wild guess here: does your motion sensor turn from “on” to “off” after ~ 30 seconds? That would result in the perceived difference.

1 Like

Of course, you’re right. Thanks for the clarification!!

Hello,

First thanks a lot for this automation !

I would like to submit a small issue with my setup:
When light turns off after input time, illuminance sensor takes a few seconds before detecting the decreased lux.
During those few seconds, if motion sensor gets activated, then automation is blocked because lux is still above the limit. Thus, no light, have to wait a minute until motion sensor gets clear again before retrigger can happen.

–> Would it be possible to force update the illuminance value before checking it against the limit to avoid this issue ?
Thanks again !

I don’t think so… you would have to be able to send a command to the motion sensor to update the illuminance, which would also be different for each motion sensor.

I would also expect that illumimance values are updated at the same moment when motion is detected, but that could also differ per motion sensor of course.

What about calling service homeassistant.update_entity ? Wouldn’t be enough ?

Since I’m there, I just found another issue: light turns on after host reboot (not sure about ha restart), I suppose because illuminance value is not yet loaded. And it doesn’t turn off until manual intervention. Any idea how to prevent that ? Maybe block automation until all entities are available ?

I don’t think that service is able to make the physical motion sensor update. It’s more for like updating a template value which normally would only update once a minute to update immediately.

The automation will only trigger if the state of the motion sensor goes from ‘off’ to ‘on’. If your light turned on, then the state of the motion sensor at that moment would have been ‘on’. I don’t know why that was the case with your motion sensor of course… but that is not something that this blueprint can fix.

Ok thank you, if update_entity doesn’t help, maybe I’ll try to fork the blueprint locally to add a mqtt.dump before illuminance check, hoping that will do force the lux update !
I use zigbee2mqtt with ConbeeII and with xiaomi motion RTCGQ01LM and xiaomi luminosity GZCGQ01LM

Another usecase I’d like your opinion on: let’s say I have the timer set to 3min:

8:00pm: motion detected, light gets on
8:01pm: no motion, so according to timer, light supposed to stay on until 8:04pm
8:02pm: motion detected again (before timer ends so light is still on)
8:03pm: no motion again

Well, timer is not reset at 8:03pm, so light turns off at 8:04pm as planned by first run, instead of 8:06pm as I would have expected

What do you think ?

I would love this as well - ability to choose a group of motion sensors - I have a group created combining two seperate sensors for Kitchen-end and Dining-end of the room. I’d like the blueprint to be able to work if either motions sensor triggers.

Love your work freakshock!

For multiple motion sensors, you can always create a group of motion sensors. I actually did that, and it’s working perfectly. I’ve modified the blueprint to remove the selector restriction on that.

1 Like

how do i edit it to remove that restriction. at the moment it wont let me see the group of detectors in the drop down

Basically, you can edit the blueprint using the filemanager add-on. I’m not in front of a computer right now, but I can send you the code tomorrow.

thanks, am confortable editing all the files, have it all running on docker , but just dont know the yaml for blueprints/automations at all yet