Homeassistant wasn’t my first love (but will probably be my last). In previous life I have been recording my energy consumption in Emoncms. I was hoping that some bright light by now would have managed to create a script allowing to import historical data into Homeassistant, but either I am the only person looking for this or it is too hard to do.
Would be awesome if this gets added to Homeassistant!
been lots of attempts and scripts around to get external or other history data into energy dash. A generic ’ convert data to energy aggregate’ would maybe a difficult one and resource intensive for larger data sets. Still would love to see some helper stuff if not fully automated.
I have to manually read the meters in my flat, there are 4 for water, 1 for electric and 7 for heatings, as the flat is rented I am not able to have those values automatically inside HA, so i need to input them manually and cannot do this always immediately after reading. So I’d welcome also a way to (manually) input historic data to HA to keep track of my consumption. Maybe it could be done by an own integration which has more features like statistics and so, but at least the ability to input values for a specific date would be a good step.
I’d like to add this would be great for any state, not specifically energy. As others have mentioned elsewhere, water readings would be a good example.
Simply being able to say "at <x timestamp>, state was <y>" and recording that into the history as if it was recorded at that time like a typical sensor’s state, would be fantastic.
I can see this being tricky given how in the database, it appears any state update has a timestamp and reference to the previous update(by its id). Inserting one at an arbitrary time point would require finding the previous, and potentially, next state update on the time scale, and updating the references in there; not just inserting one database record. That’s not to mention dealing with any derived sensors, statistics…
I guess I can see why this isn’t a feature (yet?)…
It should be more usable if the history loader could be more generic. I would be more happy, if the historic loader could produce a sample csv template (based on the data sequence (what the integration collects and logs)) or even a csv dump of the current data set.
Then it would be easy to convert the existing data set matching to the example csv format, then load it (ie: a kind of journal replay of the missed collections)
Frenck is one of the developers of HA.
I have not yet tried to insert historic data, but O have used other service calls, like remove all orphaned devices.
@picassoruiz, @jgclark, @boti, @Tommy8884, @MichD
I created a script that can import historical data for the Dutch energy provider Eneco with their Toon thermostat.
The script should be easily adaptable for other providers that use a different export format. The processing logic to change the statistics stays the same.