Defining and architecting Presence

owntracks
openhab2
presence
Tags: #<Tag:0x00007f15daa308d0> #<Tag:0x00007f15daa304c0> #<Tag:0x00007f15daa300b0>

(Will) #1

(I will be continuing to refine this article, and your constructive criticism is elicited)

I believe the term “Presence” takes on multiple levels of scale, identification, and time granularity, which could be serviced by different techniques. Presence could be a set of objects (depending on number of persons) with the attributes 'location" and “time”, with the location state attribute defined by rules that focused on the most granular location systems first per their availability.

LOCATION:

  • Intra-building: Within a room in a building
    Available Technologies:
    Near-realtime

    • FIND
    • Bluetooth beacon
    • video analytics
    • motion detection (unidentified)
    • a correlation of one or more of the above
  • On Premises: Inside or within a very short distance of a building or other finite location (e.g, geofence of 3 to 50 meters from building/location boundary, depending on location ‘footprint’ and urban/suburban/exurban density considerations).
    Available Technologies:
    Near-realtime

  • Near Premises: Within some end user definable distance as ‘near’, in order to identify when a person is approaching/leaving home for purposes of HVAC control, outside light control, setting security system mode, etc. There could be multiple geofences of differing distances for different purposes (as HVAC control may need more time to ramp up, as one example) 0.5 to 3 kms might be such example distances, with the aforementioned urban/suburban/exurban considerations.
    Available technologies:
    Soon Afterwards

    • Owntracks or similar solutions (timeliness category depends on update rates)
  • Away: Anything considered beyond ‘Near Premises’. There could also be multiple such levels of “away”, if purposes warrant.
    Available technologies:
    Soon Afterwards

    • Owntracks or similar solutions. (timeliness category depends on update rates)

TIME:

The subject of time has three distinctive aspects;

  1. Timeliness signifies how immediate a location report is realized. Timeliness could be roughly categorized as;
  • ‘Immediate’ (0-2 seconds)
  • ‘Soon afterwards’ (3-10 seconds)
  • ‘Thereafter’ (11+ seconds).

Its importance will vary, since different User Stories have differing timeliness needs. Knowing the presence of a resident with respect to whole house HVAC or security mode settings only requires knowing within a 10-20 seconds that a person has entered or exited a Near Premises geofence. Intra-building movement events for lighting or ‘following’ music, as two examples, would be expected to react within the immediate timeframe. Intra-building events for zone/room heating/cooling would be expected to react within 5-10 seconds, though behavior interpretation via video analytics (such as recognizing that a person just sat down) would be highly preferable to preclude starting up a system to respond to a person who walks into a room, picks up something, then turns around and leaves (which has obvious HVAC efficiency penalties). One could take this to extremes, of course, so it goes without saying that understanding the actual need should drive any system analysis of alternatives and corresponding architecture.

  1. Time of last update indicates the datetime of the last report of a location device. If an OH system has multiple location devices/items (such as FIND and Owntracks, as an example), there can be multiple overlapping reports. This can be used to retrace one’s whereabouts throughout the day or confirm the notification of a change in location status (e.g. when Owntracks reports that a person is no longer OnPremises and the PhonePresence has stopped reporting presence).

  2. Planned vs. unplanned time of events explores the concept of timing of system events according to calendar events vs. location notification updates. For example, if one’s heating/cooling system is timed to stop 15 minutes before one leaves for work, though one leaves an hour early one morning for a special meeting, the Away notification can be a trigger to stop the heating/cooling system earlier. Another example is a friend stops by when you are away for a few days to feed the cat and PhonePresence learns they are OnPremises so that an alarm is not triggered. Another example is when one decides to head to bed early, and FIND reports more than three minutes of presence in the bedroom 30 minutes before nominal bedtime, so that the rule for turning on lights via motion sensor reports has a condition to stop triggering the light on and will go into Sleep mode

PERSONS:

The types of individuals we are determining the presence for is another major component of presence. Generic categories can be;

  1. Unknown (e.g, simple motion detection return, a switch manually activated, etc)
  2. Residents
    a. Specific residents (e.g. husband, wife, child, roommate)
  3. Guests
    a. Known to Openhab (e.g., Openhab FIND knows their phone, facial recognition, …)
    b. Unknown to Openhab (e.g., family member without smart phone, …)
  4. Other visitors
    a. Known to Openhab (e.g. delivery person via facial recognition or smart phone)
    b. Unknown to Openhab

USER STORIES (use cases) for presence can be myriad, with almost an infinite number of combinations. Some examples include;

Intra-building:

  • As a resident, I would like the lighting to respond to where I am in the house
  • As a resident, I would like to find my phone that I left somewhere in or around the house
  • As an adult resident, I would like to turn on the heating/cooling system zone for rooms where unplanned activity is occurring (and likely to persist for more than x minutes)
  • As a resident or known guest, I would like to have the intercom directed to the room I am in for interactive conversations involving me
  • As an adult resident, I would like to have the intercom directed to the room I am in for announcements such as “You have a visitor at the door”, “Unknown vehicle arrived in driveway”, etc
  • As a resident, I would like the music I am listening to follow me from room to room
  • As a resident, I would like…

On Premises:

  • As an adult resident, I would like to know when residents or guests are on premises so that the heating/cooling system can be adjusted accordingly
  • As an adult resident, I would like to know when guests, visitors, or unknown persons or vehicles are arriving, along with any available corresponding identities
  • As a parent resident, I would like to know where children are (applies to more than one location category)
  • As a parent resident, I would like to know when young children wander off premises
  • As a parent resident, I would like to know when children have arrived at a destination (e.g., school)
  • As a resident, I would like…

Near Premises:

  • As a resident, I would like the heating/cooling system control algorithm to know of my departure
  • As a resident, I would like the heating/cooling system control algorithm to know of my imminent return
  • As a resident, I would like the lighting/security system to know of my imminent return
  • As an adult resident, I would like the lighting/security system to know when I have left the premises, especially if guests or children are still on premises
  • As a parent resident, I would like to know where children are (applies to more than one location category)
  • As a resident, I would like…

Away:

  • As a parent resident, I would like to know where children are (applies to more than one location category) and where the other parent is for purposes of understanding the children are going to be picked up
  • As a parent resident, I would like to know that children have arrived at a planned destination (e.g., school). A variant of this is to receive an alert if a child has not arrived at a destination within an expected time window.
  • As a resident, I would like my Openhab system to know I have arrived at work/school, so that I am only sent important alerts and notifications
  • As a resident, I would like …

Best Presence detection
Presence tutorial - my implementation
(Kim Skatun) #2

The problem with presence detection is the away state, how to trigger that? I am currently using the timeout of 20minutes of anyone of your cases above.


(Will) #3

@skatun, leaving a geofence area that one labels “Away” or such can define when one is Away. This can be in addition to or in concert with a “Near Premises” geofence.


(Vincent Regaud) #4

Hello,
I have found it difficult to find detailed information about presence detection. From the hardware to the software.
There is the “wasp in a box” algorithm but it relies on people opening and closing doors. Unlikely with children!!
The PIR sensors are only movement and don’t give info of numbers and who it is.
I could go on…
The intra-building/on property presence detection needs to be a correlation of different technologies and this is where the software (rules!) come in. There is where I struggle to come up with anything and I would love to see rules for the different examples cited above.

Keeping a close eye on this thread…

Vincent


(Christos) #5

Is it only me that I find that indoor localization in one’s house cannot be done using a smartphone ? I rarely carry around my smartphone when I move from room to room in my house so I do not find it very realistic. I think what might work best is BLE nodes in each room and then a BLE capable smartwatch which is at least attached to me :slight_smile:
I have yet to put this in practice so I do not know the disadvantages to this approach, but I think I will start testing it soon