Skip to content

MQTT connect times out on every attempt (no CONNACK) — entities stay unavailable, subscription never retries #47

Description

@sacredserengeti

The problem

Every time the integration connects, the MQTT CONNECT goes out but no CONNACK ever comes back — aiomqtt times out after 10s. And because the subscription task doesn't retry, one failed connect kills it permanently. All entities sit at "unavailable" until I manually reload the config entry, which fails the exact same way. So it never self-heals.

ERROR root: MQTT connection for <serial> failed: Operation timed out
ERROR homeassistant: Error doing job: Future exception was never retrieved (task: None)

Side note: that error only shows up under the root logger, so setting python_snoo to debug turns up nothing — I only found it by dumping everything. Cost me a good hour of head-scratching.

What I've ruled out

I went through the whole checklist before assuming it was the library:

  • Deleted the config entry in HA and re-added with fresh credentials — same failure
  • Fully power-cycled the bassinet — the Happiest Baby app shows it online and controls it fine the entire time, before and after
  • Watched the connections at the router (conntrack on a MikroTik while reloading the entry): every connection from HA to AWS/Cognito/CloudFront/HB completes TCP+TLS cleanly, established → time-wait, normal handshake-sized byte counts. Nothing is being dropped locally.
  • Everything else on the same HA instance and network is fine

So auth works, the devices API works, TLS to the IoT endpoint works — and then CONNECT just gets ignored. No CONNACK, no error, just the timeout. My understanding of AWS IoT custom authorizers is that a silent drop is what a token rejection looks like, which makes me wonder if HB changed something server-side and 0.11.0's endpoint/token derivation is now quietly getting rejected. Have you seen this on your own install?

Two things that would help regardless of root cause

  1. Retry with backoff in the subscription loop. Right now any single MqttError — even a transient one — permanently kills it, and from the HA side that looks like "integration broken" rather than "blip, recovering".
  2. Log under a library logger instead of root, so debug logging is actually usable for this.

Setup: python-snoo 0.11.0, HA 2026.7.4 on HAOS (core snoo integration). Happy to capture more debug output — the wss:// connect line, aiomqtt exception details, whatever's useful — just point me at it. Serial and account details left out, but can share privately if that helps.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions