{"id":21437,"library":"home-assistant-intents","title":"Home Assistant Intents","description":"Home Assistant Intents is a community-maintained repository and Python package that provides structured intents (language-specific phrases mapped to actions) for the Home Assistant voice assistant. The package is versioned with a calendar-based scheme (2026.3.24) and releases are tied to the intents repository updates, typically weekly or on-demand. It requires Python >=3.9.","status":"active","version":"2026.3.24","language":"python","source_language":"en","source_url":"https://github.com/home-assistant/intents","tags":["home-assistant","voice-assistant","intents","natural-language-processing"],"install":[{"cmd":"pip install home-assistant-intents","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"The package is installed as home-assistant-intents but the import uses underscores. Importing 'intents' alone (which is a different library) will break.","wrong":"import intents","symbol":"load_intents","correct":"from home_assistant_intents import load_intents"},{"note":"","wrong":"","symbol":"get_sentence_details","correct":"from home_assistant_intents import get_sentence_details"}],"quickstart":{"code":"from home_assistant_intents import load_intents, get_sentence_details\n\n# Load intents for a language (e.g., English)\nintents = load_intents('en')\n# Get details of a specific sentence\nsentence = 'turn on the kitchen light'\ndetails = get_sentence_details(sentence, intents)\nprint(details)","lang":"python","description":"Load intents for English and retrieve details for a sentence. The intents structure is a dict mapping sentences to action data."},"warnings":[{"fix":"Import using underscores: from home_assistant_intents import ...","message":"The package is installed as 'home-assistant-intents' (with hyphens) but imported as 'home_assistant_intents' (with underscores). Using 'import home-assistant-intents' will fail with a SyntaxError.","severity":"gotcha","affected_versions":"all"},{"fix":"Access intents via the domain key: intents['light'] instead of iterating over intents directly.","message":"The load_intents function returns a dictionary keyed by domain (e.g., 'light', 'lock') rather than the flat list of sentences seen in earlier versions. Code relying on a different shape may break.","severity":"breaking","affected_versions":">=2025.0.0"},{"fix":"Replace get_sentence_details(sentence, intents) with intent_for_sentence(sentence, intents).","message":"The function 'get_sentence_details' is deprecated as of version 2026.2.0. Use 'intent_for_sentence' instead.","severity":"deprecated","affected_versions":">=2026.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import home_assistant_intents (underscores) after pip installing home-assistant-intents (hyphens).","cause":"Trying to import with hyphens in the module name, but Python requires underscores.","error":"ModuleNotFoundError: No module named 'home-assistant-intents'"},{"fix":"Use a full locale code like 'en-US' or 'en-GB', or check available locales via home_assistant_intents.get_locales().","cause":"The load_intents function expects the locale code with region if available, e.g., 'en-US' or 'en-GB'. Bare 'en' may not be present if only regional variants are installed.","error":"KeyError: 'en' when calling load_intents('en')"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}