Skip to content

Fix Gateway hilo_id and GraphQL device subscription updates - #499

Merged
ic-dev21 merged 4 commits into
dvd-dev:mainfrom
Moustachauve:fix/gateway-location-graphql-status
Nov 19, 2026
Merged

ic-dev21 merged 4 commits into
dvd-dev:mainfrom
Moustachauve:fix/gateway-location-graphql-status

Conversation

@Moustachauve

@Moustachauve Moustachauve commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Home Assistant relies on device Disconnected updates and hilo_id callbacks from GraphQL to mark entities unavailable when devices or the Zigbee Gateway go offline, but missing Gateway identity fields and silent reconnect resyncs prevented those updates from reaching HiloDevice instances.

Populate hilo_id on the Gateway device, request its missing identity fields in onAnyDeviceUpdated, map onlineStatus in _build_gateway, forward updated hilo_ids to callbacks after SSE reconnect resyncs, and remove the obsolete deviceId == 0 Gateway fallback now that Gateway readings match by hilo_id.

Home Assistant relies on device `Disconnected` updates and `hilo_id` callbacks from GraphQL to mark entities unavailable when devices or the Zigbee Gateway go offline, but several schema and mapping bugs prevented those updates from reaching `HiloDevice` instances.

Populate `hilo_id` on the Gateway device, request the missing Gateway identity fields in device subscriptions, and align `onAnyLocationUpdated` and reconnect resyncs with Hilo's Digital-Twin schema so Gateway and device connection state changes reliably update device availability and notify subscription callbacks.
Keep this change small and focused on Gateway identity and `onAnyDeviceUpdated` / reconnect-resync availability updates by deferring `onAnyLocationUpdated` schema changes to a separate PR, preserving `connectionStatus == "DISCONNECTED"` matching, and removing defensive type-narrowing branches and redundant test cases.
@Moustachauve Moustachauve changed the title Fix Gateway hilo_id and GraphQL connectionStatus subscription updates Fix Gateway hilo_id and GraphQL device subscription updates Nov 16, 2026
Deduplicate the case-insensitive Gateway `deviceType` check shared by `call_get_location_query` and `_handle_query_result` so the two call sites cannot drift apart.
@Moustachauve
Moustachauve marked this pull request as ready for review November 16, 2026 06:07
Remove the obsolete device_id == 0 Gateway fallback in Devices now that the Gateway populates hilo_id directly, revert unrelated Smart Meter and Gateway id-mutation changes to main, and drop the corresponding redundant tests.
@ic-dev21
ic-dev21 merged commit 66709ac into dvd-dev:main Nov 19, 2026
3 checks passed
@Moustachauve
Moustachauve deleted the fix/gateway-location-graphql-status branch November 19, 2026 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants