-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How about room mapping instead of trilateration? #402
Comments
P.P.S. |
I think both is needed in the end, trilateration to get x,y(,z) then map to floorplan to get area/room. Or at least have proxy location x,y in floorplan instead of proxy=area 1-on-1 mapping. |
Hmm I don't think you'll get reliable real-world space coordinates, hence why I said "in RSSI space". Just having the area's mapped into RSSI space (or whatever measure is used, sorry, I'm actually not sure) should make it fairly simple and hopefully good enough for the intended purpose. Also keep in mind RSSI is not static, e.g. it'll strongly depend on whether a door is closed or open between two rooms. Or on where your beacon vs your body is e.g. phone in pocket with your body between it and the proxy will attenuate a lot vs holding a phone out. Besides no antenna is ever perfectly omnidirectional. P.S. of course that's just imho, I could be wrong, hard to tell without trying everything;p |
@agittins I started experimenting on a hackish proof-of-concept for this. Mathematically it's not all that different, what you have right now is kindof like a voronoi diagram, my suggestion is to instead allow mapping those regions arbitrarily. It'll still work best if there's a device in each area, and I doubt that'll change dramatically. The main difference comes down to setup/tuning, in what I'm suggesting in configuration you'd select a beacon and area, click start, walk around with the beacon in that area, click save. Then do that for all areas you want to map. |
I'd like to throw in my two cents. I case room level accuracy is enough, and I think it is enough for the vast amount of people, then a neural network is a great candidate for a solution. People can train the NN for each room and even "simulate" different conditions, like doors open, phone in hand or in pocket and so on. The inputs for the NN are the beacons while, for starters, a single layer representing rooms would be worth a try. |
I am really for being able to map room would increase my accuracy massively. As I see it the currently method assumes rooms are circular and the bluetooth detection point is in middle of the room. I have Shelley 1 and 2 PM behind all my wall switches as well as some other bluetooth proxies so some of my room I have multiple shelley's in the same location for multiple rooms (or even 1 single shelley 2 for 2 rooms) and in one place I have 2 shelley's in the corner of 3 rooms. So being able to map a room based upon 2 or 3 points will make it so much more accurate. As it is now I can stand in the middle of my lounge room and not move and my location will jump between 2 or 3 rooms. |
Sorry I just haven't had time to explain the situation here, life has been way too busy for me to get into it - despite attempting a few drafts over the last few weeks :-) Suffice to say - Bermuda does not currently use trilateration at all, and as you'll see in a lot of places, it's next on the cards. The current area detection is deliberately described as a "naive, simplistic nearest-area" match, and in no way a trilateration attempt. I have set plans for the next phase, and there's plenty of writing about how I plan to do so. Sorry I don't have time right now to map it out but there's over a years' worth of discussion in the existing issues and threads that should help for now, and contribs are very welcome but there's significant context and discussion to get up to speed on to be able to get into the nitty gritty. One thing I seem to keep learning is that ideas are the easy bit, the implementations are hard :-) |
@agittins No problem. I'll try to post my current hacks soon-ish. Python's not my thing and my editor was being a bit troublesome so sorry for what you'll see there;p @gheydon Ok, you might be a good test-case for this:) I have too few proxies. @dekiesel Yeah, it's probably the most classic application for NN. Though at such small scale it's apparent that it's just curve fitting based on statistics. So calling it AI/NN/etc isn't necessary unless someone wants to find investors;) |
@timon37 @agittins https://github.com/ExperienceLovelace/ha-floorplan |
@timon37 My view is even a approximate location or region is better than nothing |
That investor comment hit a bit too close to home :D I still think it's the best choice since it's easy to scale to any number of beacons and it can get us basically as close as we want to the best fitting function. But as @agittins said, ideas are cheap. I'm in the process of renovating and moving and it'll be some time until I have a setup that's right for testing neural networks as a possible solution. |
@saket424 Personally I'm explicitly aiming to not need any "real coordinate map", and so far it seems unfeasible to have them (to me). But I've been surprised many times in life so who knows what others come up with. @dekiesel Yeah, I've struggled with hand tuning mediocre heuristics often enough that I'm warming up to the idea quite quickly already:) I hope late next week I should have enough time to make it such that it can be used besides bermuda without interfering with it. So you can test without screwing up your current setup. In the meantime a spoiler screenshot of a debug graph: And some example stats which show that e.g. 'corridor' in my case is basically undetectable with the sensor placement (and not so great heuristics) that I have. |
The main problems with trilateration are:
Mapping could solve these
We'd do room calibration by walking around with a beacon e.g. into each corner of an area, capturing the RSSI to all proxies.
These points would effectively create a polygon corresponding to that area.
Doing this for each area would effectively create a map (in the proxy RSSI space).
And the beacon would be assigned a given location when it's within that polygon (likely with a bunch of heuristics fuzzing the edges).
Side benefits
Any overlap in the areas would quickly indicate problematic areas to the end user.
These could be handled by:
Any space between the areas most likely corresponds to wall attenuation.
We could allow marking which areas are touching, to eliminate these and always assign one or the other when a beacon ends up in between.
Challenges
The RSSI also depends on the beacon strength, so the math has to be normalized/relative.
In the sense that e.g. coordinates (50, 30, 10) from a strong beacon are the same as (5, 3, 1) from a weak beacon (grossly oversimplifying of course).
RSSI to far away proxies is likely going to be very variable, so there will have to be heuristics to either:
The map effectively has as many dimensions as there are proxies, and various points will only have coordinates for some of them. This would make visualizing the data a bit difficult and may make debugging complex cases challenging.
In general there will likely have to be many heuristics to make this work well, which also implies many tunable parameters, which is both good and bad.
P.S.
I'm definitely willing to help with this, especially the math.
Unfortunately I'm not familiar with python, nor hass internals, so I'd be quite clumsy.
I'd expect the UI to be the main difficulty as this will involve a fair number of mapping interactions, visualization/debugging helpers.
The text was updated successfully, but these errors were encountered: