ESPresense / ad-espresense-ips

DEAD: See https://github.com/ESPresense/ESPresense-companion
64 stars 9 forks source link

Thoughts on dealing with multiple floors #26

Open mvgijssel opened 1 year ago

mvgijssel commented 1 year ago

Thanks for this project, it's really dope!

I've setup ad-espresense-ips in this PR https://github.com/mvgijssel/setup/pull/134/files where I've configured two AppDaemon apps, Downstairs_ESPresenseIps and Upstairs_ESPresenseIps to help me with bluetooth object tracking across two floor.

I've made a couple of observations

  1. As mentioned in your readme, it's really helpful to have bluetooth scanners in the corners of your house. Trying to solve that in https://github.com/mvgijssel/setup/issues/139.

  2. matplatlib is not thread safe, therefore I got some really interesting behaviour in the mqtt camera inside of Home Assistant 🤣 because AppDaemon uses a thread per app. Implemented draw_interval_offset as a quick hack to get a semi-stable image for upstairs and downstairs.

  3. The z value of the tracked object is really high. For example this is a plot of the last 15 minutes from Home Assistant where the lowest z is 4,66 meters and I'm pretty sure my Apple Watch is in the living room on the downstairs floor and not on the roof 🤔.

image

Now I'm curious if you have any thoughts how to accurately determine the floor. I've read the comment posted here https://github.com/ESPresense/ad-espresense-ips/pull/21#issuecomment-1235383729, to use the z value as a way to determine the active floor, but there doesn't seem to be a reliable pattern when changing floors while looking at the data. The z value is constantly really high and seems to fluctuate a lot. I'm probably doing something wrong, just would love to pick your brain on what that is!

mvgijssel commented 1 year ago

To begin answering my own question. In https://github.com/mvgijssel/setup/pull/148 found and fixed a bug where I used a comma instead of a dot to indicate decimals:

diff --git a/home-assistant/config/appdaemon/apps/apps.yaml b/home-assistant/config/appdaemon/apps/apps.yaml
index 9dcd82b..ef54664 100755
--- a/home-assistant/config/appdaemon/apps/apps.yaml
+++ b/home-assistant/config/appdaemon/apps/apps.yaml
@@ -23,7 +23,7 @@ Downstairs_ESPresenseIps:
     hallway: [3.43, 9.43, 2.75]
     hallway_vacuum: [5.18, 11.2, 0.05]
     driveway: [2.83, 9.13, 1.03]
+    kitchen: [2.83, 7.28, 1.03]
-    kitchen: [2.83, 7,28, 1.03]
     kitchen_oven: [0.00, 8.03, 0.00]
     garden: [0.46, 0.00, 1.03]
     #

This would result in the z being 28 meter instead of 1.03 meter resulting in the wrong measurements 🤦.

After fixing the bug and installing multiple moko mk115's downtairs z is between -1 and 4 and upstairs between 3 and 8. It will require further tuning, but this will be a good starting point to determine different floors!

DTTerastar commented 1 year ago

Have you checked out ESPresense-companion? It's the WIP successor to this. I would love feedback. It has multiple floors built in as well.

wtadler commented 1 year ago

Is there anything written on how to configure the companion? I'm not sure how to get started drawing floors, adding my ESPresense devices, connecting MQTT, etc.

mvgijssel commented 1 year ago

Have you checked out ESPresense-companion? It's the WIP successor to this. I would love feedback. It has multiple floors built in as well.

Will check it out, thanks!