1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.55k stars 784 forks source link

Presence detection for several devices: wrong source_type attribute in Home Assistant #1755

Closed bcutter closed 8 months ago

bcutter commented 11 months ago

Describe the bug In Home Assistant (HA Core 2023.3.6) the device_tracker.xiaomi_smart_band_7 entity's attribute has source_type: gps even it should be source_type: bluetooth_le.

Interestingly, in MQTT it is correct in the device_tracker topic:

...
  "name": "MB/SW-tracker",
...
  "val_tpl": "{% if value_json.get('rssi') -%}home{%- else -%}not_home{%- endif %}",
  "source_type ": "bluetooth_le",
  "device": {
...
...

To Reproduce Steps to reproduce the behavior:

  1. Set up a Xiaomi Smart Band 7
  2. Activate BT: Publish HASS presence switch in HA
  3. Wait to auto-discover the device
  4. Check device_tracker entity's attribute

Expected behavior Attribute source_type should be bluetooth_le in HA, like it is in MQTT.

Screenshots grafik grafik

Environment (please complete the following information):

Additional context As it is fine in MQTT but not in HA I fear you might close this issue and redirect me to... well, where?

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 90 days with no activity.

bcutter commented 8 months ago

Not fixed. Will try to update HA to a newer version.

Anyway, wondering why there's not a single response after 3 months...

DigiH commented 8 months ago

Interestingly, in MQTT it is correct in the device_tracker topic:

Not quite ;P took some time to really look closely, but there is a trailing space in "source_type ", messing the correct recognition up :(

Fixed with https://github.com/1technophile/OpenMQTTGateway/pull/1853

bcutter commented 8 months ago

Oh great, so sometimes it's the little things right... 😄 Can you estimate when this fix will be shipped (in a stable release)?

DigiH commented 8 months ago

As there are still some other issues which need addressing for the next release, a bit hard to say at the moment, but shouldn't bee too long.

bcutter commented 8 months ago

Alright so definitely 2024 and probably until February (or even January)? :-)

bcutter commented 1 month ago

Any update on this please? If I did not miss a release I tend to say we're still missing one, don't we? :-)

Please note I meanwhile discovered this for other devices provided by OMG/TheengsGateway too (other smart bands or a BM2 etc.) and therefore edited the title of this issue.