Occupancy Sensing - not just Motion!

Hello, ST Community!

I am having some hurdles with using a motion sensor to help automate my lighting. The issue in the below-linked Topic is pretty much dead-on to mine: my Samsung SmartThings Motion Sensor does not register motion when I am sitting at my desk. However, that topic went into using pressure sensors on floor mats and heat sensors in ovens…not what I want to do.

TL;DR - Does anyone know of a SmartThings-compatible occupancy sensor that does a good job at detecting a human even if they are perfectly still? Am I imagining that such a thing exists?

Newer (non-connected) commercial and residential lighting systems used both PIR and ultrasonic (“dual-technology”), which I thought did a great job of occupancy detection, but I am not finding a better solution.

What I am ultimately trying to do in my office is to have the lights come on when I enter the doorway, stay on while I am in the room, and then go off within 30 seconds or less of me leaving the room. I mounted the sensor right above the light switch when you walk into the right. It positioned very close to where I sit, so my theory is that it must not be picking up the subtle motions of me typing, clicking or just staring at the screen.

There is no short answer – it is an incredibly complex problem with some solutions but they all have a “catch”.

I won’t even point out that most are not officially SmartThings compatible, but that’s really the easiest hurdle.

  • Beacons (Bluetooth based): Great for rough proximity detection, but not 100% accurate since signal can pass through walls. Occupant must wear either a receiver or transmitter. The SmartThings presence sensor is a bit like a low-resolution beacon based on ZigBee instead of Bluetooth. It’s range is too wide and not tunable for room-specific location.

  • Barrier observation: i.e., count people entering and exiting the room via a beam-break or pressure pad at the doorway. Fails if two people or more people trigger the sensor concurrently.

  • Pressure pads: If the occupant is likely to always be sitting or standing on one.

  • And many other great ideas out there… The most accurate practical scenarios try to combine data from various different types of sensing: e.g., a pressure pad on the desk chair confirms the room is occupied even if the motion sensor is not detecting motion and vice versa. So use both.

1 Like

Try getting a multipurpose sensor and attach it to your chair. Might work better for you.

3 Likes

Crazy thought that might get you at least somewhere. I wonder what would happen if you used an in-wall z-wave on/off (monoprice or aeotec) in conjunction with one of the dual-technology PIR/Ultrasonic sensor switches. You wouldn’t have control of the actual motion sensor in ST, but potentially still have some ST interoperability… mostly depending on how the non-smart switch reacts to the on/off controller.

@tgauchat gave an excellent overview of the issues. This is typically called “micro location” and many people are working on it, with no clear winner yet. Eventually, there will be home automation that can count heartbeats, but we’re not there yet.

Meanwhile, for how this plays out within a SmartThings-compatible installation, start with the following project thread. (This is a clickable link.) It discusses most of the current options.

1 Like

The chair(ST MULTI) sensors work great on pneumatic office chairs. They can be set up as a switch that detects that I am present even when I relatively motionless. That was my solution to the lights going out in my office because I was engrossed in something and remaining very still. This method also works with couch cushions and mattresses as well. Anywhere you can have movement in the y-axis.

As others have stated, nothing at this point has the fine resolution required to get 100% accuracy. One method that I played around with was this:

Occupancy Logic State Machine

How many people are home ?

For this example let us say there are 4 people marked as being present.

Motion detector in every room

If we could keep a running tally of motion detection events for each room, we could make some guesses as to which rooms were occupied and by how many people.

-----------------------------------------------------------
|                             |                            |
|                             |                            |
|       Room A                     Room B     
|                             |                            |
|                             |                            |
-----------------------------------------------------------

If motion is detected in Room A and then within one minute, it was detected again in Room B we could set a timer for 15 minutes. If no motion was detected in Room A after the 15 minutes, we mark the room as unoccupied.

I tried this at my house and it worked about 85% of the time. The results were not great enough to move me away from simply turning lights off after a given period of time using the built in Lighting Wizard.

  • Still Editing This
2 Likes

Thanks for the guidance, all. I am going to explore methods using the ST Multi-Sensor and see what I can come up with. Sounds like pressure on the chair might be my best bet for detecting motionless office occupancy. I’ll circle back and report my progress (or lack there of).

3 Likes

Just came here to comment on this. In my master bedroom and bath, I have the latest ST zigbee motion sensors, (love the low latch times.) I use several Rule Machine Rules to determine estimated presence at each location. Honestly, it’s super crude right now, because getting complicated with RM is a nightmare, but it works well enough for a single guy.

I’ve tested it with ‘company’ and it gets annoying real quick. I could potentially add in a third motion sensor between zones, and add some logic that determines a zone has been breached, and to react accordingly. It’s very doable to use motion sensors for occupancy, but it totally depends on the room you’re working with.

In my case, it’s 100% doable, but I think I still have to write my own smartapp. In the mean time, I am using RM, and I also use several magnet-mounted minimotes to trigger lights, AS WELL as automatic lights. There are times where I know I want to leave the lights dim, off, or bright. In my theater area, for example, my Harmony hub turns on/off automatic lights when I power on the projector. Works fairly well.

I do want to perfect the occupancy logic for my master bedroom though. I really think it can be done, but only reliably with a few more motion sensors, and some custom code.

We need infrared heat sensors that have options based on size of heat source. This way, cats/dogs do not false trigger…unless we have a filter for an action only based on detected heat source size. For example, an automated doggy door or something.

I would love a way to have lights dim on and off depending on room occupancy, unless overridden by voice/app/wall switch override. Also this would connect awesome to automated A/C or Heat vents, directing air where needed only.

Anyone know of any products that will do this?

3 Likes

Yes, these exist. They are typically called “pet immune” Motion sensors. There’s at least one on the official compatibility list, if I recall correctly it’s from eco-link.

https://www.smartthings.com/compatible-products

(I was right: Ecolink. But there are also other brands make these. They just have an adjustable sensitivity. )

1 Like

Thx. Can this device be controlled to, if it sees stationary heat, ON, and if no heat present, OFF? Motion doesnt really matter if someone is sitting still for longer than the timeout period.

Coming in late on this, but just wanted to mention that this is a frequently discussed topic in the forums, there are at least four threads on it. Bedrooms are always tricky because of the amount of time that people spend lying still watching TV or reading which can then register as inactivity on a motion sensor. Or the inverse, where someone moving in their sleep registers as activity.

Different people solve it differently depending on their exact circumstances. You can use custom code if you like, but it often isn’t needed. People have had solutions for this issue since before rule machine ever existed. But most of the solutions involve carefully analyzing which devices you need where… :sunglasses:

Here’s one recent thread to get you started – – it includes links to several of the other threads as well, so it should give you a lot of ideas.

No, that’s not quite how the “motion sensor” technology works. They measure tiny changes in heat as it passes across the sensor. They do report “inactivity” which can be used to trigger off, but of course that gets fooled by the person sitting still.

An alternative, which is discussed in the bedroom project thread I already linked to is to use either a pressure Mat (which, for example, can be placed under the sofa cushion) Which then does detect whether someone is sitting in the chair or not. Some people put these under a mattress, or even under a dog crate.

Another alternative for some use cases which Jody already mentioned upthread is an acceleration sensor on a chair like an office chair, which will catch very small changes in motion.

So again, it comes down to analyzing exactly what the use case is and then determining what combination of devices can best solve it.

At my own house, I often use intentional touchless switches, usually a motion sensor in a box to limit its range. So I catch people walking in with one sensor, but when I want to Turn off the lights I use a different sensor with an intentional hand wave as I get up from the chair or the bed. For example, I have one sensor on the side of the nightstand facing towards the bed. Easy to trigger just by hand position as I get in or out of bed, but doesn’t get accidentally triggered by the dog. :sunglasses:

Again, many different ways to solve the same problems. Just depends on your exact set up as far as what will work best.

And of course now days at our house we use voice as our primary means of light control using the Amazon echo. Works great. But I do still use the touchless switches particularly for late-night use cases where voice might wake up someone else.

Also, the following thread discusses some of the more sophisticated (and more expensive) people counting options, like trip beams at room entrances. (Terry mentioned these at the very beginning of this thread, but I wanted to give the link to the detailed discussion as well) . These are more complex to set up as well as more expensive, so most people aren’t interested in them, but some are. Choice is good. :heart_eyes:

1 Like

I ended up getting the logic pretty well set up in my bedroom. I’m using various virtual switches controlled by motion sensors and other logic. They all come together with my various minimotes to do exactly what I want. Alexa can control the important logical switches.

Something along the lines of…

  • Auto lights on, motion detected, turn lights on to certain color.
  • Walk out of bathroom enter bedroom. Logic waits for 5 minutes to make sure no new motion is detected in bathroom. At that point, a virtual switch sets bathroom presence to empty.
  • Stop moving in bathroom, (shower, bath, toilet, closet, etc,) but never trigger bedroom motion? In that case, the bathroom presence switch still says you’re in there. Timer is set to 30 minutes. Logically, if you’re still in there, you’ll re-trigger the lights by motion or various doors.
  • The same logic applies in any of my rooms that you can walk through one to the other.
  • All the rooms have minimotes to trigger auto lights on/off. To override any automation logic. What would be even better is if I had in-wall switches that you could merely double-tap in either direction.
  • I use a combination of audio alerts, light color changes, blinking, dimming, and various other indicators that you have successfully triggered a certain mode via remote.
  • All of this is done in Rule Machine, but could easily be accomplished with custom code.

I think a good place to start is by having the logical presence switch for each room. That can then be triggered by many inputs. Door, motion, temperature, vibration on desk, etc.

Perhaps someday we’ll get an actual presence sensor to add to the mix, but I’m not sure how reliable those are in general. Even at work, it seems that the lights still turn off on us. Basically just overpriced motion sensors if you ask me.

2 Likes

Exactly. We need presence sensors that have better resolution. or maybe similar technology that Microsoft is using for the xbox, where it can see people in a room, even if they arent moving.

For overrides: I think Lutrons system is designed to swap out your wall switches with intelligent ones, that way the app can control the lights, or the wall switches that most often get used will override the app/automation

There’s another method you can potentially use and that’s an RPi running OpenCV and a webcam/PiCam, heck it even do facial recognition.

1 Like

Yeah but what good is all that? If you can tell people are there with body heat, then that should be good enough. I think it would be pretty cool to use heat differential to determine the person count of a room. Should be doable.

1 Like

Not only could you tell if there was a person in a room, you could track which person is in which room (think voice notifications for a specific person only being announced in that specific room they were in) and not only that, you could track occupancy even if you weren’t moving at all (sitting/laying on the sofa watching TV for example).

Heat differential is almost impossible to track in a residential situation as a means of counting people, although you can use passing changes in heat which is how most “Motion” sensors work.

Heat differential works great in a totally controlled environment, like a museum vault. The problem with a typical Home is that there’s so much variation even in an empty room. There’s often as much as a 15° difference just from the area right next to an outside window to the area closest to the furnace vent. And the hotspots in a room will change over the course of the day. When the furnace is on, the air out of a forced air vent is typically between 135 and 145°F. And there are other heat sources like incandescent lights, stoves, fireplaces, room heaters and some other equipment. Even a dog. You put all of that together, and you just can’t count people based on the heat of a room.

The most practical method is a trip beam, well, two actually at the entrance to the room. Some people have done that, and one of the micro location threads has a link to an actual project plan for it. With those you can literally count the number of people who enter the room and then the number of people who leave. They’re very reliable, they work very well, they just cost quite a bit and the install is a little complicated. But you don’t have to have people carrying anything with them, and you don’t have to keep recalibrating for summer days versus winter nights. So this technology exists, it just costs more than most people want to spend.

Beyond that, again as discussed in the other threads, micro location is something that everybody wants, but practically we don’t have yet. The best guess for five years from now is that will have technology that can recognize heartbeats. But that’s not available yet. :sunglasses:

There are some community members that have used the “wasp in a box” model with some success. You might find that interesting.

I feel like if you put enough motion sensors, you can achieve nearly perfect presence detection. I really can’t complain about my setup. Some sort of active Bluetooth beacon or WiFi signal strength might help round it out, but so far so good.

1 Like