Occupancy Sensing - not just Motion!

XBOX Kinect does this excellently. One sensor technology cannot accurately work all the time, and neither can more of the same sensor. In order to do it, it requires multiple types of sensors, some of which might be cameras. Tracking motion. Tracking body shape. Movement, etc.

" The device features an “RGB camera, depth sensor and multi-array microphone running proprietary software”, which provide full-body 3D motion capture, facial recognition and voice recognition capabilities."

Sounds to me like Microsoft is WAY ahead of the game. Why are we not seeing home automation products from Microsoft?

I’d really like to see some sensors on the market that have the ability to do this. I feel like with a combination of sensors, it should be able to achieve this. Can a Kinect detect a person if they get into bed and start reading a book? or if they get under some covers and lay down for a nap? or to watch a movie? it should be smart enough to know that the person that was in the room, is still in the room, and they are stationary, or temporarily not visible.

1 Like

@theKpher I don’t think personally there is a hard and fast way to know definitely if a room is occupied. However I have had good success in tackling this using a multitude if sensors and methods.
As you realised the motion controlled lighting doesn’t work too well when watching TV or reading as people tend to sit very still doing these things and the lights keep going out.

I have done a pretty decent job of tracking occupancy in my rooms and it does work exceedingly well.

I will give you an example of my living room.

I have two motion sensors in the room because of coverage issues due to the size/shape. So first off we we turn on the lights when motion is detected if the lux levels are equal or below 12 or time is between sunset and sunrise with +/-8 min offset.
The lights won’t turn off until all motion sensors have been inactive for 3 mins.

So far so good but as you’ve probably realised the lights go out often. So I have methods to track things we would do in each room e.g. if my TV is on using a modified script of my ASUSWrt script. I have this mapped to a virtual switch so now the light don’t turn off if my TV is on.

So this removes a fair amount of false positives as the TV is in use when the Room Is Occupied. I also have another rule that turns 's off the TV/lights if there has been no motion for 30 mins… The only time this has ever triggered is when I have fallen asleep watching TV.

But as stated that doesn’t get rid of the false positives for example if I have guests around and we are talking with the TV off. So I use the noise dB meter of my netatmo Base Station that turns on/off a virtual switch when the noise level goes above the ambient noise level of the room. This covers that issue off well.

So then if I am reading I read on the sofa in the room. I have a home made pressure sensor that triggers when someone has sat on the sofa. This covers that issue of the lights turning off when reading.

Now that together covers 99% of the instances where lights go out. But it’s not still 100% accurate. E.g. sometimes I will sit on the floor with my laptop. I could track when that is switched on. But it’s a moveable device that can travel between rooms and yet there is no really reliable way to track which room it is in.

So in these rare cases when on my own with no noise and no TV and no motion in the room (this rarely happens) when the first time the light goes out I just move so the light switches back on and say “Alexa turn on living room manual” This disables further automation in that room until the virtual switch is turned off again (i do have a reset that will turn back off this manual switch after 1 hour if there is no motion, TV, or noise in that hour. Just in case I forgot to turn it off. A mode change also turns off this switch.

I have a manual virtual switch for each room as a simple way to override the automation when it doesn’t match the desired behaviour. In automation it’s pretty impossible to cater for the 100 percentile in your automation, but if you get it to 99 percentile you are doing well. With that in mind you need a way to quickly override and stop automation when needed.

I also have a Manual Mode which disables all automation in the house be it lights/heating/locks etc… Not 100% needed but I have used it during some ST platform issues to prevent undesired behaviour

2 Likes

What kind of switch do you use for manual mode?

Is it a toggle?

Do you have anything that signals what mode you are in?

Like when you click the button for manual mode, lights blink once?

Thanks

It is indeed a Standard Virtual switch which is a toggle with On/Off States.

I don’t need anything to flash which mode the room is in, i if its important i can see the status of the Manual switch by looking at the wall mounted tablet. or ask alexa using the new Ask Alexa Smartapp

At home, I have a traditional in-wall occupancy sensor controlling the lights in the garage, and it has never failed me. In my office, I have a small waiting room with a ST motion sensor, which works well but does show no-motion if the person is sitting still.

If I were to install sensors in my house to provide occupancy info (eg for lighting), I would use a traditional occupancy sensor with a wet-contact sensor (eg Enerwave ZWN-RSM1S relay) behind it. There might be other zwave or zigbee devices capable of being wet-contact sensors, but I’m not sure. (In case you’re wondering, “wet-contact” sensor can detect a powered circuit closing, while a “dry-contact” sensor can detect a non-powered circuit closing.)

Keep in mind that you’ll need a single gang space with neutral wire in it. Best option is to expand a single gang box housing a light switch to a double gang. If you have an older home, you will probably not have a neutral in the box, and will need to run wires from the nearest outlet. In newer homes, with a neutral in the light switch box, if you don’t want to switch it to a double gang, you could replace the light switch with the occupancy switch, but that will not give you much flexibility in setting up the whole system. Another option is to replace a receptacle, not sure if the occupancy sensor would work well at floor level though.

No need to connect a load to the relay – can just use it to detect the occupancy sensor on/off state. Can easily modify a switch DH to look like a motion sensor, so that the occupancy sensor/relay combo looks like a motion detector.

(I’m using the Enerwave ZWN-RSM1S relay as a “contact sensor” for security purposes. It is wired behind a ceiling light in a closet. The light is controlled through a mechanical jamb switch. When the closet door is opened, the jamb switch completes the circuit and the closet light comes on. The relay then indicates that the door is opened. I changed the stock binary switch DH, which works with the relay, to look like a contact sensor, so it shows closed/open state.)

We need Microchip implants for this to work or carry electronic device always lol.

Many researchers believe that eventually ( within 10 years) there will be micro location sensors that can recognize individuals by their heartbeats. But we’re not there yet, obviously. :sunglasses:

The next best thing will probably be a waterproof wearable.

1 Like

I kept having a problem with motion not being detected in my study while I was gaming so this was my solution. Works better than I would have ever guessed!

Set Up for on/off PC control via SmartThings:

  1. Installed Event Ghost on my PC. (I use this initially to turn “off” my PC from SmartThings)
    [OBSOLETE] Send Events to EventGhost
  2. Created a Virtual Switch (VS) to turn “off” PC using Send Events to EventGhost App.
  3. Using the same VS, I used CoRE and Wake on Lan (WOL) to turn “'on” PC (just point to mac address)
  4. Installed Host Pinger to sync my on/off status of my Computer with VS.
    [OBSOLETE] Host Pinger (IP based Online State / Presence)

Setup for using Event Ghost to monitor PC Activity:
5. Learned how to use Event Ghost to send “PC Events” to SmartThings.

6. Created a Virtual Smart Switch that I would use tell me if my computer was active or not.
7. Used Cloud Interface Smart App from Ask Alexa Setup to get the “End Points” of the VS. (So Cool!)
http://thingsthataresmart.wiki/index.php?title=Alexa_Helper#Cloud_Interface_Smart_App_Setup
8. Finally used a Macro and Python Script in Event Ghost to send SmartThings the PC Activity Status
import urllib; urllib.urlopen(‘http://some smartthings address’)

Might seem like a lot of work but it really wasn’t that bad. This was my PC activity VS works with my Motion Sensor and when both have been inactive for 30 minutes then my “Turn-Off” PC, Lights, Fans, Chair, Subwoofer, etc… Pistons executes.

I am going to install a Harmony activity monitor script on my Pi3 to tell work with my Den Motion Sensor for the same reasons.

1 Like

I have found that combining a beam trigger with a motion detector is a good way to determine if someone is entering or leaving a room.
Using the beam trigger on the door/access to the room and then the motion detector for inside the room. If the motion is detected after the beam trigger (say within 5 seconds) then they are entering the room. If motion is not detected after the beam trigger then they are leaving the room. I use CoRE rules to implement the logic. This is a useful way to control turning on and turning off lights, in a bedroom say.

2 Likes

Hi Stuart, what beam trigger are you using with SmartThings?

So I used a low cost infrared single-beam trigger, I found on Amazon.com, like this… http://a.co/d/eP3yk5y

This was used with a zwave dry-contact relay, also available on Amazon, like this… http://a.co/d/59e7uW2

I don’t think the zwave relay I used is readily available any more but this would be a good alternative… Remotec Zwave Dry Contact Fixture Module http://a.co/d/1dX6njk

The set up was very straight-forward. Although one thing I needed to do was to put some electrical tape over one of the beam sensors as a door-width was too small, meaning the infra-red signal was too strong and hard to break. You can experiment by how much and where to place to tape to create an optimal trigger.

Thanks Stuart - I presume you need power to both sides of the sensor too? Did you run the wire around the door frame?

That’s correct. I ended up using two power supplies I already owned on either side of the door. The sensors required a low voltage DC input. Perhaps a better option might be to run the wire under a carpet or floor boards if that is an option.

if you have a door position sensor for the room you are using, can use door close events to trigger looking for movement.
Door open event: turn on light
Door close event followed by movement: leave light on until next check when the door closes again
Door close event followed by no movement: turn light off

It always baffled me how the Kinect Sensor wasn’t able to do this - it can detect heartbeats, it can detect a human without the person moving - it has an open SDK and the devices now that it’s failed are relatively cheap.

I really thought someone would have hacked it be able to run one which just tells turns a switch on if it senses someone in the room and off it doesn’t, but alas it hasn’t happened.

I know for Homeassistant someone used a ML app with a basic camera which can be trained to spot a human in the room, even if they’re not moving - and in theory should be able to be face trained to know who’s entered the room and set scenes appropriately if you want. I’ve never tried it so i’m not sure how well it works.