{"record":{"id":"fe0766d7ef6ff67a","repo":"home-assistant/core","slug":"invalid-mac-address","errorCode":null,"errorMessage":"Invalid MAC address","messagePattern":"Invalid MAC address","errorType":"exception","errorClass":"ConfigEntryAuthFailed","httpStatus":null,"severity":"error","filePath":"homeassistant/components/aprilaire/__init__.py","lineNumber":38,"sourceCode":"\n_LOGGER = logging.getLogger(__name__)\n\n\nasync def async_setup_entry(hass: HomeAssistant, entry: AprilaireConfigEntry) -> bool:\n    \"\"\"Set up a config entry for Aprilaire.\"\"\"\n\n    host = entry.data[CONF_HOST]\n    port = entry.data[CONF_PORT]\n\n    coordinator = AprilaireCoordinator(hass, entry, host, port)\n    await coordinator.start_listen()\n\n    async def ready_callback(ready: bool) -> None:\n        if ready:\n            mac_address = format_mac(coordinator.data[Attribute.MAC_ADDRESS])\n\n            if mac_address != entry.unique_id:\n                raise ConfigEntryAuthFailed(\"Invalid MAC address\")\n\n            entry.runtime_data = coordinator\n            entry.async_on_unload(coordinator.stop_listen)\n\n            await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)\n\n            async def _async_close(_: Event) -> None:\n                coordinator.stop_listen()\n\n            entry.async_on_unload(\n                hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_close)\n            )\n        else:\n            _LOGGER.error(\"Failed to wait for ready\")\n\n            coordinator.stop_listen()\n\n            raise ConfigEntryNotReady","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/aprilaire/__init__.py#L20-L56","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the host in the config entry actually resolves to the intended thermostat (ping it, check the device's own network page).","Give the thermostat a DHCP reservation or static IP so the entry's host always reaches the same device.","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.","Confirm no two Aprilaire devices share the configured address."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve a static IP / DHCP reservation for each Aprilaire thermostat.","After replacing a thermostat, delete the old config entry and rediscover instead of reusing it.","If this error recurs, verify the configured host resolves to the intended device MAC."],"tags":["home-assistant","aprilaire","mac-address","dhcp","device-identity"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}