Accessing Backup Options
The backup menu is located in the Items configuration page:- Right-click the plasmoid widget
- Select Configure Home Assistant…
- Navigate to the Items tab
- Click the menu button (≡) at the bottom right (
ConfigItems.qml:38-41)
Exporting Configurations
.hapi (Home Assistant Plasma Items)ConfigItems.qml:89)- Entity IDs
- Custom names and icons
- Display attribute settings
- Click and scroll actions
- Notification preferences
The Export button is only enabled when you have at least one entity configured (
ConfigItems.qml:62).Importing Configurations
Import Process
When you import a configuration (ConfigItems.qml:52-54):
- The backup file is read
- Current entities are cleared
- Entities from the backup are loaded
- Configuration is automatically saved
The .hapi File Format
Backup files use the.hapi extension (Home Assistant Plasma Items) and contain JSON data.
File Structure
The file contains a JSON array of entity configurations:Data Format
The JSON format (ConfigItems.qml:207):
- Null and undefined values are omitted
- Only defined properties are included
- Entity order is preserved
Auto-Backup Configuration
The plasmoid can automatically backup your configuration to a file every time settings are saved.How Auto-Backup Works
When auto-backup is configured (ConfigItems.qml:231-234):
- Every time you click Apply in the configuration dialog, the current entity configuration is written to the auto-backup file
- The backup file is automatically updated whenever you:
- Add a new entity
- Edit an entity
- Remove an entity
- Reorder entities
Auto-backup only triggers when you click Apply or OK in the configuration dialog. Changes are not backed up until explicitly saved.
Disabling Auto-Backup
To disable auto-backup:- Click the clear button (×) in the auto backup field (
ConfigItems.qml:77-81) - The auto-backup file path is cleared
- Click Apply
Use Cases
Migrating to a New System
- Export your configuration on the old system
- Copy the
.hapifile to the new system - Install the plasmoid on the new system
- Configure the Home Assistant connection
- Import the
.hapifile
Configuration Backup Before Changes
- Export your current configuration
- Make experimental changes
- If something goes wrong, Import the backup to restore
Sharing Configurations
- Export your configuration
- Share the
.hapifile with other users - They can Import it to replicate your setup
Regular Backups with Auto-Backup
- Configure Auto backup to a file in your documents folder
- Include that folder in your regular system backups
- Your plasmoid configuration is automatically backed up with your system
Data Storage
Entity configurations are stored in two places:- Plasmoid configuration: The
cfg_itemsproperty stores the current configuration (ConfigItems.qml:13) - Auto-backup file: Optional external file that mirrors the configuration
Configuration Persistence
- Entity configurations persist across Plasma restarts
- Configurations are stored in the plasmoid’s configuration file
- KDE Wallet stores access tokens separately (not included in backups)
Troubleshooting
Import Fails
- Verify the file is a valid
.hapifile - Check that the file contains valid JSON
- Ensure the file is not corrupted
Auto-Backup Not Working
- Verify you clicked Apply after configuring the auto-backup file
- Check that you have write permission to the backup location
- Ensure the file path is valid and the directory exists
Missing Entities After Import
- Verify entity IDs exist in your Home Assistant instance
- Check the Home Assistant connection in General settings
- Entities with invalid IDs will not function but will remain in the configuration
Next Steps
Adding Entities
Add new entities to your plasmoid
Entity Settings
Customize entity display and behavior
