home-assistant/core · error · ConfigEntryAuthFailed

Invalid MAC address

Error message

Invalid MAC address

What it means

Raised as ConfigEntryAuthFailed in the Aprilaire ready callback when the MAC address reported by the thermostat (formatted and compared to entry.unique_id) does not match the unique_id the config entry was created with. Aprilaire pins each config entry to one physical device; a mismatch means the connection reached a different (or replaced) thermostat, so setup is aborted and the entry is pushed into an error/reauth state.

Source

Thrown at homeassistant/components/aprilaire/__init__.py:38

_LOGGER = logging.getLogger(__name__)


async def async_setup_entry(hass: HomeAssistant, entry: AprilaireConfigEntry) -> bool:
    """Set up a config entry for Aprilaire."""

    host = entry.data[CONF_HOST]
    port = entry.data[CONF_PORT]

    coordinator = AprilaireCoordinator(hass, entry, host, port)
    await coordinator.start_listen()

    async def ready_callback(ready: bool) -> None:
        if ready:
            mac_address = format_mac(coordinator.data[Attribute.MAC_ADDRESS])

            if mac_address != entry.unique_id:
                raise ConfigEntryAuthFailed("Invalid MAC address")

            entry.runtime_data = coordinator
            entry.async_on_unload(coordinator.stop_listen)

            await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

            async def _async_close(_: Event) -> None:
                coordinator.stop_listen()

            entry.async_on_unload(
                hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_close)
            )
        else:
            _LOGGER.error("Failed to wait for ready")

            coordinator.stop_listen()

            raise ConfigEntryNotReady

View on GitHub (pinned to 58a3fdb3ea)

Solutions

  1. Verify the host in the config entry actually resolves to the intended thermostat (ping it, check the device's own network page).
  2. Give the thermostat a DHCP reservation or static IP so the entry's host always reaches the same device.
  3. If the hardware was replaced, delete the old config entry and run the Aprilaire config flow again so the entry's unique_id matches the new MAC.
  4. Confirm no two Aprilaire devices share the configured address.
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: The coordinator connects to the host in entry.data[CONF_HOST] and the device's Attribute.MAC_ADDRESS formats to a MAC different from entry.unique_id. Typical causes: the thermostat's IP changed and the host now points at another Aprilaire device on the network, or the thermostat hardware was replaced.

Common situations: DHCP reassigned the thermostat's IP to another device after a router restart; user replaced an old Aprilaire unit with a new one and reuses the old config entry; static-IP misconfiguration; ARP cache pointing the hostname at the wrong NIC.

Related errors


AI-assisted analysis of home-assistant/core@58a3fdb3ea (2026-08-14). Data as JSON: /api/errors/fe0766d7ef6ff67a. Report an issue: GitHub.