This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Occupancy (presence) detection scoring.
keverjeroen
Member
Now I have some sensors in the house, I really want to get the occuparion detection (is anybody home) working. Presence detection (who is home) is even better, but I guess it's hard enough to detect that someone is home.
After trying some things an thinking about it, I had an idea. I want to give events a score. How higher the score is, how more likely it is that there is someone at home. Anyone using this approach? If so, do you have examples of how you use it?
I am only testing now, by setting a variable and incresing or decrecing it with 1 on events.
Example:
- phone connected on home wifi: +1
- phone disconnected from home wifi: -1
- movement detected by multi sensor: +1
- no movement detected in living room in last 15 minutes by multi sensor: -1
And more advanced with countdown timers:
(no one is home, and someone comes home, via the front door)
- front door openend, while there was no movement in living room in last 15 mintes: +1
(someone is home, walks from livingroom to hallway and walks out of front door)
- front door openend, while there was movement in living room in last 15 mintes: start timer 'door open'
> timer 'door open' stops and no movement in living room in last 15 mintes: -1
After trying some things an thinking about it, I had an idea. I want to give events a score. How higher the score is, how more likely it is that there is someone at home. Anyone using this approach? If so, do you have examples of how you use it?
I am only testing now, by setting a variable and incresing or decrecing it with 1 on events.
Example:
- phone connected on home wifi: +1
- phone disconnected from home wifi: -1
- movement detected by multi sensor: +1
- no movement detected in living room in last 15 minutes by multi sensor: -1
And more advanced with countdown timers:
(no one is home, and someone comes home, via the front door)
- front door openend, while there was no movement in living room in last 15 mintes: +1
(someone is home, walks from livingroom to hallway and walks out of front door)
- front door openend, while there was movement in living room in last 15 mintes: start timer 'door open'
> timer 'door open' stops and no movement in living room in last 15 mintes: -1
Comments
Timer every X time, if no movement in house: -1
Movement in sensor: +1 to 5 (depending on location).
If score < 0: set home=false.
If score > Y: set home=true.
And some fancy flows that check leaving through door and entering to door, but I need a more stable zwave for that. Not all alarms come through still.
If last person leaves the house then mode goes to "away"
If no motion detected for 24 hours then mode "away" changes to mode "holiday"
Simple and works perfect( everybody has to have and use their smartphone)
otherwise i would use geolocation from IFTTT. I have been told that Iphones works great wit geolocation from IFTTT(cann't confirm it)
Geolocation from IFTTT with android sucks
edit : And why can't you use an Iphone ? the fixed IP adress is given in the router?
Not perfect for me. It's gonna be hard to find the perfect solution for this.
- Phones are not always connected (rightly so because battery) .
- Not going to fix the ip for every phone, like friends/family that stay a couple of days, indoor-gardener or date I left sleeping while going off to work...
- What is my phone is off, or I don't have it on me, going out or in.
I believe the OP wants to achieve to know if his house is occupied or not. So wether or not he is home, the person in his house does not have to keep switching the lights on, because a flow tells Homey to switch it off. And when this person leaves, and forgets to turn off the lights, they do turn off.
Using only a doorsensor or only a multisensor isn't enough too. So that's why I want to combine sensors (input) to make a good guess if there is someone in the house.
I can use even more, then stated in the topic start. Example: When TV manualy is turned on or off, when light is turned on or off with physical switch, when pc boots, etc..
I have some flows that do a +1 or -1 to a variable, but it plusses to much. What @marcello says, I have to find a way to have a max value in a variable. Don't know yet how to do that.
Also I didn't find a way to use the multisensor in a good way to plus or min the variable. Now it plusses much too much..
Here is a nice article about occupancy and presence: http://dreamgreenhouse.com/projects/2013/presence/index.php
There is a lot to do for you:-) and maybe for me now too:/
I wonder why use +1 and -1? why not
make flow with:
IF there is movement in a room THEN someone is at home and present in that room ( you can do with that room what you want, lights on etc.)
Make another flow with:
IF there is movement in room THEN start counter for that room ( counter starts over each time there is movements seen.)
Make a flow with:
IF counter ends for a room THEN someone is not present in that room anymore and you can do what you like f.e. turn off lights or ever you want.
Make at last a flow like:
IF all counters in the house ended THEN there is a good possibility everybody is gone AND change preset or what you want?
Make flows with
presets ( Home, Away, Guests, A sleep, Vacation) I think you have to let homey know what the preset is.
Make Flows with:
Scenes ( what tot do when a preset is activated)
I don't have enought motion sensors yet but this is how i'm going to do it for now and maybe expand it later.
Sometimes there is no movement for a long time, while there are people at home. For example, watching a 2 hr movie on the couch. In this example movement stops, and the counter goes from 6 to 5. During the movie, 1 phone battery dies, and the counter goes down to 4. Now I can let homey ask "are you still at home?". If there is an answer, the counter goes up to 6. If not, it goes down to 2. Now Homey asks it one more time. Again no answer, the counter goes down to 0.
Thanks to Slack I found a way to set a min and max value on the counter, using these 2 flows:
I also made these 5 flows to check if someone enters or leaves the house via the front door. This is not 100% accurate, because my (only) movement sensor is in the living room.
-Edited one flow, to stop the timer_door_open_incomming-
https://forum.athom.com/discussion/996/tutorial-using-tasker-and-the-homey-api
You can use your phones gps and/or (more energy saving) your CELL ID. It works a lot better than IFTTT but its a bit more complicated to set up.
For a future setup I am looking forward to the Netatmo Welcome integration to Homey. I am using the Netatmo welcome to monitor my guests, e.g. they are welcomed by Homey with their names thanks to IFTTT. But you can't access the very nice working geofencing feature of netatmo to trigger if somebody has left.
Maybe some day I can use sensors like this: https://www.xethru.com/respiration-sensor.html/
Oops, you just said you did
Below an example. It isn't really smooth yet, but you can see when we were home, away and asleep. One advantage on this day, both persons have had a mobile phone with them (wifi) and both woke up, went away, came home and went to sleep togetter. When 1 is at home and 1 away, I guess it's a bit harder to check if there is still some one at home.
This is where u are using the issue thingie?
I've learned that some inputs are much more important then others. The more reliable the input, the higher the effect is on the occupation scoring. For example, If the TV is turned on by hand, this gives a very high score because only a human inside the house can turn it on. But if a phone isn't detected anymore bij SmartPresence, it could be that some one left the house, but it's also possible the battery is dead, or the wifi is down.
For everyone that is complaining about Smartpresence app, about the homey app, about ifttt, about motion sensors: Stop complaining and combine all those inputs to get an reliable precense system.
For the past 2 or 3 months or so the Homey mobile app presence function has been working very well for me (on an iPhone 6s and an iPhone 7). I had issues before that, apparently an IOS update fixed it at some point. People with iPhones may want to give it another go
However, as the topic starter indicated, for 'occupancy' detection, even if the presence detection based on your phone(s) is 100%, the phone based presence input is not enough to cover all situations for most households. To account for kids, cleaning ladies, guests etc. the counter based approach is very useful.
I am using several powerplugs to monitor if for instance the TV is in use, or the stereo system. I am also using input from a Nodon wall switch and from a motion sensor. Now it's a matter of collecting data and tuning the 'someone is at home' and 'nobody is at home' states (I love the Homey 'insights' ).
Note that depending on the scenario accuracy is more or less important. I have been switching the auxiliary heating in my bathroom based on the homey presence for months now and it is working great. The occasions where neither myself or my girlfriend are at home at night but someone else is, are very rare. During daytime this is a different matter and more input is needed.
Thanks,
Regards, Anne
Either Someone is Home or No One is Home
Then using the flows to set this is easier.
Any device is seen on the network or any motion means someone is home
otherwise, countdown timer and then check again.
If no, then no one is home