Set Integration
ha_set_integrationAdd Home Assistant integrations or manage config entries: enable, disable, update options, reconfigure connection settings, or set log levels.
Instructions
Manage an integration (config entry): enable/disable, add, update options, or reconfigure.
Modes (pick one):
Enable/disable: entry_id + enabled.
Add integration: domain (+ config) — drives the domain's config flow, including menus and multi-step forms.
Update options: entry_id + config — drives the entry's options flow (what the "Configure" button does in the HA UI).
Reconfigure: entry_id + reconfigure=True + config — connection settings such as host, port, credentials. Repeat with the token the preflight returns as confirm_token to apply.
Log level: log_level + domain (or entry_id) — sets how much the integration logs; read it back with ha_get_integration's log_level.
WHEN NOT TO USE:
Helpers (template, group, utility_meter, ...): use ha_config_set_helper.
otpis the user's to set up in the HA UI: its secret is a credential enrolled in an authenticator app; do not create it.Config subentries: use ha_config_set_helper(helper_type='config_subentry').
Removing an entry: use ha_remove_helpers_integrations.
Use ha_get_integration() to find entry IDs, and ha_get_integration(entry_id=..., include_schema=True) to inspect the options fields before an update. Its supports_reconfigure field tells you whether an entry qualifies for reconfigure=True.
Caveats: adding an integration runs its config flow exactly as the HA UI would (may pair devices, scan the network, create entities). Flows requiring a browser step (OAuth) or an asynchronous provider step error out at that step instead of completing. Reconfigure edits the settings a live integration connects with: a wrong host or credential takes it offline, and there is no automatic rollback — the returned rollback metadata describes repeating the official flow by hand with the previous values, which this tool cannot read back. The preflight does not validate config keys against the integration's form; wrong field names surface on the confirm call.
EXAMPLES:
Add: ha_set_integration(domain="workday", config={"name": "Workday"})
Update options: ha_set_integration(entry_id="abc123", config={"scan_interval": 30})
Reconfigure preflight: ha_set_integration(entry_id="abc123", reconfigure=True, config={"host": "10.0.0.5"}), then repeat adding confirm_token="sha256:..."
Debug logging: ha_set_integration(domain="zha", log_level="DEBUG"), then log_level="DEFAULT" to stop
If a Claude Desktop user gets a 4-minute timeout with no result on this call, read the target back before repeating it, and tell them to wait a few seconds before clicking the manual-approve button, as clicking it too quickly is known to cause hangs in Claude Desktop. This workaround is specific to Claude Desktop.
integration config entry enable disable add options reconfigure log level debug logging
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | Flow form data. Updating an existing entry — options or reconfigure — is a patch: a field you omit keeps its current value, and a field set to null is cleared where the integration's schema allows that field to be empty. Multi-step flows consume keys per step. A field two steps declare gets your one value both times; pass step_values={'<step_id>': {'<field>': <value>}} to give a step its own value, or to leave the field out of that step; a LIST of those objects supplies one per encounter when the flow presents a step more than once. Menu steps take 'next_step_id' — a string, or a list of successive selections for flows that present more than one menu (e.g. a menu revisited after each branch, ending in a finish option). The step's data_schema is returned on validation errors so field names can be corrected. | |
| domain | No | Integration domain to add (e.g. 'workday', 'local_calendar'). | |
| enabled | No | True to enable, False to disable the entry. Mutually exclusive with 'domain' and 'config'. | |
| entry_id | No | Config entry ID of an existing integration. | |
| log_level | No | Set the integration's log level, like the integration page's Enable/Disable debug logging: pass the integration with 'domain' (no config flow runs) or 'entry_id', and nothing else. Lasts through the next Home Assistant restart. DEFAULT clears the override: the integration then logs at the inherited default level, and a level set for it in configuration.yaml returns only after a restart. | |
| reconfigure | No | Use the existing config entry's official reconfigure flow (its connection settings) instead of its options flow. Without confirm_token this is a read-only preflight that returns one. | |
| expected_mac | No | Requires reconfigure=True. MAC or IEEE the entry's device must still report. | |
| confirm_token | No | Requires reconfigure=True. Any token still matching the entry's current state and the same requested config is accepted, so a token stays valid while nothing moves. | |
| expected_device_id | No | Requires reconfigure=True. Device registry ID the entry must still own, before and after the change. | |
| expected_unique_id | No | Requires reconfigure=True, AND the ha_mcp_tools custom component: Home Assistant does not expose a config entry's unique_id over its API. Without the component this is rejected — anchor on expected_device_id, expected_mac or expected_entity_ids instead. | |
| expected_entity_ids | No | Requires reconfigure=True. Exact entity IDs that must remain associated with the entry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||