Skip to content
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

PoC area mapping #415

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

PoC area mapping #415

wants to merge 2 commits into from

Conversation

timon37
Copy link

@timon37 timon37 commented Dec 23, 2024

As mentioned in #402 this is just to show the concept and allow anyone to test it, and not an actual "pull request".

The extension is renamed to 'Permuda' and all entities are prefixed with 'permuda' so that it can be used besides Bermuda and shouldn't conflict with it.

To test it just copy/link the 'custom_components/bermuda' folder as e.g. /var/lib/hass/custom_components/permuda then add the integration in home-assistant.

Currently I don't do any beacon power compensation, although the original code does and that might still work, I haven't tested it because I only have one...
So I'd recommend adding and callibrating only with one device at first, it has to be something that advertises continuously preferably quite often (e.g. 3 times per-second).
First just select it in "Configure / Select Devices" like in Bermuda.

To map an area:

  1. go to the area with a phone and your beacon device (probably also the same phone)
  2. click "Configure / Calibration 3: Mapping Areas"
  3. select your beacon device and the area you're in
  4. click submit to start gathering points for the map
  5. walk around the area with your beacon device,
    a. preferably naturaly pretending to do things you'd normally be doing
    b. you can click refresh to see how many points were captured
    c. note abort doesn't work atm... so don't accidentally walk into another area...
  6. once you've gathered enough data click Finish (initially aim for ~5-10sec of mapping, later you can add more)

You can clear specific areas or the whole mapping in "Configure / Calibration 1: Map Management".

Note that the area and some debug values are exposed as new entities "sensor.permuda_ Area" so you'd have to rename it or change your automations to actually use this instead of regular Bermuda.
Instead (at least initially) I'd recommend just opening the device and you'll see both the Bermuda and Permuda entities listed, there you can observe whether the Area changes differently and whether it's actually better or worse and where.

At the moment areas extend past their gathered points, so don't be surprised that you're likely mapped to (sometimes weird) areas when you're in a not-yet-mapped location.
You can try to limit that by mapping additional areas like "garden" or "elsewhere".

In tools there's a grah.py for visualizing the gathered points and tuning heuristics.
Just click "Download diagnostics" under the 3 dots next to "Configure", and run it: ./graph.py /path/to/diagnostics.json

Don't hesitate to ask questions or hack anything in the code, there's a bunch of tunables and alternative code that isn't exposed in the config yet.
Besides that I'd really like to see someone else's diagnostic.json file with a bunch of areas mapped!

timon37 Tomasz Borowik added 2 commits December 23, 2024 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant