Repository navigation
Conversation
The Hilo cloud returns a null identifier for some devices (observed
for the gateway since ~2026-09-10). Every entity constructor builds
unique_ids as f"{device.identifier.lower()}-..." and would crash with
AttributeError, killing the whole hilo sensor platform at boot.
Coerce None to the empty string after devices.update() in async_init:
the empty string is what the cloud used to return, so existing
device-registry entries and entity unique_ids keep matching. Companion
guard in python-hilo (dvd-dev/python-hilo#462) covers the library
layer for older payloads.
|
I'll edit my original answer to be more precise: Thanks for the detailed write-up. This comes from the versions you’re running, not from a current bug. On hilo 2026.8.3 / python-hilo 2026.3.5, the gateway identifier comes from the REST Gateways/Info call (dsn field). That path has been deprecated, and a null dsn there gives exactly the traceback you posted. Since hilo 2026.9.1 (python-hilo ≥ 2026.9.1), the REST call is no longer used: the gateway is built from the initial GraphQL query, with its MAC address (from hiloId) as the identifier. I’ve tested fresh installs and restarts on current releases and can’t reproduce this. I won’t merge this PR as-is, for two reasons: On main, the gateway is created in graphql_helper.async_init(), which runs after the loop this PR adds. So the coercion never reaches the gateway. Please upgrade to 2026.10.1. Since your existing entities are keyed on an empty identifier (-defi_hilo etc.), they may not migrate automatically. If you end up with duplicates or orphaned entities after upgrading, please open an issue and we’ll handle that case properly. |
|
Merci — you're right on both counts, and thanks for the precise explanation of the ordering (graphql_helper.async_init runs after the loop) and the '' coercion blocking the DSN→MAC migration. We took your suggested path today: upgraded to hilo 2026.10.1 (+ python-hilo 2026.9.1). Our existing entities were indeed keyed on the empty identifier ( |
Problem
Since ~2026-09-10, the Hilo cloud returns a null serial/identifier for the Hilo gateway in the device payloads.
HiloDevice.update()storesidentifier=None, and every entity constructor in this integration builds unique ids asf"{device.identifier.lower()}-...". OnNonethis raises:Because the gateway entities are constructed first, the entire sensor platform fails: every Hilo sensor (challenge, rates, reward, weather, meter power) goes unavailable. Additionally,
check_tarif()then can't findsensor.hilo_energy_total_lowand warns hourly.Reproduced on every boot from 2026-09-10 to 2026-10-09 (14 boots), hilo 2026.8.3 / python-hilo 2026.3.5. A user in #1044 hit a neighbouring breakage after the 2026.9.3 release.
The same class of hole exists in
_build_gateway_dict(python-hilo), which emitsidentifier: Nonewhen the MAC can't be extracted fromhiloId.Fix
After
devices.update()inHilo.async_init, coerceidentifier is Noneto the empty string. The empty string is what the cloud used to return, so existing device-registry entries and entity unique_ids (e.g.-defi_hilo) keep matching — no duplicate devices or entities are created.Companion guard at the library layer: dvd-dev/python-hilo#462.
Testing