{"record":{"id":"c907871c807f70b5","repo":"home-assistant/core","slug":"invalid-directive","errorCode":"INVALID_DIRECTIVE","errorMessage":"The unlock directive is not supported for the following locales: {config.locale}","messagePattern":"The unlock directive is not supported for the following locales: (.+?)","errorType":"exception","errorClass":"AlexaInvalidDirectiveError","httpStatus":null,"severity":"error","filePath":"homeassistant/components/alexa/handlers.py","lineNumber":552,"sourceCode":"        \"en-GB\",\n        \"en-IN\",\n        \"en-US\",\n        \"es-ES\",\n        \"es-MX\",\n        \"es-US\",\n        \"fr-CA\",\n        \"fr-FR\",\n        \"hi-IN\",\n        \"it-IT\",\n        \"ja-JP\",\n        \"nl-NL\",\n        \"pt-BR\",\n    }:\n        msg = (\n            \"The unlock directive is not supported for the following locales:\"\n            f\" {config.locale}\"\n        )\n        raise AlexaInvalidDirectiveError(msg)\n\n    entity = directive.entity\n    await hass.services.async_call(\n        entity.domain,\n        SERVICE_UNLOCK,\n        {ATTR_ENTITY_ID: entity.entity_id},\n        blocking=False,\n        context=context,\n    )\n\n    response = directive.response()\n    response.add_context_property(\n        {\"namespace\": \"Alexa.LockController\", \"name\": \"lockState\", \"value\": \"UNLOCKED\"}\n    )\n\n    return response\n\n","sourceCodeStart":534,"sourceCodeEnd":570,"githubUrl":"https://github.com/home-assistant/core/blob/58a3fdb3ea0538617f0a07efcfba6294de64fd59/homeassistant/components/alexa/handlers.py#L534-L570","documentation":"Home Assistant's Alexa smart home integration only enables the Alexa.UnlockController directive in a whitelist of locales (en-US, de-DE, fr-FR, etc., see the set in handlers.py). When an Unlock directive arrives and hass.config.locale is not in that set, the handler raises AlexaInvalidDirectiveError, which is serialized back to Alexa as an INVALID_DIRECTIVE error response.","triggerScenarios":"User says 'Alexa, unlock the door' while the Home Assistant instance (or the Alexa communications/configured language) resolves to a locale outside the supported set. The unlock handler is reached, the locale check fails, and the exception is raised.","commonSituations":"HA instance language set to a locale Amazon has not cleared for unlock (e.g. es-MX, ko-KR), or a mismatch between the Alexa device language and HA's configured language after adding locks. Often appears right after exposing a lock entity to Alexa via the cloud/alexa integration.","solutions":["Switch the Home Assistant instance (or the Alexa device) language to a supported locale such as en-US, en-GB, de-DE, fr-FR, fr-CA, hi-IN, it-IT, ja-JP, nl-NL, or pt-BR.","If the locale cannot be changed, remove the lock from Alexa-exposed entities so the unlock directive is never routed to HA.","Verify you are using the official Alexa/SmartThings-style cloud integration, not a stale custom skill with different locale handling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"SUPPORTED_UNLOCK_LOCALES = {\n    'en-US', 'en-GB', 'en-AU', 'en-CA', 'en-IN', 'de-DE',\n    'fr-CA', 'fr-FR', 'hi-IN', 'it-IT', 'ja-JP', 'nl-NL', 'pt-BR',\n}\nif hass.config.language not in SUPPORTED_UNLOCK_LOCALES:\n    # do not expose unlock; fall back to lock-only capability\n    ...","typeGuard":"def unlock_supported(hass) -> bool:\n    return hass.config.language in {\n        'en-US', 'en-GB', 'en-AU', 'en-CA', 'en-IN', 'de-DE',\n        'fr-CA', 'fr-FR', 'hi-IN', 'it-IT', 'ja-JP', 'nl-NL', 'pt-BR',\n    }","tryCatchPattern":"try:\n    await handle_directive(directive)\nexcept AlexaInvalidDirectiveError:\n    # Alexa already receives INVALID_DIRECTIVE; log locale for diagnosis\n    _LOGGER.warning('Unlock rejected for locale %s', hass.config.language)","preventionTips":["Match HA instance language to an unlock-supported locale before exposing locks.","Hide lock entities from Alexa in unsupported locales so unlock directives never arrive.","Track the supported-locale set in handlers.py when upgrading HA."],"tags":["alexa","smart-home","locale","lock","invalid-directive"],"backgroundTag":null,"analyzedSha":"58a3fdb3ea0538617f0a07efcfba6294de64fd59","analyzedAt":"2026-08-14T20:54:38.818Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}