Backend for the Drag And Drop Card — a Home Assistant integration that securely stores and serves drag‑and‑drop card configurations.
Repo:
Prosono/Drag-And-Drop-Card-Backend• License: MIT • Language: Python
- Persists UI configurations for the companion Drag And Drop Card.
- Exposes a simple backend inside Home Assistant so the card can save, load, and delete its layouts/configs.
- Syncs dashboard
packagespayloads to Home Assistant package YAML files. - Uses Home Assistant’s standards (config entries, services, storage helpers) so everything lives neatly within your HA setup.
- In Home Assistant, open HACS → Integrations → 3‑dot menu → Custom repositories.
- Add the repository:
https://github.com/Prosono/Drag-And-Drop-Card-Backendas type Integration. - Find Drag-And-Drop-Card Backend in HACS and click Download.
- Go into "Settings" then "Devices and Services" And Click "Add Integration"
- Search for "Drag And Drop Card Backend" and select it.
- Restart Home Assistant after the installation is complete.
- Copy the folder
custom_components/drag_and_drop_card_backendfrom this repo into your Home Assistant config directory at:config/custom_components/drag_and_drop_card_backend/. - Restart Home Assistant.
Your HA config directory is typically
~/.homeassistantor/config(if using HA OS / Supervised).
The backend is designed to be used by the front-end Drag And Drop Card. Typical flows:
- Save a layout from the card → backend persists it.
- Load a layout on dashboard render → backend returns it.
- Delete a layout → backend removes it.
When a saved dashboard payload includes packages, the backend writes enabled package YAML to:
/config/packages/ddc_<storage_key>_<package_slug>.yaml
Only packages where enabled is not false and yaml is not empty are written. Filenames use Home Assistant compatible single-underscore slugs because package names are derived from the filename. When packages are renamed, disabled, removed, or when a dashboard is deleted, matching generated ddc_*.yaml files are cleaned up. Older legacy ddc__*.yaml files are also detected and cleaned up automatically.
Home Assistant must have packages enabled in configuration.yaml, for example:
homeassistant:
packages: !include_dir_named packages!include_dir_merge_named packages is also supported by Home Assistant setups that prefer that style. The frontend can check package setup with:
GET /api/dragdrop_storage_package_status
The namespaced alias follows the same route pattern:
GET /api/drag_and_drop_card_backend_package_status
The integration is designed so that you do not have to do any manual operations for saving / retreiving saved dashboards.
custom_components/drag_and_drop_card_backend/
├── __init__.py
├── manifest.json
├── config_flow.py # UI-based setup
├── services.yaml # Service schemas (if present)
├── helpers/ # Storage / model helpers (if present)
└── ...
File list may vary by release, but the integration follows standard HA component conventions.
- Create a Home Assistant dev instance (e.g., with HA Container or a test HA OS VM).
- Mount/link the component to
/config/custom_components/drag_and_drop_card_backend. - Enable Advanced Mode in your HA user profile for extra dev tools.
- Watch the Logs (Settings → System → Logs) while reloading the integration.
ruff check .
ruff format .
mypy custom_components/drag_and_drop_card_backend- Follow semantic versioning.
- Use GitHub Releases and update
manifest.jsonversion accordingly.
Where are layouts stored?
Inside Home Assistant’s storage (e.g., .storage), handled by the integration. You normally don’t need to manage these files manually.
Where are generated packages stored?
In /config/packages using filenames that start with ddc_. These files are generated from dashboard payloads and are cleaned up by the backend when the source dashboard or package changes.
Can I back up the data?
Yes — use HA’s built-in Backups (Snapshots) to capture everything.
Do I need the front-end card?
This backend is meant to be paired with the Drag And Drop Card. On its own, it won’t render UI — it just stores and serves configs.
- Data is stored locally within your Home Assistant instance.
- No cloud sync is performed by the backend unless you add it yourself via HA add-ons or external automations.
MIT © Prosono
- Fork the repo & create a feature branch.
- Make your changes with docs/notes.
- Open a pull request describing the change and testing steps.
- Front-end card: Drag And Drop Card (pair this backend with the card component).
- This backend repo: https://github.com/Prosono/Drag-And-Drop-Card-Backend