Using values of energy management in dashboards

I love the new energy management feature as it is very similar to what I am already using (though significantly easier). As I use some features in existing dashboards I was wondering how I could use the values in existing dashboards without the need to use the energy cards themselves. Would it be possible to extract those values from the database or something?

See below an example which basically shows the energy consumption since midnight.

2 Likes

I like to see that feature also…

for me as well

you could probably use the SQL Integration to create sensors that request the data directly from the Database…

As my similar FR has rcently been closed I wat to add, what I have written there, bcause I would like to see this FR more generic than only having daily. So if someone from the developers will eventually go in this direction, it would be great to cover is in a very flexible way:

If I want to have an own dashboard with the e.g. energy consumption of several sensors for today or this month, I have to create utility_meter sensors. Same for graphs, etc, e.g.distribution today.

image

So from a sensor

sensor.foobar_energy_counter

with

state_class: total_increasing
unit_of_measurement: Wh
device_class: energy

I have already four sensors for daily, weekly, monthly and yearly.

energy_counter_foobar_aktor_daily:
  source: sensor.foobar_energy_counter
  cycle: daily
etc.

But HA can select and display it without such utility_meter sensors.

As this integrations is already number one in loading time and I have already >150 of them (growing) and can only have fix time-ranges with this, I wonder, if it would not be more than beneficial to have direct access to such data, e.g. in a kind of virtual entities, like.

sensor.foobar_energy_counter:daily
sensor.foobar_energy_counter:weeky
sensor.foobar_energy_counter:monthly
sensor.foobar_energy_counter:yearly
sensor.foobar_energy_counter:timeframe[01.06.2022-10.06.2022]

So I can directly use them as entities in dashboards, graphs, etc.And reducing the overhead of the utility_sensors directly with that.

I’m bumping this one !

Can someone please explain if it is possible to retrieve the values produced by the Energy Panel on a monthly/weekly/daily basis and use in other home assistant applications ?

If that is the case, how to do it ?
SQL sensors seems to be too complicated and probably not that robust.

The Dashboard does calculate the daily, weekly, monthly usage information directly from the raw data in the database.
So it is not directly possible to use these information in Automations or wherever.

If it is for displaying - you can add specific cards from the Energy Dashboard on other Dashboards, but these cards will just display what you already have in your energy dashboard.

Since you do need to include the source sensors into your energy dashboard, the system is already writing statistics for it - so in my opinion, the best approach should be to use utility meters.

They are basically sum up the states from your source sensors on a specific cycle and then reset.

for example: you do have a sensor for your “total energy consumption” - and this sensor is just continuesly increasing:
Then, create Utility Meters (helpers) - with this sensor as Source - and you could create them with daily, weekly, monthly, quaterly and yearly reset cycles…

You should be able to create utility meters nearly with every sensor that does count something.

Hm, didn’t get this What you are describing is the status quo and the “work-around” and need of creating a lot and more and more utility meters. I cannot count mine anymore and it is delaying the restarts of the system, etc.

And all this, where the dashboards, energy cockpit is able to calculate the same stuff on the fly and without utility meters. Of course, the basis is always the data in the db.

Therefore, virtuell entities, like

sensor.foobar_energy_counter:daily
sensor.foobar_energy_counter:weeky
sensor.foobar_energy_counter:monthly
sensor.foobar_energy_counter:yearly
sensor.foobar_energy_counter:timeframe[01.06.2022-10.06.2022]

with on the fly calculation (as in the cards and dashboards) and without the need of utility meters, would be very helpfull and the idea of the improvement here.

3 Likes

Bumping this one up!

It would be great to have access to the Energy Dashboard values. I would like to show them on an e-Ink display. (just dummy values for now)

+1 from me as well.

I am using my MagicMirror to display the state of my home. I would love to be able to simply “query” the energy data directly from entities (as this is how the MagicMirror module works).

In my (non-coder) opinion, this shouldn’t be too complicated, as this data is already being calculated for the dashboard.

Does anyone else have a need for this? :slight_smile:

has anyone an idea what the names of the costs that are calculated are in the database?

jeedewee gave me a good example of how to make a query. and that query can be inserted in an integration, just search for sql in the integration section.
example found here: Energy dashboard: how to use the costs as entity? - #2 by tom_l

so if we know how everything is called in the database we can use this method to create sensor entities which we can use…

1 Like

+1

Don’t know a thing about SQL… :smiling_face_with_tear:

+1
This feature would be great to have. I would like to use a energy statistic sensor to calculate the ROI of my photovoltaik system.

+1 to this because the Utility Meter Helpers I use seem to not reset if the HA is not powered on around midnight.

+1, Ive tried the utility meter option, but it does not match the 3rd party app. The HA Energy does match it though.

+1 because calculating it on my own via SQL, based on live prices at the time sounds like something I would mess up and get angry about. :smiley: