Import old energy readings for use in energy dashboard

Just wanted to note for any interested developers it seems there is a way for an integration to add data in the past to history without changing the current state of entities. It can be done by using async_add_external_statistics:

There are currently two integrations in core making use of this if you’re looking for an example, Demo:

And tibber:

To be clear, this isn’t a solution to this FR. But if anyone is interested in building an integration to contribute to core or make available in HACS which does import of historical data I think it can be done using this API in core without the need to write a lot of custom SQL.

13 Likes