Skip to content

Conversation

@smarthome-w
Copy link

In Home Assistant OS installation it is difficult to modify scheduler.storage file and apply changes. HA restart causes saving current state to file and all previously made changes are lost.

reload_storage service just run store.async_load() method and synchronize data from disk and in memory.

Service can be run from scripts, automations accordingly to the needs.

This PR is caused by scheduler-card component instability. It also provides ability to making repetitive changes using text editor.

Some formatting changes are also included.

@smarthome-w smarthome-w changed the title Add reload_storage service to be able to manually edit scheduler.storage Add reload_storage, delete_schedule_by_id services to be able to manually fix scheduler.storage Nov 17, 2025
@smarthome-w
Copy link
Author

  • I've added logic to avoid duplicates during schedule reload.
  • Additional service delete_schedule_by_id provides ability to remove service by it's id.
  • All schedules are now readable because in case of corrupted data default values are set and schedule is marked as [BROKEN] and can be deleted by new service delete_schedule_by_id.

@nielsfaber
Copy link
Owner

Thank you for your work!
I do like the idea of adding a reload_storage service.
I don't like the idea of adding a delete_schedule_by_id service.
Scheduler already includes a scheduler.remove service. Perhaps the service can be extended to accept both entity_id or schedule id, but it seems redundant as for each schedule an entity is created. In HA the schedule id is not directly visible, so your proposal only makes sense when you're messing with the storage file. However, in this file the entity_id is also displayed, so I'm not really seeing the added value.

Perhaps you could split your PR so we can treat these both additions separately?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants