Change data source for Energy dashboard

If you haven’t already, install SQLite Web - Home Assistant Community Add-on

!!! make a backup !!! you can spoil not only the data from this sensor, but also from others.

Find the id of your old and new sensor:

change old id to new

UPDATE statistics
SET metadata_id = newId
WHERE metadata_id = oldId

After this change, you will have a rising total from the old data and suddenly counting from zero. Probably on the graphs this will be shown as a big negative bar.
Find that bar specifically of which day it is.
Go to developer-tools/statistics and find your sensor and click Adjust sum.

find the negative value and change it to 0

3 Likes