Welcome! There are several different issues involved here. The general concept is called âmicrolocationâ or âmicropresence,â that is detecting people in a smaller zone than is normally detected by GPS.
First issues
You run into a couple of issues very quickly. The first is that with the exception of PIR motion sensors, most devices that detect presence use protocols that go through walls. That makes it very difficult to define a âroom.â But if youâre only using PIR motion sensors, youâre fine, because they donât detect through walls.
The next issue is if you want to know who is in the room, that is if it makes a difference if itâs Michael or Susan. Using current technologies, those require that each person carry an identifier device with them, which is usually fine for office buildings but not so much at home. It doesnât sound like you need this for your specific use case.
And the third issue is one that you mentioned, if you want to know the direction the person is going from one zone to another. Thatâs a lot harder than just knowing if there is motion in a particular zone.
cats
As far as cats go, if you are using PIR motion sensors about the only thing you can do with certainty is to move the sensor higher up on the wall and mask the lens so that it detects in a narrower beam. There are community members, particularly @Mike_Maxwell , Who have done exactly that, attaching a tube over the lens of the motion sensor so that they get a more directional detection area. That can work fine, it just takes a little ingenuity to set it up.
There are also motion sensors you can buy that are called âpet immuneâ that are supposed to ignore detection events based on small animals. They work OK and it really just depends on your specific set up. Worth a try, in any case, although they donât have the same certainty as changing the detection zone.
https://www.amazon.com/Ecolink-Z-Wave-Motion-Detector-PIRZWAVE2-ECO/dp/B00FB1TBKS
trip beams indoors
There are indeed trip beams that can be used indoors, and if you move them up high enough on the wall then you donât have to worry about the cats. This is a typical method for people-counting in stores and offices where you want to know if everyone who came in has also left at the end of the day. They donât detect individuals (susan versus Michael), but theyâre a relatively inexpensive way of giving you a directional count.
Unfortunately There arenât any that integrate directly with SmartThings, but you can do a build your own project if itâs really important to you. For the project as youâve described it So far, however, I think itâs probably more effort than it would be worth.
The method is discussed in the following thread:
However, instead of directional detection most people using SmartThings just use inactivity in a zone as information. So you could set up a rule that said if no one has been active downstairs for 15 minutes, then turn off the living room lights.
You have to do some experimenting to get this kind of rule so it works for your own familyâs typical movement patterns, but itâs a pretty easy thing to do, and itâs a much simpler technology than actual directional detection. So you would have one set of rules for activity upstairs, another set of rules for activity downstairs, another set of rules for inactivity upstairs, and the fourth set of rules for inactivity downstairs. The combination of all that typically gives you the same end result as directional detection.
The following thread has a lot of different ideas on how to handle motion sensors in various parts of the house and is worth a read. It can give you a lot of different ideas.
Zone Manager
Mike Maxwell has an excellent smart app which can combine multiple motion sensors into one zone. It doesnât give you directional detection and itâs not a people counter. But it can let you say âonly react to motion if motion was detected on all three of these sensors.â This is a great way for defining a zone even for L-shaped rooms or other irregular spaces.
Mike also has a pretty amazing âuniversal device typeâ which can let you count a contact sensor as a motion sensor or vice a versa. Among other things, if youâre trying to set up a zone it means you could include, say, the bedroom door being opened as one of the âmotion events.â It just gives you some additional cool options.
If you havenât looked into using custom code with SmartThings already, itâs pretty straightforward. Basically you just copy someone elseâs code and paste it into your account. The following FAQ describes the process
Then if after reading that it sounds like something youâd like to try, hereâs Mikeâs zone manager code: