Just tried to make a flow. Won't work

Hi folks, I just tried to make a super basic flow and it won’t work. Not sure what hope I have of making a complicated one when something so basic won’t even work.

The flow is simple. I have an Aqara P1 motion sensor and a Sonoff Zigbee plug.

My flow just says “if the P1 sensor detects a lux under 15 lux and the movement alarm is triggered, then turn the lamp on.” Simple.

Except, the P1 is reporting 0 lux and the motion alarm is triggered and nothing happens. It seems to work if I don’t specify the lux, but even then the light just seems to stay on indefinitely. I just want it on for, say, 30 seconds unless further movement is detected.

There isn’t any obvious way to do that really basic thing though and I want it to account for the lux level so the light doesn’t activate during the day.

What am I doing wrong?

When the lux goes below 15 lux while there is no movement, the flow wil never trigger any more.
So change the lux and movement:
WHEN movement is detected
AND lux is less 15
THEN turn on the light

To switch off the light you make another flow:
WHEN no movement is detected
THEN switch off the light with a delay of 1 minute

There are plenty examples of more sophisticated flows, with counters or zone activity, that prevend the light to switch off when motion is detected again during the one minute delay time.

1 Like

I already thought about that, but it forces me to pick the lux first. If I start with “if there is motion” then there is no lux setting to be selected, for some reason…

For the check of the brightness (lux) in the And… section, you have to use a logic flow card:

3 Likes

Thanks, that worked.

How do I get that same light to turn off after, say, 30 seconds if no further movement is detected?

You can use this tutorial as base. You just need to add the brightness logic flow card:

Or you can use Zone Activity as already mentioned by @Rmb.
For more info about Zone Activity please check these support articles:

1 Like

Thanks. Got that working also - your help has been amazing.

One last request, if I may?

How can I also have this flow not fire between certain hours? When I put my young daughter to bed, I want to be able to sneak out of her room without the lamp on the landing triggering, so want to suppress the flow between, say, 8pm and 6am.

*Edit: don’t worry - just noticed the time/date part. Missed that earlier. All sorted.

1 Like

Here’s an example with zone activity.
Saves a lot of time and tweaking.

1 Like