I’ve moved my main DB over to MariaDB, and I wanted to edit an incorrect temperature reading.
In the main interface you can edit some stats by going to Home / Dev Tools / Statistics, and then clicking on the ski ramp icon on the right - but not all statistics.
To fix my one odd measurement I searched for a simple answer and couldn’t find one, so here is mine for anyone else.
Note, this assumes you’re using MariaDB and it’s working fine.
Before playing with the database I strongly advising doing a full backup.
- Install phpMyadmin admin & configure as per the many other use guides (Home Assistant Community Add-on: phpMyAdmin)
- Go to phpMyadmin and click on homeassistant/statistics_meta - This will show you your entities, and their related tag used in the database.
- Click on Search - in the menu bar at the top
- Enter the entity ID you need to fix (you can get this from developertools / states) in ‘statistics_id’
- Look for the id in the results - you need this for the next step
- Go to the statistics part of the database (using menu on the left)
- Click on search (menu at the top)
- Enter the ID into ‘metadata_id’ you found in step 5, hit ‘Go’.
- You’ll now have all entries in the database for that entity
- Click edit next to the incorrect entry + enter correct details
- Click ‘Go’ - you should be sorted.
I hope this helps someone else