vgijssel / setup

Workstation and server setup
MIT License
8 stars 0 forks source link

Implement environment fingerprinting BLE positioning #153

Open mvgijssel opened 1 year ago

mvgijssel commented 1 year ago

Mentioned here https://github.com/mvgijssel/setup/issues/139#issuecomment-1383199097 the accuracy of the trilateration algorithm isn't really high so going to investigate alternatives. One of those alternatives is to use something like environment fingerprinting with a machine learning regression (for example https://www.mdpi.com/2079-9292/9/1/44).

To get started with this try out https://github.com/schollz/find3 which already implements training, testing and different machine learning classifiers.

TODO

mvgijssel commented 1 year ago

The toilet is inside the hallway, but because it's a relative small area there's a lot of inaccuracy whether an object is within the hallway or toilet. To compensate we can change the logic as follows:

  1. Consider the toilet to be a part of the hallway, it's no longer a separate location
  2. The toilet will only toggle occupancy due to the motion sensor (not due to the object tracking). Can be achieved with https://github.com/mvgijssel/setup/issues/110
  3. Once the toilet is occupied it will remain occupied until the occupancy of the hallway is disabled

Consider the same logic for the landing + laundry_room, which is similar to the toilet relatively small, resulting in accuracy.

mvgijssel commented 1 year ago

Need to re-train the locations due to the ESPHome devices becoming unreachable after a while impacting the fingerprinting. Fix is in https://github.com/mvgijssel/setup/pull/162.

mvgijssel commented 1 year ago

Updated the training settings to be as follows:

{
    "family":"home",
    "location": "office",
    "device":"bluetooth-00:00:00:00:00:00",
    "minimum_passive": -1,
    "window": 3
}

The window is now 3 seconds for collecting (2.5 times the throttle time) otherwise data points might go missing. Also removed the requirement for having data from at least 3 scanners (-1 means any number).