Add card to dashboard view
dashboards_add_card_to_viewAppend a Lovelace card to a specific view in a Home Assistant dashboard, then save the whole config. Use for masonry or panel views, not sections.
Instructions
Append a card to one view's cards list and save the whole dashboard.
Reads the dashboard via dashboards_get_dashboard_config, appends
card_config to views[view_index]["cards"] (creating that key if
absent), and writes the whole dashboard back with
dashboards_save_dashboard_config — every other view and card is
round-tripped unchanged.
Use when: adding a card to a masonry/panel view.
Not for: a type: sections view — there, cards in view.cards render
only in edit mode; use dashboards_add_card_to_section instead.
Returns: {"status": "saved", "url_path": ...} from the underlying
save.
Errors: raises ValueError when view_index is out of range for the
dashboard's view count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url_path | Yes | Dashboard url_path (not a view path), from dashboards_list_dashboards. | |
| view_index | Yes | Zero-based index of the target view within the dashboard's 'views' list. | |
| card_config | Yes | Lovelace card config, e.g. {'type': 'entities', 'entities': ['light.living_room']}. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||