Remove card from dashboard section
dashboards_remove_card_from_sectionRemove a card from a Home Assistant sections dashboard view by section and card index. Pass a config hash to avoid deleting a shifted card when data is stale.
Instructions
Delete one card from a section of a type: sections view.
Resolves the view and section via _load_view/_require_section,
pops the card at card_index from that section's cards list, and
saves the whole dashboard back. card_index is a position, not a
stable id — repeating this call with the same section_index/
card_index after a first successful removal deletes whatever card
has shifted into that position next, not a no-op, unless
expected_config_hash is also passed and now points at the pre-removal
hash, in which case the repeat is rejected with config_changed
instead of deleting the wrong card.
Use when: removing a card that's no longer wanted on a sections view.
Pass expected_config_hash whenever section_index/card_index came
from an earlier read that might now be stale.
Returns: {status: "removed", url_path, view_index, view_title, section_index, card_index, removed_card, cards_in_section, config_hash} — removed_card can be passed back to
dashboards_add_card_to_section to restore it; config_hash is
re-read from HA after the save, ready to chain into the next call's
expected_config_hash.
Errors: raises ValueError when the view/section/card can't be
resolved (bad index/path). Returns {"error": "config_changed", "expected_config_hash", "current_config_hash", "action"} without
saving when expected_config_hash doesn't match.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url_path | Yes | Dashboard url_path, or a view path in the default dashboard (e.g. 'living-room'). | |
| card_index | Yes | Zero-based card index within the section, from dashboards_get_view_sections/inspection. | |
| view_index | No | Zero-based view index; needed only when url_path names a dashboard rather than a view path. | |
| section_index | Yes | Zero-based section index, from dashboards_get_view_sections. | |
| expected_config_hash | No | Optional guard: the config_hash from a recent dashboards_get_view_sections or section-tool response. If the dashboard's current hash differs, this call returns 'config_changed' and removes nothing — this is what makes a repeated call with a now-stale hash safe instead of deleting whatever shifted into that position. Omit to skip the check (today's behaviour). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||