-
Notifications
You must be signed in to change notification settings - Fork 3
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
Overlapping scanning devices #12
Comments
Yes, that is correct. Unfortunately there is no easy way to fix this, because that is how the legacy device_tracker api works. I cannot set a new 'last_seen'-time without overriding the previous values (e.g. RSSI and ghname). This should be fixable by migrating to the new api. A good chunk of code needs to be refactored to do this though. |
I'm a developer but the last and only time I used python was more than 15 years ago to write a blender script but this may be the right time to give python a try. |
The home-assistant plugin system is an interesting one. Let me give you a quick rundown of how this works, before you take a look at it. Especially if you are not too familiar with python anymore. Initialization of the component happens here Per config_entry (that is per linked google account in the home-assistant UI, usually one, but may be more) this function is called and forwards setup to the sensor-platform (for timers and alarms) and the device_tracker-platform (bluetooth monitoring). So initialization for the device-tracker component happens here. This creates one Setup continues, when said helper class calls And that is the one, that inherits the "old" DeviceTracker class from home-assistant. What should be done instead is creating an entity per discovered bluetooth device, that inherits the TrackerEntity-class and add those via the provided async_add_entities-function. Then those devices can be updated on incoming scans (instead of overriding all values), but additionally we need to implement logic to remove devices that were not seen for a given time again. I believe, that the mentioned Additionally all components already using the new api can of course be used to study this. Let me know in case there is anything else, I can help you with. |
I'm not 100% sure and it's hard to debug but it seems that a
device_tracker
is updated with the information from the latest scan.If a device is in range of multiple google home the
RSSI
and theghname
seems to be the one reported from the last google home to respond while they should be from the one with the better RSSI.Can you confirm this behaviour?
The text was updated successfully, but these errors were encountered: