Skip to content

[Bug]: aioesphomeapi declared without version constraint breaks all ESPHome devices in Home Assistant #38

Description

@andreasfedele

Version

v3.1.0

Connection type

ESPHome BLE proxy

Bug description

Summary

pyproject.toml lists aioesphomeapi with no version constraint. When Home Assistant
installs this integration's requirements, pip pulls the latest PyPI release on top of the
version shipped with HA Core. Since aioesphomeapi ships compiled Cython extensions, this
leaves modules from two different builds side by side in the same Python process. Every
ESPHome device in the installation then fails to connect — not just the Bluetooth proxy
used by this integration.

Environment

  • Home Assistant Core 2026.7.4 (HA OS, Python 3.14, amd64)
  • geberit-aquaclean 3.1.2
  • ESPHome devices on 2026.7.3 and 2026.4.0, all reachable, port 6053 open

What happens

After a "Restart Home Assistant", all ESPHome devices go unavailable and never recover.
Only a full "Reboot system" brings them back, and only sometimes — the outcome depends on
module import order, so it behaves like a race condition. Uninstalling this integration
resolves it completely and permanently.

Logs

RuntimeWarning: aioesphomeapi.connection.APIConnection size changed, may indicate
binary incompatibility. Expected 224 from C header, got 232 from PyObject

ERROR [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for @ :
Error while finishing connection: aioesphomeapi._frame_helper.packets does not export
expected C function make_noise_packets (UnhandledAPIConnectionError)

ERROR [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for @ :
Error while finishing connection: 'reduce_cython' (UnhandledAPIConnectionError)

How to reproduce

  1. Working HA installation with ESPHome devices
  2. Install this integration, pointing it at an ESPHome Bluetooth proxy
  3. Restart Home Assistant Core
  4. All ESPHome devices are unavailable; the devices themselves stay reachable and accept
    TCP connections on port 6053

What I ruled out

Network, Wi-Fi, mDNS, device firmware, stale IP addresses, /config/deps, and
ha core rebuild — the rebuild does not help because the conflicting version is
reinstalled on the next start. Disabling the integration is not enough either; HA still
installs requirements of disabled entries. Only uninstalling fixes it.

Suggested fix

aioesphomeapi is managed by Home Assistant Core and should not be declared as a
dependency of a custom integration at all — the integration can rely on the version Core
provides. If it must stay, pin it to exactly the version HA Core ships, and update that pin
alongside HA releases.

Relevant log output


Config (redacted)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions