opensourceautomation / Open-Source-Automation

Open Source Automation is a home and commercial automation engine
www.opensourceautomation.com
GNU Lesser General Public License v3.0
97 stars 62 forks source link

Occupancy logic enhancement #324

Open VaughnRupp opened 8 years ago

VaughnRupp commented 8 years ago

The current logic is only like 2 variables:

Is there someone already in the room if yes, then they are the occupant if no, select anyone else who is here and move them to that room, which works great when 1 person is in the house, but starts to break at a mere 2 people.

Pretty primitive, which triggers rooms to go vacant when the person that is moved vacates the previous room, which could cause a problem, turning off lights, etc.

There is no solution without actually knowing where people are, but the formula can still be improved in many many ways. The easiest to get in right away is to used stacked occupants first. Here is an example.

4 occupants arrive at the house, all are in living room.
Someone goes to the Kitchen, so 3 occupants in the living room, 1 in the kitchen. Now someone goes into the master bedroom, instead of just selecting a random person to occupy the bedroom, it will take one of the 3 stacked occupants in the living room, making sure that the kitchen stays occupied longer until Off Timers can vacate the room.

The next step, which will be a separate issue is Sensor Linking, like vCrib had. This is much more accurate. An example would be: there is 1 person in each bedroom, the bathroom is occupied. The person that has to cross the fewest untriggered sensors must be the person in the bathroom.

There would still me mess-ups, so what good is it if it thinks everyone is in the wrong place? Well, things that can identify a person will constantly try to straighten things out. Bluetooth on phone, login to a Screen, room ownership/preferred occupant.... Many things can improve the logic until we have hardware tracking of people.