# Keeping track of how many people are on what floor

**URL:** <https://community.homey.app/t/keeping-track-of-how-many-people-are-on-what-floor/80484>\
**Category:** Questions & Help\
**Created:** [May 13, 2023, 11:32pm UTC](https://community.homey.app/t/keeping-track-of-how-many-people-are-on-what-floor/80484 "2023-05-13T23:32:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rik\_Elsenaar](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rik_elsenaar/32/72066_2.png) [@Rik\_Elsenaar](https://community.homey.app/u/Rik_Elsenaar)\
**Post date:** [May 13, 2023, 11:32pm UTC](https://community.homey.app/t/keeping-track-of-how-many-people-are-on-what-floor/80484/1 "2023-05-13T23:32:56Z")

</div>

Hey Homeys!

I learning and trying new things everyday, I am trying to make a Logic of keeping track of how many people are on what floor so I can use this as a base for new and future flows like:

- If no one is on that floor all the light go off
- if someone is going to the floor of the tv, the tv goes on
- etc

But im not figuring out how to make it work, I think this is simple bur I can’t find the way.  
I want to do this by using 2 motion sensors on each stairs so:  
IF: motionsensor A (downstairs) is activated  
AND: motionsensor B (upstairs) is activated  
THEN: Logic People on floor 1 is added by 1

And then afcourse in the opposite direction the same.

Do you guys know how I need to do this?

With kind regards:

Rik

---

<div class="post-metadata">

**Author:** ![DirkG](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkg/32/118897_2.png) [@DirkG](https://community.homey.app/u/DirkG)\
**Post date:** [May 28, 2023, 9:13am UTC](https://community.homey.app/t/keeping-track-of-how-many-people-are-on-what-floor/80484/2 "2023-05-28T09:13:52Z")

</div>

Hi Rik,

In general, I think that such presence monitoring is not easy to implement. Especially not with 2 motion sensors. The source of error will be relatively high, e.g. if 2 people go up directly one after the other (is detected as 1 person), and later only 1 person goes down again.  
To make these procedures more secure, the other rooms would also have to be monitored for movement. In my opinion, it would be even better if real presence sensors were used, however, there is currently no support for presence sensors, with the exception of the [Homematic IP HmIP-SPI](https://de.elv.com/homematic-ip-praesenzmelder-hmip-spi-innen-150587) sensor (sorry, only in German language). However, this requires an additional gateway. I cannot say anything about the quality.

However, maybe the new Aqara FP2 presence sensor will be supported soon:

> [@Aqara FP2, mmWave presence detection on WiFi](https://community.homey.app/t/aqara-fp2-mmwave-presence-detection-on-wifi/76955):
>
> I just saw that there’s a new FP2 presence sensor coming out now in March, and contrary to the other Aqara sensors it doesn’t use Zigbee but rather Wifi. Probably makes it trickier for someone to make an integration into Homey for it, but…

Regardless of the above problems, a possible way could be as follows:

**Stair up**

_ **When…** _  
– Motion sensor B (upstairs!) is activated  
_ **And…** _  
– Motion-Alarm of MS A (downstairs!) is (still) on  
_ **Then…** _  
– Logic card - Calculate “Variable” as {{Variable +1}}

* * *

**Stair down**

_ **When…** _  
– Motion sensor A (downstairs!) is activated  
_ **And…** _  
– Motion-Alarm of MS B (upstairs!) is (still) on  
_ **Then…** _  
– Logic card - Calculate “Variable” as {{Variable -1}}

So I would do the order the other way around.  
However, if this works depends, among other things, on the used motion sensors and their settings (if possible, keyword “Blind time” and “Cancellation delay”).

---

<div class="post-metadata">

**Author:** ![Menno\_van\_Hout](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/menno_van_hout/32/77843_2.png) [@Menno\_van\_Hout](https://community.homey.app/u/Menno_van_Hout)\
**Post date:** [November 15, 2023, 6:45pm UTC](https://community.homey.app/t/keeping-track-of-how-many-people-are-on-what-floor/80484/3 "2023-11-15T18:45:39Z")

</div>

I actually wanted this aswell and developed an app based on ESPresense:  
[https://hdashboards.app/blog/tutorials/homey-room-presence-espresence-homey-app-integration](https://hdashboards.app/blog/tutorials/homey-room-presence-espresence-homey-app-integration)

I am waiting approval from Homey but after that you can do it!
