History Editor for Home Assistant

Edit, create and delete history records in Home Assistant from a dedicated panel in the UI.

History Editor is a custom component for Home Assistant that adds a new sidebar menu where you can view, modify and clean both state history records and statistics (short-term and long-term) for any entity. Access is restricted to administrators.


What it does

  • Entity selector: pick any entity in your instance.
  • Data table with state, attributes and timestamps for the last N records (up to 1000).
  • Edit records: update the state value, attributes, or timestamps (last_changed, last_updated).
  • Create records: add new historical entries at any point in the past.
  • Delete records: remove specific entries.
  • Statistics editing: view, edit and delete short-term (5-minute) and long-term (hourly) statistics records — which, in stock HA, can'”‘”‘t be modified from the UI.
  • Statistics recalculation: after editing the history, force a recalculation so statistics reflect the changes. By default it recomputes short-term first, then chains long-term off it.
  • Services exposed for automations and scripts: history_editor.get_records, update_record, delete_record, create_record, recalculate_statistics.

Use cases

  • Data correction: fix incorrect sensor readings or state values.
  • Gap filling: add data points missing from history after a connection outage or a downed sensor.
  • Testing: create sample historical data to test dashboards and automations.
  • Cleanup: remove duplicates or anomalies that distort charts and aggregates.
  • Migration: import historical data from other systems.
  • Statistics repair: correct or remove wrong statistics data that persists beyond the normal history retention period.

Installation

Via HACS as a custom repository: https://github.com/davefx/dfx-ha-history-editor (category “Integration”). After installing, add history_editor: to your configuration.yaml and restart.


Warning

This component modifies the Home Assistant database directly. Always back up before making changes. Changes are immediate and cannot be undone from within the component itself.


Status and licence

Source code at github.com/davefx/dfx-ha-history-editor. Licence: Apache 2.0. Not officially associated with or endorsed by Home Assistant.

Shares
Scroll to Top