core icon indicating copy to clipboard operation
core copied to clipboard

Already configured Improv BLE device discovery reappears after HA restart

Open ScottG489 opened this issue 1 year ago • 1 comments

The problem

An Improv BLE device discovery keeps reappearing after HA restarts. This device is already configured and if I select to configure it it identifies that correctly.

What version of Home Assistant Core has the issue?

2024.8.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

improv_ble

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

On startup there's this log:

Logger: homeassistant.components.bluetooth.manager
Source: components/bluetooth/manager.py:109
integration: Bluetooth (documentation, issues)
First occurred: 8:21:13 PM (1 occurrences)
Last logged: 8:21:13 PM

Error in bluetooth callback
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth/manager.py", line 109, in _discover_service_info
    callback(service_info, BluetoothChange.ADVERTISEMENT)
  File "/usr/src/homeassistant/homeassistant/components/improv_ble/config_flow.py", line 142, in _async_update_ble
    service_info.service_data[SERVICE_DATA_UUID].hex(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: '00004677-0000-1000-8000-00805f9b34fb'

After selecting "configure":

Logger: homeassistant.components.improv_ble.config_flow
Source: components/improv_ble/config_flow.py:396
integration: improv_ble (documentation, issues)
First occurred: 8:22:48 PM (1 occurrences)
Last logged: 8:22:48 PM

CharacteristicMissing
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/improv_ble/config_flow.py", line 396, in _try_call
    return await func
           ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/improv_ble_client/client.py", line 184, in can_identify
    return await self._execute(_can_identify)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/bleak_retry_connector/__init__.py", line 505, in _async_wrap_bluetooth_connection_error_retry
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/improv_ble_client/client.py", line 291, in _execute
    await self._ensure_connected()
  File "/usr/local/lib/python3.12/site-packages/improv_ble_client/client.py", line 337, in _ensure_connected
    self._resolve_characteristics(client.services)
  File "/usr/local/lib/python3.12/site-packages/improv_ble_client/client.py", line 371, in _resolve_characteristics
    raise CharacteristicMissingError(characteristic)
improv_ble_client.errors.CharacteristicMissingError: 00467768-6228-2272-4663-277478268005

Additional information

No response

ScottG489 avatar Aug 29 '24 00:08 ScottG489

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

Code owner commands

Code owners of improv_ble 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 improv_ble 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)


improv_ble documentation improv_ble source (message by IssueLinks)

home-assistant[bot] avatar Aug 29 '24 00:08 home-assistant[bot]

I've attempted to ignore the discovered integration, but after restarting HA I now get this:

Logger: homeassistant.setup
Source: setup.py:269
First occurred: 12:53:22 PM (1 occurrences)
Last logged: 12:53:22 PM

Setup failed for 'improv_ble': No setup or config entry setup function defined.

ScottG489 avatar Aug 29 '24 17:08 ScottG489

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I have still occasionally seen this problem, though it seems to resolve itself after some time. Will keep an eye on this.

ScottG489 avatar Nov 27 '24 20:11 ScottG489

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Still seeing this occasionally where a device will show up to be set up then say it's already set up.

ScottG489 avatar Feb 28 '25 03:02 ScottG489

Still having the same issue.

Image

Image

Image

deshark avatar Mar 03 '25 07:03 deshark

Is the remote device an ESPHome device? Can you share the ESPHome configuration?

emontnemery avatar Mar 17 '25 14:03 emontnemery

Yes it is an Esphome device.

Here is the full yaml:

INFO ESPHome 2025.2.2 INFO Reading configuration /config/esphome/wtyczka-ha.yaml... INFO Updating @.*** substitutions: name: wtyczka-ha friendly_name: wtyczka ha room: '' device_description: athom esp32-c3 smart plug project_name: Athom Technology.Smart Plug V3 project_version: v1.0.7 relay_restore_mode: RESTORE_DEFAULT_ON sensor_update_interval: 10s current_limit: '16' dns_domain: '' timezone: '' sntp_update_interval: 6h sntp_server_1: 0.pool.ntp.org sntp_server_2: 1.pool.ntp.org sntp_server_3: 2.pool.ntp.org wifi_fast_connect: 'false' log_level: INFO hide_energy_sensor: 'true' ipv6_enable: 'false' power_plug_type: power-socket-us esphome: name: wtyczka-ha friendly_name: wtyczka ha comment: athom esp32-c3 smart plug area: '' name_add_mac_suffix: false min_version: 2024.6.0 project: name: Athom Technology.Smart Plug V3 version: v1.0.7 platformio_options: board_build.mcu: esp32c3 board_build.variant: esp32c3 board_build.flash_mode: dio on_boot: - priority: 600.0 then: - select.set_index: id: power_mode index: !lambda |- return id(restore_mode)-1; - lambda: !lambda |- switch(id(restore_mode)) { case 1:{ id(relay).turn_off(); break; } case 2:{ id(relay).turn_on(); break; } default:{ break; } } build_path: build/wtyczka-ha includes: [] libraries: [] esp32: board: esp32-c3-devkitm-1 flash_size: 4MB variant: ESP32C3 framework: version: 2.0.5 advanced: ignore_efuse_custom_mac: false source: ~3.20005.0 platform_version: @.*** type: arduino preferences: flash_write_interval: 5min api: encryption: key: xxxxxxxxxxx port: 6053 password: '' reboot_timeout: 15min ota: - platform: esphome version: 2 port: 3232 logger: level: INFO baud_rate: 0 tx_buffer_size: 512 deassert_rts_dtr: false hardware_uart: USB_CDC logs: {} mdns: disabled: false services: [] web_server: port: 80 version: 2 enable_private_network_access: true include_internal: false ota: true log: true css_url: '' js_url: https://oi.esphome.io/v2/www.js network: enable_ipv6: false min_ipv6_addr_count: 0 wifi: ap: ap_timeout: 1min fast_connect: false domain: '' reboot_timeout: 15min power_save_mode: LIGHT passive_scan: false enable_on_boot: true networks:

  • ssid: dom_iot password: xxxxxxxxxxx priority: 0.0 use_address: wtyczka-ha captive_portal: {} esp32_improv: authorizer: null identify_duration: 10s authorized_duration: 1min wifi_timeout: 1min dashboard_import: package_import_url: github://athom-tech/esp32-configs/athom-smart-plug.yaml import_full_config: false uart: - rx_pin: number: 20 mode: input: true output: false open_drain: false pullup: false pulldown: false inverted: false ignore_pin_validation_error: false ignore_strapping_warning: false drive_strength: 20.0 baud_rate: 4800 data_bits: 8 stop_bits: 1 parity: EVEN rx_buffer_size: 256 globals: - id: total_energy type: float restore_value: true initial_value: '0.0' - id: restore_mode type: int restore_value: true initial_value: '2' select: - platform: template name: Power On State id: power_mode optimistic: true icon: mdi:electric-switch options: - Always Off - Always On - Restore Power Off State on_value: - then: - lambda: !lambda |- id(restore_mode)=i+1; disabled_by_default: false update_interval: 60s initial_option: Always Off binary_sensor:
  • platform: status name: Status icon: mdi:check-network-outline entity_category: diagnostic disabled_by_default: false device_class: connectivity - platform: gpio pin: number: 3 mode: input: true pullup: true output: false open_drain: false pulldown: false inverted: true ignore_pin_validation_error: false ignore_strapping_warning: false drive_strength: 20.0 name: Power Button id: power_button disabled_by_default: true on_multi_click: - timing: - state: true min_length: 0ms max_length: 1s - state: false min_length: 200ms then: - switch.toggle: id: relay invalid_cooldown: 1s - timing: - state: true min_length: 4s then: - button.press: id: Reset invalid_cooldown: 1s sensor: - platform: uptime name: Uptime Sensor id: uptime_sensor entity_category: diagnostic internal: true disabled_by_default: false force_update: false unit_of_measurement: s icon: mdi:timer-outline accuracy_decimals: 0 device_class: duration state_class: total_increasing update_interval: 60s type: seconds - platform: wifi_signal name: WiFi Signal dB id: wifi_signal_db update_interval: 60s entity_category: diagnostic disabled_by_default: false force_update: false unit_of_measurement: dBm accuracy_decimals: 0 device_class: signal_strength state_class: measurement - platform: copy source_id: wifi_signal_db name: WiFi Signal Percent filters: - lambda: !lambda |- return min(max(2 * (x + 100.0), 0.0), 100.0); unit_of_measurement: Signal % entity_category: diagnostic device_class: '' disabled_by_default: false force_update: false accuracy_decimals: 0 state_class: measurement - platform: cse7766 id: athom_cse7766 current: name: Current icon: mdi:current-ac filters: - throttle_average: 10s - lambda: !lambda |- if (x < 0.060) return 0.0; else return x; on_value_range: - above: 16.0 then: - switch.turn_off: id: relay disabled_by_default: false force_update: false unit_of_measurement: A accuracy_decimals: 2 device_class: current state_class: measurement voltage: name: Voltage icon: mdi:sine-wave filters: - throttle_average: 10s disabled_by_default: false force_update: false unit_of_measurement: V accuracy_decimals: 1 device_class: voltage state_class: measurement power: name: Power id: power_sensor icon: mdi:power filters: - throttle_average: 10s - lambda: !lambda |- if (x < 3.0) return 0.0; else return x; disabled_by_default: false force_update: false unit_of_measurement: W accuracy_decimals: 1 device_class: power state_class: measurement energy: name: Energy id: energy icon: mdi:lightning-bolt unit_of_measurement: kWh filters: - throttle: 10s - multiply: 0.001 on_value: - then: - lambda: !lambda |- static float previous_energy_value = 0.0; float current_energy_value = id(energy).state; id(total_energy) += current_energy_value - previous_energy_value; previous_energy_value = current_energy_value; id(total_energy_sensor).update(); disabled_by_default: false force_update: false accuracy_decimals: 3 device_class: energy state_class: total_increasing apparent_power: name: Apparent Power icon: mdi:power filters:
  • throttle_average: 10s disabled_by_default: false force_update: false unit_of_measurement: VA accuracy_decimals: 1 device_class: apparent_power state_class: measurement reactive_power: name: Reactive Power icon: mdi:flash filters: - throttle_average: 10s disabled_by_default: false force_update: false unit_of_measurement: var accuracy_decimals: 1 device_class: reactive_power state_class: measurement power_factor: name: Power Factor icon: mdi:percent-outline filters:
  • throttle_average: 10s disabled_by_default: false force_update: false accuracy_decimals: 2 device_class: power_factor state_class: measurement - platform: template name: Total Energy id: total_energy_sensor unit_of_measurement: kWh device_class: energy state_class: total_increasing icon: mdi:lightning-bolt accuracy_decimals: 3 lambda: !lambda |- return id(total_energy); update_interval: 10s disabled_by_default: false force_update: false - platform: total_daily_energy name: Total Daily Energy restore: true power_id: power_sensor unit_of_measurement: kWh icon: mdi:hours-24 accuracy_decimals: 3 filters: - multiply: 0.001 disabled_by_default: false force_update: false device_class: energy state_class: total_increasing method: right button: - platform: restart name: Restart entity_category: config disabled_by_default: false icon: mdi:restart device_class: restart - platform: factory_reset name: Factory Reset id: Reset entity_category: config disabled_by_default: false icon: mdi:restart-alert device_class: restart - platform: safe_mode name: Safe Mode internal: false entity_category: config disabled_by_default: false icon: mdi:restart-alert device_class: restart switch: - platform: gpio name: Switch pin: number: 5 mode: output: true input: false open_drain: false pullup: false pulldown: false inverted: false ignore_pin_validation_error: false ignore_strapping_warning: false drive_strength: 20.0 id: relay restore_mode: RESTORE_DEFAULT_ON icon: mdi:power-socket-us disabled_by_default: false interlock_wait_time: 0ms light: - platform: status_led name: Status LED id: blue_led icon: mdi:lightbulb-outline disabled_by_default: true pin: inverted: true number: 6 mode: output: true input: false open_drain: false pullup: false pulldown: false ignore_pin_validation_error: false ignore_strapping_warning: false drive_strength: 20.0 restore_mode: ALWAYS_OFF text_sensor: - platform: wifi_info ip_address: name: IP Address icon: mdi:ip-network entity_category: diagnostic disabled_by_default: false update_interval: 1s ssid: name: Connected SSID icon: mdi:wifi-strength-2 entity_category: diagnostic disabled_by_default: false update_interval: 1s mac_address: name: Mac Address icon: mdi:network-pos entity_category: diagnostic disabled_by_default: false - platform: template name: Last Restart id: device_last_restart icon: mdi:clock entity_category: diagnostic disabled_by_default: false update_interval: 60s - platform: template name: Uptime entity_category: diagnostic lambda: !lambda |- int seconds = (id(uptime_sensor).state); int days = seconds / (24 * 3600); seconds = seconds % (24 * 3600); int hours = seconds / 3600; seconds = seconds % 3600; int minutes = seconds / 60; seconds = seconds % 60; if ( days > 3650 ) { return { "Starting up" }; } else if ( days ) { return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() }; } else if ( hours ) { return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() }; } else if ( minutes ) { return { (String(minutes) +"m "+ String(seconds) +"s").c_str() }; } else { return { (String(seconds) +"s").c_str() }; } icon: mdi:clock-start disabled_by_default: false update_interval: 60s time: - platform: sntp id: sntp_time timezone: '' update_interval: 6h servers: - 0.pool.ntp.org - 1.pool.ntp.org - 2.pool.ntp.org on_time_sync: - then: - if: condition: lambda: !lambda |- return id(device_last_restart).state == ""; then: - text_sensor.template.publish: id: device_last_restart state: !lambda |- return id(sntp_time).now().strftime("%a %d %b %Y - %I:%M:%S %p"); output: [] INFO Configuration is valid!

pon., 17 mar 2025, 15:36 użytkownik Erik Montnemery < @.***> napisał:

Is the remote device an ESPHome device? Can you share the ESPHome configuration?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124833#issuecomment-2729751295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAETBACT6UGDGZ2B2TUDXL2U3MVDAVCNFSM6AAAAABNJJ7FMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG42TCMRZGU . You are receiving this because you commented.Message ID: @.***> [image: emontnemery]emontnemery left a comment (home-assistant/core#124833) https://github.com/home-assistant/core/issues/124833#issuecomment-2729751295

Is the remote device an ESPHome device? Can you share the ESPHome configuration?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/124833#issuecomment-2729751295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAETBACT6UGDGZ2B2TUDXL2U3MVDAVCNFSM6AAAAABNJJ7FMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRZG42TCMRZGU . You are receiving this because you commented.Message ID: @.***>

deshark avatar Mar 17 '25 16:03 deshark

@deshark replying via email did not work well, the yaml is garbled. Can you try replying from the github website instead?

emontnemery avatar Mar 18 '25 07:03 emontnemery

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

I'm still seeing these occasionally. They sometimes pop in and out. I've had one that's been sitting there for a while now, though.

ScottG489 avatar Jun 16 '25 21:06 ScottG489

I'm having the same issue

michael-m52 avatar Jun 16 '25 21:06 michael-m52

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Still seeing this occasionally.

ScottG489 avatar Sep 16 '25 03:09 ScottG489