ELI5: Energy Dashboard and importing energy usage data from file data sources?

All -

I’ve been hard at work migrating from a SmartThings environment for the last few weeks, in the middle of the migration HA introduces the new energy dashboard (Looks cool!) Apologies I’m not quite up to speed with a lot of core Home Assistant concepts so if I missed something obvious please feel free to point me to the manual I didn’t read yet. :slight_smile:

I have natural gas and electricity in my installation. I do not have monitors for either electricity or gas yet, but my energy company does allow me to download utilization for both electricity and natural gas. (Unfortunately it’s currently a manual download - it looks like it comes from some kind of web service but I have not been able to discuss how to automate collection of same yet…)

The data comes in two types - one which contains daily energy usage in 15 minute increments, (each entry has start, stop, KWh or CCF depending on the service) and one that has the same data in a digest form with a monthly rollup. I have CSV and XML formats available to choose from.

After reading how the dash works, It strikes me that I should be able to setup some kind of template sensor (based on file data) to read these files and therefore import my current energy utilization into the energy dashboard. I realize it won’t be real-time but it would be wonderful to have the historical data.

So Explain it like I’m 5, do I have the correct assumptions here and something like this should be possible until I install my own HEM / gas meters? Or am I misunderstanding how the platform works and trying to do so will only lead to pain and madness? :slight_smile: I feel like someone has probably already solved this or is working on it but my lack of vocabulary is making me miss the post…

Bonus points if you’ve already come up with a solution…

4 Likes

You’re definitely not the only one that wants something like this

I think the problem is Home Assistant relies on capturing sensor data in real time and then writing it to the recorder database, like an old school tape deck.

It appears currently the only way to get historical data in to a sensor after the fact is to manipulate the mysql recorder database itself, which is definitely beyond what I would know how to do. It does look like from the other thread though, others are working on a solution. Its a brand new integration and I’m sure development around it is definitely ongoing.

1 Like

There is 2 things in this topic, which is good to understand for anybody.

  1. sensor data capturing is real time. This is normal recorder and state capturing when state changes
  2. statistic data for the energy dash. This is calculated every hour for the past hour.

These 2 things are in separate tables. For me, the topic is to move the state data into statistics table. Seems theoretical doable, but has lots of challenges for me.
For @NathanCu , it is even more difficult as there is no real time state data in HA db. But on the other hand, if there is a way to just fill the statistics table for his data (requiring at least some entities to register data on) , the energy dash could work too with imported data. Just more work to realize.

1 Like

@checking12 have you had any luck with this? i,e, importing data to the static table?
I have my historical data in a file (and influx) but would rather to surface that to the energy dashboard.

I also need this way of importing data in Energy Dashboard, my Shelly EM3 keeps data in csv format for 1 year so definitely I want to see that information in my dashboard. Also because if you do a backup and restore of you HA installation the statistical energy info is lost.

2 Likes