Skip to content

AP status sensors stay unknown on HA 2026.9 — WebSocket to AP never establishes #356

Open

Description

@pgress

Summary

On Home Assistant 2026.9, the OpenEPaperLink integration (v3.0.0, latest) fails to establish its WebSocket connection to the AP. As a consequence, all AP-status sensors (heap, uptime, WiFi RSSI, tag count, run/state, etc.) stay unknown forever, even though the AP is reachable and tag-side sensors work fine (those are loaded via HTTP /get_db, not via WebSocket).

Note: This issue originally also covered an AttributeError: storage.async_remove_store crash during integration uninstall. That has been split out into #358 and fixed by #357. This issue now tracks only the WebSocket-never-connects problem.

Environment

  • Home Assistant version: core-2026.9.4 (Home Assistant OS 18.3, Supervisor 2026.09.3, Python 3.14.6)
  • OpenEPaperLink integration version: 3.0.0 (latest, no pending update in HACS)
  • AP hardware: OpenEPaperLink Yellow AP (ESP32), firmware up to date, reachable at 192.168.188.125
  • Tags: 2× M3 2.2" (working — checking in every ~40 s, last_seen is fresh)
  • Installation: HACS, custom repository OpenEPaperLink/Home_Assistant_Integration

Reproduction

  1. Run Home Assistant 2026.9.x with the OpenEPaperLink integration v3.0.0 installed.
  2. Add the AP integration (Settings → Devices & Services → Add Integration → OpenEPaperLink → enter AP IP).
  3. Wait for setup to complete (integration shows as "loaded", no setup error reported).
  4. Open any AP-status sensor, e.g. sensor.openepaperlink_ap_status, sensor.openepaperlink_ap_betriebszeit, sensor.openepaperlink_ap_tag_anzahl.
  5. Observe that all AP-status sensors stay unknown / has_value() == False indefinitely.
  6. Load the full HA log (Settings → System → Logs → Load full Home Assistant log) and filter for open_epaper_link.

Expected Behavior

The integration cleanly initializes, the WebSocket connection to ws://<AP_IP>/ws is established, and the AP-status sensors are populated from periodic sys WebSocket messages (status, run_state, uptime, heap, db_size, littlefs_free, ps_ram_free, rssi, wifi_ssid, record_count, low_battery_count, timeout_count).

Actual Behavior

The WebSocket connection to the AP never establishes. The log shows (167 occurrences):

Logger: custom_components.open_epaper_link.coordinator
Source: custom_components/open_epaper_link/coordinator.py:361
Level: ERROR
Count: 167
Message: WebSocket connection error: Cannot connect to host 192.168.188.125:80 ssl:default [Connect call failed ('192.168.188.125', 80)]

Because the WebSocket never connects, _handle_system_message in coordinator.py is never invoked, so self._ap_data stays empty and every AP-status sensor returns None from its value_fn.

Diagnosis

The AP itself is healthy and reachable:

  • HTTP requests to http://192.168.188.125/get_db succeed (tag sensors are populated via this endpoint in async_load_all_tags).
  • HTTP request to http://192.168.188.125/sysinfo succeeds (verified via wget from the HA host).
  • Manual WebSocket upgrade to ws://192.168.188.125/ws succeeds (verified via curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" ... from the HA host — returns HTTP/1.1 101 Switching Protocols).
  • The AP was physically rebooted during diagnosis with no improvement.

So the network path is fine; the failure is inside the integration / HA runtime.

Instrumented debugging (adding _LOGGER.warning statements to async_setup_entry, async_start_websocket, _websocket_handler, and the start_websocket callback in __init__.py) revealed this execution trace on HA startup:

19:58:04 [OEPL-DEBUG] platforms forwarded, deciding websocket start
19:58:04 [OEPL-DEBUG] hass.is_running=False, registering EVENT_HOMEASSISTANT_STARTED listener
19:58:19 [OEPL-DEBUG] start_websocket callback firing, hub=<...Hub object at 0x...>
19:58:19 [OEPL-DEBUG] about to call hub.async_start_websocket()
19:58:19 [OEPL-DEBUG] hub.async_start_websocket() returned True

Observations:

  • hass.is_running is False during setup, so the integration registers a listener for EVENT_HOMEASSISTANT_STARTED. That listener fires ~13 s later and calls await hub.async_start_websocket().
  • async_start_websocket() returns True (meaning self.online flipped to True within the 60 s CONNECTION_TIMEOUT window).
  • But _LOGGER.warning("[OEPL-DEBUG-WS] Attempting ws_connect ...") placed at the very top of the while loop inside _websocket_handler (the coroutine spawned by async_start_websocket via hass.async_create_task) never appears in the log. Neither does the downstream _LOGGER.debug("Connected to websocket at %s", ws_url) nor any WebSocket connection error.

That combination is contradictory: async_start_websocket returns True (which only happens when self.online becomes True), but _websocket_handler — the only place that sets self.online = True — apparently never executes its first line. The instrumented coordinator.py was verified to be on disk (matching MD5 with the edited local copy), __pycache__ was purged, and HA was fully restarted between attempts. The behavior persisted across four full HA restarts.

This suggests the WebSocket task is either silently dropped by the HA task scheduler, blocked before entering _websocket_handler, or there is some caching layer in the HA Python runtime that the author couldn't penetrate within the scope of this investigation.

Impact

  • All AP-diagnostic sensors unusable: sensor.openepaperlink_ap_status, …_laufstatus, …_betriebszeit, …_tag_anzahl, …_ip_adresse, …_wlan_ssid, …_wlan_signalstarke_rssi, …_freier_heap, …_systemzeit, …_tags_mit_schwachem_akku, …_tags_mit_zeituberschreitung, …_datenbankgrosse, …_littlefs_frei, …_freier_psram.
  • Tag-side sensors (battery, last_seen, temperature, LQI, RSSI, pending_updates, …) are unaffected because they are hydrated from the HTTP /get_db endpoint in async_load_all_tags.
  • drawcustom actions still work (uploaded over HTTP), so end-user automations keep functioning — but any automation that relied on AP-status sensors (e.g. a watchdog alerting when the AP itself goes offline) cannot use the integration's own AP sensors and must derive AP-health indirectly (e.g. from tag last_seen freshness).

Additional Context

  • Confirmed via ha_get_integration that the config entry state is loaded with disabled_by=null, reason=null, no error_reason_translation_key — the failure is silent from HA's perspective.
  • Tried the usual remediation steps with no success:
    1. Reload integration via disable → enable (multiple times).
    2. Completely remove the config entry and re-add it (fresh entry_id, devices recreated with identical device_ids thanks to stable MAC-based identifiers).
    3. Physically reboot the AP.
    4. Remove a ghost tag from the blacklist in the integration options.
    5. Four full HA restarts with __pycache__ purged between attempts.
  • The HA deprecation log also flags three additional upcoming-breakage sites in the integration (mentioned here for completeness, separate from the main bug):
    • device_registry.async_get_device deprecated (coordinator.py:733, util.py:172, text.py:227) — stops working in HA 2027.8.
    • device_registry.devices used as a mapping (util.py:172) — stops working in HA 2027.9.
    • Entity IDs set with wrong domain open_epaper_link.<mac>_<suffix> instead of sensor.<mac>_<suffix> (55×) — stops working in HA 2027.5.
  • The last commit touching custom_components/open_epaper_link/__init__.py on main is from March 8, 2026.

Related

Activity

  1. changed the title [-]AP status sensors stay `unknown` on HA 2026.9 — `storage.async_remove_store` removed, WebSocket never connects[/-] [+]AP status sensors stay `unknown` on HA 2026.9 — WebSocket to AP never establishes[/+] on Sep 29, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions