Skip to content

Expose automation category in ha_config_set_automation and ha_config_get_automation #702

Description

@sbericsson

Feature Request

Summary

The ha_config_set_automation and ha_config_get_automation tools do not expose
the category field for automations. Attempting to pass category in the config
payload returns a validation error:

  Message malformed: extra keys not allowed @ data['category']

Current behavior

  • ha_config_get_automation returns the automation config but omits the category
    field even when one is set in the UI.
  • ha_config_set_automation rejects configs that include a category key.

Expected behavior

  • ha_config_get_automation should include the category field in its response
    when set.
  • ha_config_set_automation should accept an optional category field and persist
    it to the entity registry.

Why this matters

When managing automations programmatically (e.g., via an AI assistant), there's no
way to assign categories without dropping into the HA UI manually. Categories are a
first-class organizational feature in the Automations UI and should be manageable
through the same API surface as the rest of the automation config.

Workaround

Currently requires manual UI interaction:
Settings → Automations & Scenes → select automations → ⋮ menu → "Add to category".

Notes

The category for automations is stored in the entity registry (not the automation
YAML config), so this may require the tool to make a separate entity_registry/update
call after saving the automation config. The relevant HA WebSocket API is
entity_registry/update with categories: {"automation.automations": "<category_id>"}.

Sources:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions