custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.86k stars 239 forks source link

RSSI sensor for Device tracker devices #691

Open andrewjswan opened 2 years ago

andrewjswan commented 2 years ago

Add RSSI sensor for Device tracker devices :)

Ernst79 commented 2 years ago

PR is ready for your request, see #715

andrewjswan commented 2 years ago

Thanks!

Ernst79 commented 2 years ago

I had a good night sleep, and I’m afraid I need to adjust it. I think the current PR could result in a situation that a device is first recognized as a device tracker. Later, it can receive actual measurement data of e.g. a temperature sensor, but I’m afraid it won’t be recognized anymore as a temperature sensor, as it was recognized as a device tracker on the first message.

I need to test this and most likely have to change something.

Ernst79 commented 2 years ago

Had given it a try, but I need to seriously look at this, before changing it. The problem is that devices can be recognized as device tracker initially (e.g. due to a first advertisement without useful sensor data), but in a following message it can appear to be an actual sensor. The problem in the code is that it is than already initiated as a device with only a "rssi" sensor.

A possible solution is to update the device information (manufacturer, sensor type, firmware, and supported sensors). But I need to look into this, as this is probably not as easy as it looks. Might take a while.