Presence detection

633 views
Skip to first unread message

Jay S

unread,
Feb 24, 2017, 9:19:46 AM2/24/17
to Node-RED
Does anyone have any robust methods of presence detection? I don't want per room detection yet. I'd just like to know whether the house is occupied or not.
I'm open to all suggestions

Sebastian Barwe

unread,
Feb 24, 2017, 9:54:06 AM2/24/17
to Node-RED
a trained dog that sends you an email by barking

Jay S

unread,
Feb 24, 2017, 12:37:39 PM2/24/17
to Node-RED
I'm not allowed one of those. Thanks for the suggestion though

Jéan Roux

unread,
Feb 25, 2017, 12:43:19 AM2/25/17
to Node-RED
Search this forum for 'person tracking via wifi'

I also use the arp-a approach, then do a grep for the family's phone's wifi addresses. But not that accurate, as if the phone goes into sleep mode that address not seen on router anymore.

Other suggested bluetooth on that discussion

Simon H

unread,
Feb 25, 2017, 3:42:58 AM2/25/17
to Node-RED
Hi Jay,

I did this recently with the ping node to each mobile, then publish to MQTT for further processing.
As identified by others, Apple phones tend to drop off and on.  The two Android phones in the house tend to stay on lan the whole time.
You can at least know that if you *get* a response, that person is present.....

When reading about it, some mentioned that just pinging the phone may cause more battery use, but I would imagine that a ping is serviced pretty efficiently....  the post I plagiarized (here) for my code did some analysis and determined that Android reported 5% of battery use over a day was wifi related....

One thing I did get confused over was I tried to ping by name (identified the name from my router's dhcp table).  But the device running node-red (Orange pi - armbian) had a fixed 8.8.8.8 DNS record, which I had to change to my router IP to get it to resolve the phone names.  Still have not worked out how to get linux to use the DNS record from the DHCP (any detail on this for armbian would be appreciated!).

S

Simon H

unread,
Feb 25, 2017, 3:54:11 AM2/25/17
to Node-RED
An alternative:

Discussion of PIRs & esp8266

Since you don't have large dogs running around, using PIR sensors may be an option (but not a software only one!).
You can get cheap PIR modules which run from 4.5v+; I wonder if one could be added to a sonoff;  There is 5v in the sonoff, but not necessarily easily accessible, and not necessarily very clean?

s

Walter Kraembring

unread,
Feb 25, 2017, 4:26:47 AM2/25/17
to Node-RED
Obviously this is a problematic area to solve. Using phones are not the best option since they try to save energy shutting down wifi (at least this is valid for iPhones).

Alternative solutions also depends on the layout of your premises. A simple entry/exit counting solution could be ok in one place but not for other layouts. Otherwise, a wireless tag based system could be suitable (using BLE for instance) but it will require you to carry a device with you.

Personally I use video motion detection for the surroundings of our house but I think it could actually be used in a clever way for indoor presence detection (as benefit, or disadvantage, depending how you see things, you get video monitoring indoors). As software, I use Motion, a very powerful software with lots of features. I run everything in a RPi3, with HD nightvision cameras connected & powered via the USB ports (without external USB hub, I think 2 cameras per RPi3 is maximum).

Every time motion is detecting movement, an event is sent to my Node-RED based home automation system. I imagine those type of events could be used for presence detection routines that are defined & built in Node-RED.

But also a dog would eventually cause presence. True or false, depending on how you see it

Mike Biddell

unread,
Feb 25, 2017, 5:34:49 AM2/25/17
to Node-RED
Jay

I have been doing this reliably for years using a 433mhz PIR (PT2262) in the hall (sold for burglar alarms). This is coupled with rfxcom and Max Hadley's node. The 9 volt batteries last for a year. 

I have a network of 433 sensors (including door contacts) and the PIR also turns on my stair lights. I have a contact on my letterbox, so I get an e mail with a snapshot if something is posted.

Mike

Colin Law

unread,
Feb 25, 2017, 5:40:57 AM2/25/17
to node...@googlegroups.com
Hi Mike

I can see that the you can tell whether there is someone in the hall
but not sure how it tells you whether the house is occupied.

Colin

On 25 February 2017 at 10:34, 'Mike Biddell' via Node-RED
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/fac3fc6d-bbca-4a1b-9b5c-373347144094%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

Mike Biddell

unread,
Feb 25, 2017, 7:45:23 AM2/25/17
to Node-RED
I have 433 contacts on all the doors as well

Mike Biddell

unread,
Feb 25, 2017, 7:46:20 AM2/25/17
to Node-RED
and also, u can not go anywhere in my house without transit through the hall

Colin Law

unread,
Feb 25, 2017, 8:17:44 AM2/25/17
to node...@googlegroups.com
On 25 February 2017 at 12:45, 'Mike Biddell' via Node-RED
<node...@googlegroups.com> wrote:
> I have 433 contacts on all the doors as well

How does that tell you that the house is occupied?

Colin
> https://groups.google.com/d/msgid/node-red/a166c9b0-d0c4-42dd-a491-d4f3954cfeb9%40googlegroups.com.

Mike Biddell

unread,
Feb 25, 2017, 8:32:58 AM2/25/17
to Node-RED
colin

not sure I understand the question?

To occupy the house, whilst I am away, some one has to open a door to get in

mike

Colin Law

unread,
Feb 25, 2017, 8:44:34 AM2/25/17
to node...@googlegroups.com
On 25 February 2017 at 13:32, 'Mike Biddell' via Node-RED
<node...@googlegroups.com> wrote:
> colin
>
> not sure I understand the question?
>
> To occupy the house, whilst I am away, some one has to open a door to get in

If you enter the house with another person, then you leave, how does
the system know that there is still someone there?

Or if you enter the house with two other people, then you leave and
later one or both of the others leave, how do you know whether the
house is occupied?

Colin
> https://groups.google.com/d/msgid/node-red/ae6b1279-b616-483e-aa31-b617f5cf0a2e%40googlegroups.com.

Mike Biddell

unread,
Feb 25, 2017, 11:43:05 AM2/25/17
to Node-RED
Isn't that where the hall PIR sensor comes in ??

If you don't want to use PIR sensors, a couple of IP cameras would suffice.

mike

Colin Law

unread,
Feb 25, 2017, 12:05:55 PM2/25/17
to node...@googlegroups.com
On 25 February 2017 at 16:43, 'Mike Biddell' via Node-RED
<node...@googlegroups.com> wrote:
> Isn't that where the hall PIR sensor comes in ??
>
> If you don't want to use PIR sensors, a couple of IP cameras would suffice.

The PIR sensor can't tell whether one or two people (at the same time)
have passed it. To make a system automatically monitor a camera and
work out how many people pass by would be tricky. The purpose (I
believe) is an fully automatic system to determine whether the house
is currently occupied.
> https://groups.google.com/d/msgid/node-red/165f757c-2375-4fca-8915-5df8c7856e71%40googlegroups.com.

Mike Biddell

unread,
Feb 25, 2017, 12:21:59 PM2/25/17
to Node-RED
Colin

errr if the hall sensor goes off, at that point in time, the house is occupied, the number of occupants is immaterial isn't it ?

If you are talking about a definitive occupancy at a moment in time, as you say, that is hard to achieve. It requires an IP camera in every room, with motion detection on and sound trigger (then node-red-contrib-ftp-server into an OR gate), and even that cant automatically work until someone moves or coughs. You cant rely on ping to mobiles, as they can be turned off (and therefore not 100% definitive). 

In short, I don't know anyone who has achieved 100% automatic occupancy detection, with the number of occupants, and I rather suspect it cant be done (but never say never).

Mike

kovaccs

unread,
Feb 25, 2017, 12:31:44 PM2/25/17
to Node-RED
@Jay S
I recentliy added a topic to this forum about my presence detection based on ifttt iOS/Android location trigger and Maker channel. 
Unfortunately ifttt has not too reliable yet. :-(

Kovaccsaba

Walter Kraembring

unread,
Feb 25, 2017, 12:35:41 PM2/25/17
to Node-RED
In short, I don't know anyone who has achieved 100% automatic occupancy detection, with the number of occupants, and I rather suspect it cant be done (but never say never).

Since long this has indeed been achieved in professional solutions using advanced access control systems and so called hard anti-pass-back. But it does indeed require substantial architectural design and building/site constructions to provide a secure anti-tailgating solution. This is costly, complex and sometimes not even practical and not for home usage. But correctly planned and implemented, it does work and keeps the headcounts correctly. As example we implemented such a solution for a mine where it mandatory always knowing the number of people currently in the mine. Those type of solutions are part of my profession


Mike Biddell

unread,
Feb 25, 2017, 1:24:25 PM2/25/17
to Node-RED
It's easy with cooperative occupants............ push button 433 for entrance and the same for exit

Nick Regier

unread,
Feb 25, 2017, 3:22:43 PM2/25/17
to Node-RED
Jay, i'm using happy bubbles and very pleased with the results.  check it out here - https://www.happybubbles.tech/

Mike Biddell

unread,
Feb 25, 2017, 3:54:59 PM2/25/17
to Node-RED
I wonder if a node  is possible where it checks shared google location for a list of subscribers against house coords. Cheap as chips and only mobiles required.

Colin Law

unread,
Feb 25, 2017, 4:11:48 PM2/25/17
to node...@googlegroups.com
On 25 February 2017 at 17:21, 'Mike Biddell' via Node-RED
<node...@googlegroups.com> wrote:
> Colin
>
> errr if the hall sensor goes off, at that point in time, the house is
> occupied, the number of occupants is immaterial isn't it ?

You are missing the point. If there are two people in the house and
one leaves (triggering the PIR) the system will not know whether two
or one people have left.

>
> If you are talking about a definitive occupancy at a moment in time, as you
> say, that is hard to achieve. It requires an IP camera in every room, with
> motion detection on and sound trigger (then node-red-contrib-ftp-server into
> an OR gate), and even that cant automatically work until someone moves or
> coughs. You cant rely on ping to mobiles, as they can be turned off (and
> therefore not 100% definitive).
>
> In short, I don't know anyone who has achieved 100% automatic occupancy
> detection, with the number of occupants, and I rather suspect it cant be
> done (but never say never).

I have solved the general problem sufficiently for my purposes with an
Android app that sends the phone's current location to a bespoke web
server every 5 mins. Node-red then interrogates the server to get the
latest location for each person. Better than just occupancy this gives
an indication of distance from home and speed of travel so it can be
used to adjust the heating such that the house is up to temperature
when the first person arrives back.

If I were doing it again I would look at using OwnTracks.

Colin
> https://groups.google.com/d/msgid/node-red/a7c158b0-5cea-4817-8749-55baed04bff2%40googlegroups.com.

Erik von Geldern

unread,
Feb 25, 2017, 4:51:15 PM2/25/17
to Node-RED
I check for mine and my wifes phones' mac addresses on the network (nmap) every minute.  If found, house is occupied and I delay the next scan for 5 minutes.
If not found, I query our iCloud accounts for phone location.  If found, house is occupied and I delay all scans for 5 minutes.
If not found, house is not occupied...Then I check for time of day and run a set of config options as appropriate.

kovaccs

unread,
Feb 26, 2017, 6:24:08 AM2/26/17
to Node-RED
Eric,
Your solution is sounds god but the newer iOSs in sleeping mode does not respond to any request for nmap or iCloud.  :-(

Kovaccsaba  

Sebastian Barwe

unread,
Feb 27, 2017, 1:25:54 AM2/27/17
to Node-RED
Ok, if you have time for research
there are some sensors [1] [2]  which can detect e.g. heartbeat (even for several persons)
I already tested them and e,g. for plessey you clearly see if somebody enters a room or not.
Nevertheless there is advanced signal processing necessary and I expect they will only work roomwise.
You can "see" other changes in the room as well, so really nice for burgler detection. 

They do not have the disadvanteges of optical devices which cannot see through or have problems with lights like TOF [3] or thermal heat sensors like thermopiles [4].

Indeed combining  these sensors would be interesting (you will get temperature/energy detection combined with presence detection which will get you a lot of information on the activities of daily live (ADL). Not only interesting for protecting the hourse but the persons living in as well) and the letter sensors will surely get lower in price due to VR/AR applications.


Julian Knight

unread,
Mar 3, 2017, 6:43:40 PM3/3/17
to Node-RED
As you've seen, this is actually a very hard problem.

Some ideas:
  • Make everyone carry a Bluetooth token (like the Happy Bubbles thing) - but they would have to carry it all the time and you'd probably need sensors on each entrance if there is more than one.
  • You could probably do the same thing with NFC tokens and sensors which would probably be a lot cheaper and wouldn't need batteries on the token so you might be able to sew the tokens into clothing.
  • Try to rely on each person's smartphone and IFTTT with a geofence that sends an event when entering and leaving the house area. Unfortunately, the geofence options are only accurate to 30-40m, which may be too much in an urban area.
  • Use cameras on all entrances with face detection. Not terribly practical and needs a fair bit of compute power. Not likely to work at all without decent and consistent lighting.
  • As above but make everyone paint their faces with unique patterns! ;-)
I'm currently using a combination of geofencing and ARP pings but it isn't really reliable enough. I have a mag switch on the front door and a PIR in the hallway. But as pointed out already, even the 2 sensors doesn't reliably tell you if someone is in the house. For example, 2 people could enter and one leave.

The simpler answer may be to train the last person out and first in to click a switch. Which could be on a phone of course.

Dave C-J

unread,
Mar 3, 2017, 6:46:38 PM3/3/17
to node...@googlegroups.com
Another (slow response time) option is to monitor co2 levels... 

Julian Knight

unread,
Mar 3, 2017, 7:30:42 PM3/3/17
to Node-RED
Or pressure sensors under the floors - with the added advantage that you could check people's weight as well!

Nick Regier

unread,
Apr 24, 2017, 4:52:44 PM4/24/17
to Node-RED
I recently discovered node-red-contrib-arp!  I'm using it to query my home network and search for MAC address.  This works very well... almost everyone at my house carries a smart phone. 

Very simply I'm using inject node ( 60 seconds intervals) -> Arp node -> deduplicate -> send text msg  (-> = wired to)

This works very well thus far... 

I could use some help (example flow) to send text msg when a MAC address(s) is not found ( any ideas?)

best,
nick  

Colin Law

unread,
Apr 24, 2017, 4:58:27 PM4/24/17
to node...@googlegroups.com
On 24 April 2017 at 21:52, Nick Regier <nickr...@gmail.com> wrote:
> I recently discovered node-red-contrib-arp! I'm using it to query my home
> network and search for MAC address. This works very well... almost everyone
> at my house carries a smart phone.
>
> Very simply I'm using inject node ( 60 seconds intervals) -> Arp node ->
> deduplicate -> send text msg (-> = wired to)
>
> This works very well thus far...
>
> I could use some help (example flow) to send text msg when a MAC address(s)
> is not found ( any ideas?)

You can use a trigger node for that. See the help text for the node on
how to use it as a watchdog timer.

Colin

Jéan Roux

unread,
Apr 24, 2017, 5:33:48 PM4/24/17
to node...@googlegroups.com
Check out telegram node, and using a telegram bot. It's free, and has Android / iOS clients, and works well on Pi with node-red.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/uxWrtphs_iM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Apr 25, 2017, 4:07:58 AM4/25/17
to node...@googlegroups.com
Perhaps I answered the wrong question. Is the question 'how to send a
text message" or '... when MAC is *not* found'?

Colin

Justin Haury

unread,
Apr 26, 2017, 3:39:28 PM4/26/17
to Node-RED
"But also a dog would eventually cause presence. True or false, depending on how you see it"

That is true for video surveillance systems, depending on the camera software used you may be able to change the detection sensitivity. I know I could in the CCTV cameras/DVRs I used to install years ago (to filter out moving trees etc). Also if you repurpose an alarm/security motion detector they typically run off 12v DC and they are usually "pet immune", different models have different weights. Most common is 40lb pet immunity (in the US). These wouldn't see most dogs or cats.


On Saturday, February 25, 2017 at 1:26:47 AM UTC-8, Walter Kraembring wrote:
Obviously this is a problematic area to solve. Using phones are not the best option since they try to save energy shutting down wifi (at least this is valid for iPhones).

Alternative solutions also depends on the layout of your premises. A simple entry/exit counting solution could be ok in one place but not for other layouts. Otherwise, a wireless tag based system could be suitable (using BLE for instance) but it will require you to carry a device with you.

Personally I use video motion detection for the surroundings of our house but I think it could actually be used in a clever way for indoor presence detection (as benefit, or disadvantage, depending how you see things, you get video monitoring indoors). As software, I use Motion, a very powerful software with lots of features. I run everything in a RPi3, with HD nightvision cameras connected & powered via the USB ports (without external USB hub, I think 2 cameras per RPi3 is maximum).

Every time motion is detecting movement, an event is sent to my Node-RED based home automation system. I imagine those type of events could be used for presence detection routines that are defined & built in Node-RED.

But also a dog would eventually cause presence. True or false, depending on how you see it

Simon H

unread,
Apr 29, 2017, 3:02:08 AM4/29/17
to Node-RED
My (quite old) pirs are not labrador immune. Quite sweet to photograph them at night revealing they sleep on the sofa together - they would never dare during the day! (Photo taken with NR controlled panasonic lumix).

Garry Hayne

unread,
Apr 29, 2017, 12:32:14 PM4/29/17
to Node-RED
RFID Tag?

Garry

Walter Kraembring

unread,
Apr 29, 2017, 1:44:47 PM4/29/17
to Node-RED
RFID Tag?

Is normally not good enough, would require strict discipline from ALL users. Reading range is just 10-15 cm for such devices in the affordable price range.

If you have one single door to an apartment and have a lock operated using tags (like Yale Doorman locks) it could eventually work, but still, several persons could enter or exit at the same time and then the actual people counting would be wrong


 

Leif Neland

unread,
May 1, 2017, 4:52:40 PM5/1/17
to Node-RED



On 25 February 2017 at 10:34, 'Mike Biddell' via Node-RED
<node...@googlegroups.com> wrote:
>
> I have a network of 433 sensors (including door contacts) and the PIR also
> turns on my stair lights.

When I first read that, I thought: Wow, over 400 sensors! ;-)

Reply all
Reply to author
Forward
0 new messages