home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.62k stars 30.77k forks source link

ESP Home esp32_ble_tracker RSSI Sensor broken #126677

Closed j3mu5 closed 2 weeks ago

j3mu5 commented 1 month ago

The problem

Since the update to ESP Home 2024.9.1 (I skipped 2024.9.0), the BLE RSSI sensor in HomeAssistant no longer provides any values, but shows "unavailable".

What version of Home Assistant Core has the issue?

core 2024.9.1 + ESP Home 2024.8.3

What was the last working version of Home Assistant Core?

core 2024.9.1 + ESP Home 2024.9.1 (propably 2024.9.0)

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ESP Home

Link to integration documentation on our website

https://www.home-assistant.io/integrations/esphome

Diagnostics information

2024-09-24 20:01:42.263 DEBUG (MainThread) [aioesphomeapi.connection] floor1-child1-2-presence @ 10.10.0.194: Got message of type BluetoothLERawAdvertisementsResponse: advertisements { address: 75782202459046 rssi: -92 address_type: 1 data: "\032\377L\000\002\025\2425<\332\032[K\267\214\316{\033\266\220F\233\000d\000\001\305" } advertisements { address: 109139153336762 rssi: -92 address_type: 1 data: "\032\377L\000\002\025\270\240$\310*\330K\257\207\177\251.M\005\212\025\000d\000\001\305" }

2024-09-24 20:01:42.278 DEBUG (MainThread) [aioesphomeapi.connection] floor1-bedroom-presence @ 10.10.0.192: Got message of type BluetoothLERawAdvertisementsResponse: advertisements { address: 109139153336762 rssi: -84 address_type: 1 data: "\032\377L\000\002\025\270\240$\310*\330K\257\207\177\251.M\005\212\025\000d\000\001\305" }

Example YAML snippet

ESP Home config snippet:

esp32_ble_tracker:  
  scan_parameters: 
    interval: 77 ms
    window: 64 ms
    duration: 7 min

binary_sensor:
  - platform: ble_presence
    ibeacon_uuid: 'ab44345e-4c32-44d0-af20-dddd0a33cd78' # not my actual uuid!
    name: "smartphone_johannes"

sensor:
  - platform: ble_rssi
    ibeacon_uuid: 'ab44345e-4c32-44d0-af20-dddd0a33cd78' # not my actual uuid!
    name: smartphone_rssi
    force_update: true
    accuracy_decimals: 1
    filters:
      - exponential_moving_average:
          alpha: 0.05
          send_every: 13
          send_first_at: 13
      - lambda: return ((id(rssi_factor_j).state*x)/id(rssi_factor).state);
      - timeout: 25 s

Anything in the logs that might be useful for us?

The very verbose logs from ESP Home look as if the sensor is working on the ESP Home side, maybe it is reporting an empty name?:

[19:52:16][V][esp32_ble:331]: (BLE) gap_event_handler - 3
[19:52:16][V][esp32_ble:331]: (BLE) gap_event_handler - 3
[19:52:16][VV][esp32_ble_tracker:431]: Parse Result:
[19:52:16][VV][esp32_ble_tracker:448]:   Address: 49:C8:00:6B:83:00 (RANDOM)
[19:52:16][VV][esp32_ble_tracker:450]:   RSSI: -93
[19:52:16][VV][esp32_ble_tracker:451]:   Name: ''
[19:52:16][VV][esp32_ble_tracker:467]:   Manufacturer iBeacon:
[19:52:16][VV][esp32_ble_tracker:468]:     UUID: ab44345e-4c32-44d0-af20-dddd0a33cd78
[19:52:16][VV][esp32_ble_tracker:469]:     Major: 100
[19:52:16][VV][esp32_ble_tracker:470]:     Minor: 1
[19:52:16][VV][esp32_ble_tracker:471]:     TXPower: -59
[19:52:16][VV][esp32_ble_tracker:483]:   Adv data: 1A.FF.4C.00.02.15.A2.35.3C.DA.1A.5B.4B.B7.8C.CE.7B.1B.B6.90.46.9B.00.64.00.01.C5 (27)
[19:52:16][VV][esp32_ble_tracker:431]: Parse Result:
[19:52:16][VV][esp32_ble_tracker:448]:   Address: 49:C8:00:6B:83:00 (RANDOM)
[19:52:16][VV][esp32_ble_tracker:450]:   RSSI: -98
[19:52:16][VV][esp32_ble_tracker:451]:   Name: ''
[19:52:16][VV][esp32_ble_tracker:467]:   Manufacturer iBeacon:
[19:52:16][VV][esp32_ble_tracker:468]:     UUID: ab44345e-4c32-44d0-af20-dddd0a33cd78
[19:52:16][VV][esp32_ble_tracker:469]:     Major: 100
[19:52:16][VV][esp32_ble_tracker:470]:     Minor: 1
[19:52:16][VV][esp32_ble_tracker:471]:     TXPower: -59
[19:52:16][VV][esp32_ble_tracker:483]:   Adv data: 1A.FF.4C.00.02.15.A2.35.3C.DA.1A.5B.4B.B7.8C.CE.7B.1B.B6.90.46.9B.00.64.00.01.C5 (27)

Additional information

I assume that one of the latest changes with the release of ESP Home 2024.9.0 is causing the error: https://github.com/esphome/esphome/pull/7332 https://github.com/esphome/esphome/pull/7088

home-assistant[bot] commented 1 month ago

Hey there @ottowinter, @jesserockz, @kbx81, @bdraco, mind taking a look at this issue as it has been labeled with an integration (esphome) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `esphome` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign esphome` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


esphome documentation esphome source (message by IssueLinks)