One of my motivations for tracking energy use is to identify and monitor the big power guzzlers around the house. Because I don’t have a good way to measure individual circuits or devices, my best approach would be to look at the history of my whole-house energy usage, and see what appliances that HA tracks as entities (e.g. my furnace) match up with spikes in the overall hourly power usage reported by my meter.
However, my energy monitor (Opower) has an ~48h delay in its reports, which means the integration can’t provide a realtime (or near-realtime) entity indicating my power usage. That means the power data isn’t recorded in the normal entity history, so I can’t view it on the “History” page. Because of that, there’s no way to view energy usage alongside the state history of other devices in my home!
But (if we’re looking at a time more than 48h ago) Home Assistant has the data for power usage, so why can’t I view it together with other entities?!?
(I’m aware that power usage data is different from HA’s normal historical entity data from a technical perspective; I’m saying that despite these technical differences, it seems very unreasonable from a UX point of view that there’s no way to view this historical data in the History tab, along with the other (entity) history HA tracks.)
I’m not sure I understand which menu you’re referring to. This button:
does not work because the integration can’t get the data immediately and therefore does not expose current usage as an entity. As far as I can tell, there’s no way to insert data into an entity’s history after-the-fact. My issue is that, once HA does get the power consumption data, there doesn’t seem to be any way view the power consumption together with the entity history of other things around the house.
I think it’s key information.
HA is not analytical tool. It monitors own entities recording their state. It’s not intended to bulk-process 3rd party data and store it into past history (I doubt it has API fir that).
Adding data to the database by another process (the 3rd party integration) is effectively impossible because of using sqlite. Also HA periodically processes historical data, calculating aggregations needed in several places of the system?(short and lond tetm hiatory). Such import could be too complex to be consistent with the rest.
Let me repeat main point: I see HA as system not intended for analytics. There are other systems dedicated for that.
Please don’t get me wrong. I’m not trying to devaluate your WTH. Just trying to explain that
any attempt of adding such functionality will end up with the result being subpar to competition. thus it doesn’t make sense
What I can suggest you is to manage storing data HA in other dbs like infux or postgres/timescaledb. Then populate data tables with data from your monitoring device.
After that, just pull those all data to Grafana, or execute desired analytics other way. There are plenty possibilities outside of HA.
But HA already does load & store power usage data for the Energy dashboard. I’m not asking to import additional data that I acquired from some other source and view it in HA. I’m asking why we can’t view the energy consumption data that HA tracks together with entities HA tracks too.
I don’t know for sure, but I think the reason entities and power data can’t be displayed together is that they’re completely different kinds of things from a technical perspective. But from a UX point of view, both entity history and energy consumption data record the history of things that have happened at my home in the recent past, so it seems a little dumb/confusing that we can’t easily view them together.
I disagree that this means it’s not worth implementing. Absolutely, the History page is not a fully-fledged analytics viewer, but I don’t think that’s a good reason to prevent us from viewing this one piece of data along with the other data in HA. Why can we view the history of two entities, say, the door lock and the kitchen light, but not the power history? What’s the difference?
I think this is a topic for the integration. At least for energy it is possible for integration to insert historical data, at least I know one that does this. I’m guessing it inserts it directly in the database, so it should be possible to do it with state history too.
understood, you are asking for data import into historical data only. Note those data have per-hour resolution, so they would have to be aggregated from your source in order to store into db.
Technically should be possible.
Still I would go for external solution. At least because it’s very easy to lost sqlite db while you expecting to collect data for years
we can see power history if stored from real-time sensor changes.
What HA cannot do right now is to import bulk of historical measurement data and put them within other data.
I think there’s some confusion here. I’m not asking for any changes to the way HA loads or stores data. I don’t want any additional “data imports” beyond what HA already does. I’m just asking for an option on the history page to view the energy consumption together with entities.
I acknowledge that energy consumption data and regular entity history are stored differently inside HA, but I think the technical hurdle that might be required to show energy consumption in the history graph is moot from a user experience perspective. It makes no sense that I shouldn’t be able to see the power data that HA clearly already has (as seen on the energy dashboard) in the History tab.
I’m just asking for an option on the history page to view the energy consumption together with entities.
So it would not be too hard to allow history panel to add external stats like opower to be selectable. However I do think that even if you had this it would be an unsatisfying result.
Increasing type statistics have three values recorded in the statistics database, state, change, and sum.
The current behavior is only to show the state column for increasing statistics when shown on the history panel. For opower these might just be null, I’m not sure. I suspect it might only record sum and change. But there’s no way to choose which property of the statistic to show, history panel gives a limited view of statistics, not as full featured as the statistics graph card where you can choose the property to plot. If we show the sum, it will just be an ever increasing line going up and to the right, very hard to use that for any kind of meaningful comparison.
Ideally you’d want something more like the histogram plot that the energy panel uses right, where you can see the energy recorded during each period?
So I think your power metering system must report data immediately, @maxym? It looks like your integration is reporting power data as an entity.
Mine, Opower, doesn’t exactly report an entity. I don’t understand exactly what it’s doing, but I get an option in the energy dash config to add the power consumption, opower:scl_elec_xxxxxxxxxx_energy_consumption. Opower has an aforementioned 48hr delay, but the data appears in the energy dash if I go back a few days.
I have no idea how this works or what it’s called, because it seems to be getting historical data from 48h ago. I wasn’t aware that many other energy consumption integrations were reporting data as an entity.
So my original request was that this weird historical energy data be viewable in the history page, just like the entities shown in @maxym’s screenshot.
Yeah so, again, I don’t really understand how HA is recording/representing energy data. Does the increasing statistic type even apply to energy consumption? Not sure if energy is some sort of special subclass of an entity or something? If I understand correctly, I think there would already have to be some code to “translate” energy data o something the existing history graph system understands.
Ok so how I understand this now: Your energy dashboard data is correct and you get the data from Opower right? This is probably like PV forecast where you get a graph from one API call with multiple values.
You should have posted a screenshot with your initial suggestion to make it easier for us to understand.
So what you want is historical energy data shown next to historical sensor data from like your washing machine?
The problem your setup is that the opower sensor cant be “read” correctly through “show more”/history right?
You can add the washing machine to the individual devices section in the energy dashboard config and then see all hourly values in the energy dashboard.
You can also take the energy cards and add them to your normal dashboard next to other graphs. This is also a nice card btw.
And you maybe can take the data you got from opower, read it through apex charts (idk if that is possible) and combine the graphs like that.
For the last solution you could get the data yourself, write it to influx and combine that with grafana to show that on a dashboard (both available as addons).
Yes. All the questions you asked are correct. Sorry for the confusion; I wasn’t aware my setup was so different
Adding individual devices to the energy dash is sooo close to what I’m looking for. The problem is the energy dashboard only displays energy data. I’m wanting to compare total energy usage with the states of devices (like furnace idle/running).
Now, I don’t think it makes sense to add any entity state data to the energy dash, which is why I was thinking we could just expose the energy data to the history page (perhaps in the form of some pseudo-entity), which is better-suited for displaying entities and states.
The best way is the energy cards on a custom dashboard and something like the history graph card.
The only problem is the time selection, but you can replace the history card with grafana where you can select the date too.
In 2025.1 should come a feature to scroll in the history but idk if that aplies to the card too.
Right, so my proposal is that we can display energy data on the history page itself, rather than needing cards that are harder to select a time window etc. We already have a nice history tab for viewing history, so it doesn’t make sense that this one other piece of data can’t be included as well.