Advanced Flow help: Dim lights per zone using FP2 sensors"

Hey everyone! :waving_hand:

I could really use your help! :folded_hands: I’m trying to automate my lights using two Aqara FP2 presence sensors for my main floor, which is divided into a living room, kitchen, and dining room. :couch_and_lamp::fork_and_knife_with_plate::cooking:

The FP2 sensors also recognize the stairs going up and down as separate zones, which opens up some fun automation possibilities. :cyclone:

Here’s what I want to achieve:

All lights on the floor should be dimmed to a base level (e.g. 30%) when someone is present.

The zone where presence is detected should be set to a higher dim level (e.g. 80%) for better lighting.

So far, I’ve used the following logic:

A variable “Someone on the floor?” (Yes/No)

A variable “Is it dark?” (Yes/No)

A variable “Sensors active?” (Yes/No)

However… the result is a bit of a disco show :tada::sweat_smile: — lights flicker constantly and it’s not behaving as expected.

Has anyone done something similar or can guide me on how to build this properly with Homey Flows or Advanced Flow?

Thanks in advance! :light_bulb::sparkles:

1 Like

I assume you mean when no one is present. Otherwise Homey tries to set the dim level to both 30% and 80% at the same time :grinning:.

But, perhaps you could post a screenshot of your flow, so that we can follow along.

Well thats the challenge😁 when someone is present on the floor then all the zones where no one is present needs to be 30%




Im sorry for the big mess… im on my tablet and you really cant organize it unless youre on the laptop

1 Like

Before starting to unravel your spaghetti :blush: :sweat_smile: some observations.

It seems that you use the same trigger (WHEN card) for multiple flows. Like ‘Zone Occupancy Zone 0’ werd bezet’. That’s fine, however you are also updating and checking variables used in both flows. E.g. the ‘Presence eerste verdieping’ variable is set to Yes in the first flow in the first screenshot. You check the state of that same variable in the flow in the bottom part of your first screenshot. You can run into the situation that the first flow has not yet finished updating the variable, while you have already checked it in your second flow and hence may get an incorrect value. You can solve this by first determining what would be the correct order of execution and adding a delay (e.g. a 1 sec delay flow card) in the subsequent flow (after the WHEN card).

I have no experience with this presence sensor, but what is the difference between ‘Zone Occupancy Zone # werd bezet’ and ‘Zone Bezettingszone # werd bezet’? Sounds like it is the same.

Im going to unravvle the spaghetti tonight after work🤣..

But the difference between the 2 numbers are 0 = the total zone and each number is a zone in the 0 zone… So for example zone 1 is the kitchen zone 2 is the dining area and zone 3 and 4 are the stairs going up and down.

This is the first time that i try this with 2 sensors for the entire floor, but the main difference with a normal motion sensor is that the occupied/not-occupied is instant and has nog delay when turning off.

Haha, okay. Enjoy your spaghetti :rofl: !

So the:

  • ‘Zone Occupancy Zone #’ items relate to the first sensor, and the
  • ‘Zone Bezettingszone #’ items to the second sensor?

Thanks! This is what happens when you wanna do something real quick🤣

No the can be the same sensor but when you create a zone in the sensor like in the picture every color is a different zone and gray is the border. Zone 0 is the total view of the sensor, and ever number higher than that is zone 1, 2 etc.

:grinning_face:

I understand that zone 0 is the umbrella/overarching zone and 1,2, 3, etc. sub-zones.

I was referring to two different zone names (with the same number), that sounds to me like they may be the same: Is ‘Occupancy Zone 0’ the same zone as ‘Bezettingszone 0’? So one has an English name and the other a Dutch name. Or do they refer to different overarching zones of different sensors?

Ah now i understand! No those are 2 different sensors. One is de one i shared the picture (it sees kitchen etc) the otherone sees only my living area

So what i wanted to do with the logic in the upper part of the first screenshot is. When one of the 2 sees someone then the presence for the entire floor is set to yes

Thanks for clarifying :+1:.

So my main recommendation for now, as indicated above, is to allow time for Homey to update variables shared across multiple flows, by adding a 1 sec delay in subsequent flows that are triggered by the same trigger. May that already solves (part) of the current behavior.

Thanks i will try it and clear up the spaghetti and show it again

1 Like